[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [853] trunk/py/scripts/addons/ add_curve_aceous_galore.py: revert last commit.
Brendon Murphy
meta.androcto1 at gmail.com
Tue Jul 27 01:08:09 CEST 2010
Revision: 853
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=853
Author: meta-androcto
Date: 2010-07-27 01:08:09 +0200 (Tue, 27 Jul 2010)
Log Message:
-----------
revert last commit.
new functions had broken script.
will fix then update.
Modified Paths:
--------------
trunk/py/scripts/addons/add_curve_aceous_galore.py
Modified: trunk/py/scripts/addons/add_curve_aceous_galore.py
===================================================================
--- trunk/py/scripts/addons/add_curve_aceous_galore.py 2010-07-26 21:53:47 UTC (rev 852)
+++ trunk/py/scripts/addons/add_curve_aceous_galore.py 2010-07-26 23:08:09 UTC (rev 853)
@@ -20,10 +20,10 @@
bl_addon_info = {
'name': 'Add Curve: Curveaceous Galore!',
'author': 'Jimmy Hazevoet, testscreenings',
- 'version': '0.1.1',
+ 'version': '0.1',
'blender': (2, 5, 3),
- 'location': 'View3D > Add > Curve',
- 'description': 'Adds many types of curves',
+ 'location': 'Add Curve menu',
+ 'description': 'adds many types of curves',
'warning': '', # used for warning icon and text in addons panel
'wiki_url': 'http://wiki.blender.org/index.php/Extensions:2.5/Py/' \
'Scripts/Curve/Curves_Galore',
@@ -38,12 +38,10 @@
from bpy.props import *
from mathutils import *
from math import *
-from noise import *
-
###------------------------------------------------------------
#### Some functions to use with others:
###------------------------------------------------------------
-
+'''
#------------------------------------------------------------
# Generate random number:
def randnum( low=0.0, high=1.0, seed=0 ):
@@ -64,8 +62,8 @@
(type=float)
"""
- seed_set( seed )
- rnum = random_unit_vector()[0]
+ s = Noise.setRandomSeed( seed )
+ rnum = Noise.random()
rnum = rnum*(high-low)
rnum = rnum+low
return rnum
@@ -74,7 +72,7 @@
#------------------------------------------------------------
# Make some noise:
-def vTurbNoise(x,y,z, iScale=0.25, Size=1.0, Depth=6, Hard=0, Basis=0, Seed=0 ):
+def vTurbNoise((x,y,z), iScale=0.25, Size=1.0, Depth=6, Hard=0, Basis=0, Seed=0 ):
"""
vTurbNoise((x,y,z), iScale=0.25, Size=1.0, Depth=6, Hard=0, Basis=0, Seed=0 )
@@ -102,7 +100,7 @@
rand = randnum(-100,100,Seed)
if Basis ==9: Basis = 14
- vTurb = turbulence_vector(( x/Size+rand, y/Size+rand, z/Size+rand ), Depth, Hard, Basis )
+ vTurb = Noise.vTurbulence(( x/Size+rand, y/Size+rand, z/Size+rand ), Depth, Hard, Basis )
tx = vTurb[0]*iScale
ty = vTurb[1]*iScale
tz = vTurb[2]*iScale
@@ -112,7 +110,7 @@
#------------------------------------------------------------
# Axis: ( used in 3DCurve Turbulence )
-def AxisFlip(x,y,z, x_axis=1, y_axis=0, z_axis=0, flip=0 ):
+def AxisFlip((x,y,z), x_axis=1, y_axis=1, z_axis=1, flip=0 ):
if flip != 0:
flip *= -1
else: flip = 1
@@ -120,8 +118,8 @@
y *= y_axis*flip
z *= z_axis*flip
return x,y,z
+'''
-
###-------------------------------------------------------------------
#### 2D Curve shape functions:
###-------------------------------------------------------------------
@@ -448,7 +446,7 @@
i+=1
return newpoints
-
+'''
##------------------------------------------------------------
# 2DCurve: Splat:
def SplatCurve(sides=24, scale=1.0, seed=0, basis=0, radius=1.0):
@@ -478,14 +476,14 @@
i = 0
while i < sides:
t = (i*step)
- turb = vTurbNoise(t,t,t, 1.0, scale, 6, 0, basis, seed )
- turb = turb[0] * 0.5 + 0.5
+ turb = vTurbNoise(t, 1.0, scale, 6, 0, basis, seed )
+ turb = turb[2] * 0.5 + 0.5
x = sin(t*pi)*radius * turb
y = cos(t*pi)*radius * turb
newpoints.append([x,y,0])
i+=1
return newpoints
-
+'''
###-----------------------------------------------------------
#### 3D curve shape functions:
###-----------------------------------------------------------
@@ -575,46 +573,6 @@
newpoints = [[-1,-1,0], [-1,1,0], [1,1,0], [1,-1,0]]
return newpoints
-
-###------------------------------------------------------------
-# 3DCurve: Turbulence: tnoise=[ iScale, Size, Depth, Hard, Basis, Seed ], axis=[x,y,z]
-def TurbulenceCurve( number=24, length=2.0, iScale=0.25, Size=1.0, Depth=6, Hard=0, Basis=0, Seed=0 ):
- """
- TurbulenceCurve( number=24, length=2.0, iScale=0.25, Size=1.0, Depth=6, Hard=0, Basis=0, Seed=0 )
-
- Create turbulence curve
-
- Parameters:
- number - the number of points
- (type=int)
- length - length of curve
- (type=float)
- Size - Noise size - float 0.0,inf
- Depth - Noise depth - int 0,8
- Hard - Noise hard - int 0,1
- Basis - Noise basis - int 0,9
- Seed
- Returns:
- a list with lists of x,y,z coordinates for curve points, [[x,y,z],[x,y,z],...n]
- (type=list)
- """
-
- newpoints = []
- step = (length/(number-1))
- i = 0
- while i < number:
- t = (i*step)
- x,y,z = AxisFlip(t,t,t, 0, 0, 1, 0 )
- turb = vTurbNoise(x,y,z, iScale, Size=1.0, Depth=6, Hard=0, Basis=0, Seed=0 )
- if i==0:
- newpoints.append([x,y,z])
- else:
- newpoints.append([x+turb[0], y+turb[1], z+turb[2] ])
- i+=1
- return newpoints
-
-
-
##------------------------------------------------------------
# calculates the matrix for the new object
# depending on user pref
@@ -735,15 +693,13 @@
verts = CogCurve(options[20], innerRadius, middleRadius, outerRadius, options[21])
if galType == 'Nsided':
verts = nSideCurve(options[22], outerRadius)
- if galType == 'Splat':
- verts = SplatCurve(options[23], options[24], options[25], options[26], outerRadius)
+# if galType == 'Splat':
+# verts = SplatCurve(options[23], options[24], options[25], options[26], outerRadius)
if galType == 'Helix':
verts = HelixCurve(options[27], options[28], options[29], options[30], options[31], options[32], options[33])
if galType == 'Cycloid':
verts = CycloidCurve(options[34], options[35], options[36], options[37], options[38], options[39], options[40])
- if galType == 'Turbulence':
- verts = TurbulenceCurve(options[41], options[42], options[43], options[44], options[45], options[46], options[47], options[48])
-
+
# turn verts into array
vertArray = vertsToPoints(verts, splineType)
@@ -771,10 +727,9 @@
('Arc', 'Arc', 'Arc'),
('Cogwheel', 'Cogwheel', 'Cogwheel'),
('Nsided', 'Nsided', 'Nsided'),
- ('Splat', 'Splat', 'Splat'),
+# ('Splat', 'Splat', 'Splat'),
('Cycloid', 'Cycloid', 'Cycloid'),
- ('Helix', 'Helix (3D)', 'Helix'),
- ('Turbulence', 'Turbulence (3D)', 'Turbulence')]
+ ('Helix', 'Helix (3D)', 'Helix')]
GalloreType = EnumProperty(name="Type",
description="Form of Curve to create",
items=GalloreTypes)
@@ -916,8 +871,6 @@
default=1.0,
min=0, soft_min=0,
description="Splat scale")
-
- ###### Splat + Turbulence props
seed = IntProperty(name="Seed",
default=0,
min=0, soft_min=0,
@@ -980,32 +933,6 @@
default=360.0,
description="Cycloid end angle")
- #### Turbulence properties
- turb_points = IntProperty(name="Resolution",
- default=100,
- min=3, soft_min=3,
- description="Resolution")
- turb_length = FloatProperty(name="Length",
- default=2.0,
- description="Length")
- turb_iscale = FloatProperty(name="Intensity scale",
- default=0.25,
- min=0.01, soft_min=0.01,
- description="Intensity scale")
- turb_size = FloatProperty(name="Noise size",
- default=0.25,
- min=0.01, soft_min=0.01,
- description="Noise size")
- turb_depth = IntProperty(name="Depth",
- default=6,
- min=1, max=8,
- description="Noise depth")
- turb_hard = BoolProperty(name="Hard",
- default=0,
- description="Hard noise")
-
-
-
##### DRAW #####
def draw(self, context):
props = self.properties
@@ -1053,14 +980,14 @@
if props.GalloreType == 'Nsided':
box.prop(props, 'Nsides')
box.prop(props, 'outerRadius', text='Radius')
-
+ '''
if props.GalloreType == 'Splat':
box.prop(props, 'splatSides')
box.prop(props, 'outerRadius')
box.prop(props, 'splatScale')
box.prop(props, 'seed')
box.prop(props, 'basis')
-
+ '''
if props.GalloreType == 'Helix':
box.prop(props, 'helixPoints')
box.prop(props, 'helixHeight')
@@ -1078,16 +1005,6 @@
box.prop(props, 'cyclo_b')
box.prop(props, 'cyclo_d')
- if props.GalloreType == 'Turbulence':
- box.prop(props, 'turb_points')
- box.prop(props, 'turb_length')
- box.prop(props, 'turb_size')
- box.prop(props, 'turb_iscale')
- box.prop(props, 'turb_depth')
- box.prop(props, 'seed')
- box.prop(props, 'basis')
- #box.prop(props, 'turb_hard')
-
col = layout.column()
col.label(text="Output Curve Type")
row = layout.row()
@@ -1124,9 +1041,9 @@
bpy.context.user_preferences.edit.global_undo = False
props = self.properties
- if props.GalloreType in ['Helix', 'Cycloid', 'Turbulence']:
+ if props.GalloreType in ['Helix', 'Cycloid']:
props.shape = '3D'
- if props.GalloreType in ['Helix', 'Turbulence']:
+ if props.GalloreType in ['Helix']:
props.cyclic_u = False
# Options
@@ -1178,21 +1095,12 @@
props.helix_b, #33
# Cycloid properties
props.cycloPoints, #34
- props.cyclo_d, #35
+ props.cyclo_d, #35
props.cycloType, #36
props.cyclo_a, #37
props.cyclo_b, #38
props.cycloStart, #39
- props.cycloEnd, #40
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list