[Bf-extensions-cvs] [93b9836] master: fix
Brendon Murphy
noreply at git.blender.org
Mon May 4 02:47:23 CEST 2015
Commit: 93b9836e0ba6c634a4531622eba86fd501a83ba5
Author: Brendon Murphy
Date: Sat Apr 18 15:56:40 2015 +1000
Branches: master
https://developer.blender.org/rBA93b9836e0ba6c634a4531622eba86fd501a83ba5
fix
===================================================================
A add_curve_extra_objects/__init__.py
A add_curve_extra_objects/add_curve_aceous_galore.py
A add_curve_extra_objects/add_curve_spirals.py
A add_curve_extra_objects/add_curve_torus_knots.py
===================================================================
diff --git a/add_curve_extra_objects/__init__.py b/add_curve_extra_objects/__init__.py
new file mode 100644
index 0000000..434b719
--- /dev/null
+++ b/add_curve_extra_objects/__init__.py
@@ -0,0 +1,82 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+# Contributed to by
+# testscreenings, Alejandro Omar Chocano Vasquez, Jimmy Hazevoet, meta-androcto #
+
+bl_info = {
+ "name": "Extra Objects",
+ "author": "Multiple Authors",
+ "version": (0, 1),
+ "blender": (2, 63, 0),
+ "location": "View3D > Add > Curve > Extra Objects",
+ "description": "Add extra curve object types",
+ "warning": "",
+ "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
+ "Scripts/Curve/Curve_Objects",
+ "category": "Add Curve"}
+
+if "bpy" in locals():
+ import imp
+ imp.reload(add_curve_aceous_galore)
+ imp.reload(add_curve_spirals)
+ imp.reload(add_curve_torus_knots)
+
+else:
+ from . import add_curve_aceous_galore
+ from . import add_curve_spirals
+ from . import add_curve_torus_knots
+
+import bpy
+
+class INFO_MT_curve_extras_add(bpy.types.Menu):
+ # Define the "Extras" menu
+ bl_idname = "curve_extra_objects_add"
+ bl_label = "Extra Objects"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.operator_context = 'INVOKE_REGION_WIN'
+ layout.operator("mesh.curveaceous_galore",
+ text="Curves Galore!")
+ layout.operator("curve.spirals",
+ text="Spirals")
+ layout.operator("curve.torus_knot_plus",
+ text="Torus Knot Plus")
+# Define "Extras" menu
+def menu_func(self, context):
+ self.layout.operator("mesh.curveaceous_galore",
+ text="Curves Galore!")
+ self.layout.operator("curve.torus_knot_plus",
+ text="Torus Knot Plus")
+ self.layout.operator("curve.spirals",
+ text="Spirals")
+
+def register():
+ bpy.utils.register_module(__name__)
+
+ # Add "Extras" menu to the "Add Curve" menu
+ bpy.types.INFO_MT_curve_add.append(menu_func)
+
+def unregister():
+ bpy.utils.unregister_module(__name__)
+
+ # Remove "Extras" menu from the "Add Curve" menu.
+ bpy.types.INFO_MT_curve_add.remove(menu_func)
+
+if __name__ == "__main__":
+ register()
diff --git a/add_curve_extra_objects/add_curve_aceous_galore.py b/add_curve_extra_objects/add_curve_aceous_galore.py
new file mode 100644
index 0000000..0eae5e8
--- /dev/null
+++ b/add_curve_extra_objects/add_curve_aceous_galore.py
@@ -0,0 +1,1122 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+'''
+bl_info = {
+ "name": "Curveaceous Galore!",
+ "author": "Jimmy Hazevoet, testscreenings",
+ "version": (0, 2),
+ "blender": (2, 59, 0),
+ "location": "View3D > Add > Curve",
+ "description": "Adds many different types of Curves",
+ "warning": "", # used for warning icon and text in addons panel
+ "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
+ "Scripts/Curve/Curves_Galore",
+ "category": "Add Curve",
+}
+'''
+
+
+##------------------------------------------------------------
+#### import modules
+import bpy
+from bpy.props import *
+from mathutils import *
+from math import *
+import mathutils.noise as Noise
+###------------------------------------------------------------
+#### Some functions to use with others:
+###------------------------------------------------------------
+
+#------------------------------------------------------------
+# Generate random number:
+def randnum(low=0.0, high=1.0, seed=0):
+ """
+ randnum( low=0.0, high=1.0, seed=0 )
+
+ Create random number
+
+ Parameters:
+ low - lower range
+ (type=float)
+ high - higher range
+ (type=float)
+ seed - the random seed number, if seed is 0, the current time will be used instead
+ (type=int)
+ Returns:
+ a random number
+ (type=float)
+ """
+
+ Noise.seed_set(seed)
+ rnum = Noise.random()
+ rnum = rnum*(high-low)
+ rnum = rnum+low
+ return rnum
+
+
+#------------------------------------------------------------
+# Make some noise:
+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 )
+
+ Create randomised vTurbulence noise
+
+ Parameters:
+ xyz - (x,y,z) float values.
+ (type=3-float tuple)
+ iScale - noise intensity scale
+ (type=float)
+ Size - noise size
+ (type=float)
+ Depth - number of noise values added.
+ (type=int)
+ Hard - noise hardness: 0 - soft noise; 1 - hard noise
+ (type=int)
+ basis - type of noise used for turbulence
+ (type=int)
+ Seed - the random seed number, if seed is 0, the current time will be used instead
+ (type=int)
+ Returns:
+ the generated turbulence vector.
+ (type=3-float list)
+ """
+ rand = randnum(-100,100,Seed)
+ if Basis == 9: Basis = 14
+ vTurb = Noise.turbulence_vector((x/Size+rand, y/Size+rand, z/Size+rand), Depth, Hard, Basis)
+ tx = vTurb[0]*iScale
+ ty = vTurb[1]*iScale
+ tz = vTurb[2]*iScale
+ return tx,ty,tz
+
+
+#------------------------------------------------------------
+# Axis: ( used in 3DCurve Turbulence )
+def AxisFlip(x,y,z, x_axis=1, y_axis=1, z_axis=1, flip=0 ):
+ if flip != 0:
+ flip *= -1
+ else: flip = 1
+ x *= x_axis*flip
+ y *= y_axis*flip
+ z *= z_axis*flip
+ return x,y,z
+
+
+###-------------------------------------------------------------------
+#### 2D Curve shape functions:
+###-------------------------------------------------------------------
+
+##------------------------------------------------------------
+# 2DCurve: Profile: L, H, T, U, Z
+def ProfileCurve(type=0, a=0.25, b=0.25):
+ """
+ ProfileCurve( type=0, a=0.25, b=0.25 )
+
+ Create profile curve
+
+ Parameters:
+ type - select profile type, L, H, T, U, Z
+ (type=int)
+ a - a scaling parameter
+ (type=float)
+ b - b scaling parameter
+ (type=float)
+ Returns:
+ a list with lists of x,y,z coordinates for curve points, [[x,y,z],[x,y,z],...n]
+ (type=list)
+ """
+
+ newpoints = []
+ if type ==1:
+ ## H:
+ a*=0.5
+ b*=0.5
+ newpoints = [ [ -1.0, 1.0, 0.0 ], [ -1.0+a, 1.0, 0.0 ],
+ [ -1.0+a, b, 0.0 ], [ 1.0-a, b, 0.0 ], [ 1.0-a, 1.0, 0.0 ],
+ [ 1.0, 1.0, 0.0 ], [ 1.0, -1.0, 0.0 ], [ 1.0-a, -1.0, 0.0 ],
+ [ 1.0-a, -b, 0.0 ], [ -1.0+a, -b, 0.0 ], [ -1.0+a, -1.0, 0.0 ],
+ [ -1.0, -1.0, 0.0 ] ]
+ elif type ==2:
+ ## T:
+ a*=0.5
+ newpoints = [ [ -1.0, 1.0, 0.0 ], [ 1.0, 1.0, 0.0 ],
+ [ 1.0, 1.0-b, 0.0 ], [ a, 1.0-b, 0.0 ], [ a, -1.0, 0.0 ],
+ [ -a, -1.0, 0.0 ], [ -a, 1.0-b, 0.0 ], [ -1.0, 1.0-b, 0.0 ] ]
+ elif type ==3:
+ ## U:
+ a*=0.5
+ newpoints = [ [ -1.0, 1.0, 0.0 ], [ -1.0+a, 1.0, 0.0 ],
+ [ -1.0+a, -1.0+b, 0.0 ], [ 1.0-a, -1.0+b, 0.0 ], [ 1.0-a, 1.0, 0.0 ],
+ [ 1.0, 1.0, 0.0 ], [ 1.0, -1.0, 0.0 ], [ -1.0, -1.0, 0.0 ] ]
+ elif type ==4:
+ ## Z:
+ a*=0.5
+ newpoints = [ [ -0.5, 1.0, 0.0 ], [ a, 1.0, 0.0 ],
+ [ a, -1.0+b, 0.0 ], [ 1.0, -1.0+b, 0.0 ], [ 1.0, -1.0, 0.0 ],
+ [ -a, -1.0, 0.0 ], [ -a, 1.0-b, 0.0 ], [ -1.0, 1.0-b, 0.0 ],
+ [ -1.0, 1.0, 0.0 ] ]
+ else:
+ ## L:
+ newpoints = [ [ -1.0, 1.0, 0.0 ], [ -1.0+a, 1.0, 0.0 ],
+ [ -1.0+a, -1.0+b, 0.0 ], [ 1.0, -1.0+b, 0.0 ],
+ [ 1.0, -1.0, 0.0 ], [ -1.0, -1.0, 0.0 ] ]
+ return newpoints
+
+##------------------------------------------------------------
+# 2DCurve: Miscellaneous.: Diamond, Arrow1, Arrow2, Square, ....
+def MiscCurve(type=1, a=1.0, b=0.5, c=1.0):
+ """
+ MiscCurve( type=1, a=1.0, b=0.5, c=1.0 )
+
+ Create miscellaneous curves
+
+ Parameters:
+ type - select type, Diamond, Arrow1, Arrow2, Square
+ (type=int)
+ a - a scaling parameter
+ (type=float)
+ b - b scaling parameter
+ (type=float)
+ c - c scaling parameter
+ (type=float)
+ doesn't seem to do anything
+ Returns:
+ a list with lists of x,y,z coordinates for curve points, [[x,y,z],[x,y,z],...n]
+ (type=list)
+ """
+
+ newpo
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list