[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2905] contrib/py/scripts/addons/btrace /bTrace.py: removed bpy. selection and replaced with new module thanks to Truman (select_order).

Scott Wood scott at thewooddesign.com
Mon Jan 16 18:15:35 CET 2012


Revision: 2905
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2905
Author:   crazycourier
Date:     2012-01-16 17:15:26 +0000 (Mon, 16 Jan 2012)
Log Message:
-----------
removed bpy.selection and replaced with new module thanks to Truman (select_order). Now there is an option to respect order selection.

Made numerous other changes as noted in: http://codereview.appspot.com/5502053

Grow animation works with multiple objects now. Curve setting work more consistently within tools.

Modified Paths:
--------------
    contrib/py/scripts/addons/btrace/bTrace.py

Modified: contrib/py/scripts/addons/btrace/bTrace.py
===================================================================
--- contrib/py/scripts/addons/btrace/bTrace.py	2012-01-15 19:53:47 UTC (rev 2904)
+++ contrib/py/scripts/addons/btrace/bTrace.py	2012-01-16 17:15:26 UTC (rev 2905)
@@ -19,91 +19,87 @@
 bl_info = {
     'name': "bTrace",
     'author': "liero, crazycourier, Atom, Meta-Androcto, MacKracken",
-    'version': (1, 0, ),
-    'blender': (2, 6, 4),
+    'version': (1, 1, ),
+    'blender': (2, 61, 1),
     'location': "View3D > Tools",
     'description': "Tools for converting/animating objects/particles into curves",
     'warning': "Still under development, bug reports appreciated",
     'wiki_url': "",
-    'tracker_url': "",
+    'tracker_url': "http://projects.blender.org/tracker/?func=detail&atid=468&aid=29563&group_id=153",
     'category': "Mesh"
     }
 
 #### TO DO LIST ####
-### [   ]  Make grow animation happen to all selected, not just current
-### [   ]  Adjust bevel radius for grow curve
-### [   ]  Add Smooth option to curves
-### [   ] Fix F-Curve Time Scale
-### [   ] Grease Pencil doesn't show if nothing selected
-    
-    
-import bpy
-from bpy.props import *
+### [   ]  Add more options to curve radius/modulation plus cyclic/connect curve option
 
+import bpy, selection_utils
+from bpy.props import FloatProperty, EnumProperty, IntProperty, BoolProperty
+
 # Class to define properties
 class TracerProperties(bpy.types.PropertyGroup):
-    p = bpy.props
-    enabled = p.IntProperty(default=0)
+    enabled = IntProperty(default=0)
     # Object Curve Settings
-    TRcurve_spline = p.EnumProperty(name="Spline", items=(("POLY", "Poly", "Use Poly spline type"),  ("NURBS", "Nurbs", "Use Nurbs spline type"), ("BEZIER", "Bezier", "Use Bezier spline type")), description="Choose which type of spline to use when curve is created", default="BEZIER")
-    TRcurve_handle = p.EnumProperty(name="Handle", items=(("ALIGNED", "Aligned", "Use Aligned Handle Type"), ("AUTOMATIC", "Automatic", "Use Auto Handle Type"), ("FREE_ALIGN", "Free Align", "Use Free Handle Type"), ("VECTOR", "Vector", "Use Vector Handle Type")), description="Choose which type of handle to use when curve is created",  default="VECTOR")
-    TRcurve_resolution = p.IntProperty(name="Bevel Resolution" , min=1, max=32, default=4, description="Adjust the Bevel resolution")
-    TRcurve_depth = p.FloatProperty(name="Bevel Depth", min=0.0, max=100.0, default=0.125, description="Adjust the Bevel depth")
-    TRcurve_u = p.IntProperty(name="Resolution U", min=0, max=64, default=12, description="Adjust the Surface resolution")
-    TRcurve_join = p.BoolProperty(name="Join Curves", default=False, description="Join all the curves after they have been created")
+    curve_spline = EnumProperty(name="Spline", items=(("POLY", "Poly", "Use Poly spline type"),  ("NURBS", "Nurbs", "Use Nurbs spline type"), ("BEZIER", "Bezier", "Use Bezier spline type")), description="Choose which type of spline to use when curve is created", default="BEZIER")
+    curve_handle = EnumProperty(name="Handle", items=(("ALIGNED", "Aligned", "Use Aligned Handle Type"), ("AUTOMATIC", "Automatic", "Use Auto Handle Type"), ("FREE_ALIGN", "Free Align", "Use Free Handle Type"), ("VECTOR", "Vector", "Use Vector Handle Type")), description="Choose which type of handle to use when curve is created",  default="VECTOR")
+    curve_resolution = IntProperty(name="Bevel Resolution" , min=1, max=32, default=4, description="Adjust the Bevel resolution")
+    curve_depth = FloatProperty(name="Bevel Depth", min=0.0, max=100.0, default=0.125, description="Adjust the Bevel depth")
+    curve_u = IntProperty(name="Resolution U", min=0, max=64, default=12, description="Adjust the Surface resolution")
+    curve_join = BoolProperty(name="Join Curves", default=False, description="Join all the curves after they have been created")
+    curve_smooth = BoolProperty(name="Smooth", default=True, description="Render curve smooth")
     # Option to Duplicate Mesh
-    TRobject_duplicate = p.BoolProperty(name="Apply to Copy", default=False, description="Apply curve to a copy of object")
+    object_duplicate = BoolProperty(name="Apply to Copy", default=False, description="Apply curve to a copy of object")
     # Distort Mesh options
-    TRdistort_modscale = p.IntProperty(name="Modulation Scale", default=2, description="Add a scale to modulate the curve at random points, set to 0 to disable")
-    TRdistort_noise = p.FloatProperty(name="Mesh Noise", min=0.0, max=50.0, default=0.00, description="Adjust noise added to mesh before adding curve")
+    distort_modscale = IntProperty(name="Modulation Scale", min=0, max=50, default=2, description="Add a scale to modulate the curve at random points, set to 0 to disable")
+    distort_noise = FloatProperty(name="Mesh Noise", min=0.0, max=50.0, default=0.00, description="Adjust noise added to mesh before adding curve")
     # Particle Options    
-    TRparticle_step = p.IntProperty(name="Step Size", min=1, max=50, default=5, description="Sample one every this number of frames")
-    TRparticle_auto = p.BoolProperty(name='Auto Frame Range', default=True, description='Calculate Frame Range from particles life')
-    TRparticle_f_start = p.IntProperty( name='Start Frame', min=1, max=5000, default=1, description='Start frame')
-    TRparticle_f_end = p.IntProperty( name='End Frame', min=1, max=5000, default=250, description='End frame')
+    particle_step = IntProperty(name="Step Size", min=1, max=50, default=5, description="Sample one every this number of frames")
+    particle_auto = BoolProperty(name='Auto Frame Range', default=True, description='Calculate Frame Range from particles life')
+    particle_f_start = IntProperty( name='Start Frame', min=1, max=5000, default=1, description='Start frame')
+    particle_f_end = IntProperty( name='End Frame', min=1, max=5000, default=250, description='End frame')
     # F-Curve Modifier Properties
-    TRfcnoise_rot = p.BoolProperty(name="Rotation", default=False, description="Affect Rotation")
-    TRfcnoise_loc = p.BoolProperty(name="Location", default=True, description="Affect Location")
-    TRfcnoise_scale = p.BoolProperty(name="Scale", default=False, description="Affect Scale")
-    TRfcnoise_amp = p.IntProperty(name="Amp", min=1, max=500, default=5, description="Adjust the amplitude")
-    TRfcnoise_timescale = p.FloatProperty(name="Time Scale", min=1, max=500, default=50, description="Adjust the time scale")
-    TRfcnoise_key = p.BoolProperty(name="Add Keyframe", default=True, description="Keyframe is needed for tool, this adds a LocRotScale keyframe")
+    fcnoise_rot = BoolProperty(name="Rotation", default=False, description="Affect Rotation")
+    fcnoise_loc = BoolProperty(name="Location", default=True, description="Affect Location")
+    fcnoise_scale = BoolProperty(name="Scale", default=False, description="Affect Scale")
+    fcnoise_amp = IntProperty(name="Amp", min=1, max=500, default=5, description="Adjust the amplitude")
+    fcnoise_timescale = FloatProperty(name="Time Scale", min=1, max=500, default=50, description="Adjust the time scale")
+    fcnoise_key = BoolProperty(name="Add Keyframe", default=True, description="Keyframe is needed for tool, this adds a LocRotScale keyframe")
     # Toolbar Settings/Options Booleans
-    TRcurve_settings = p.BoolProperty(name="Curve Settings", default=False, description="Change the settings for the created curve")
-    TRparticle_settings = p.BoolProperty(name="Particle Settings", default=False, description="Show the settings for the created curve")
-    TRanimation_settings = p.BoolProperty(name="Animation Settings", default=False, description="Show the settings for the Animations")
-    TRdistort_curve = p.BoolProperty(name="Add Distortion", default=False, description="Set options to distort the final curve")
-    TRconnect_noise = p.BoolProperty(name="F-Curve Noise", default=False, description="Adds F-Curve Noise Modifier to selected objects")
-    TRsettings_objectTrace = p.BoolProperty(name="Object Trace Settings", default=False, description="Trace selected mesh object with a curve")
-    TRsettings_objectsConnect = p.BoolProperty(name="Objects Connect Settings", default=False, description="Connect objects with a curve controlled by hooks")
-    TRsettings_particleTrace = p.BoolProperty(name="Particle Trace Settings", default=False, description="Trace particle path with a  curve")
-    TRsettings_particleConnect = p.BoolProperty(name="Particle Connect Settings", default=False, description="Connect particles with a curves and animated over particle lifetime")
-    TRsettings_growCurve = p.BoolProperty(name="Grow Curve Settings", default=False, description="Animate curve bevel over time by keyframing points radius")
-    TRsettings_fcurve = p.BoolProperty(name="F-Curve Settings", default=False, description="F-Curve Settings")
+    curve_settings = BoolProperty(name="Curve Settings", default=False, description="Change the settings for the created curve")
+    particle_settings = BoolProperty(name="Particle Settings", default=False, description="Show the settings for the created curve")
+    animation_settings = BoolProperty(name="Animation Settings", default=False, description="Show the settings for the Animations")
+    distort_curve = BoolProperty(name="Add Distortion", default=False, description="Set options to distort the final curve")
+    connect_noise = BoolProperty(name="F-Curve Noise", default=False, description="Adds F-Curve Noise Modifier to selected objects")
+    settings_objectTrace = BoolProperty(name="Object Trace Settings", default=False, description="Trace selected mesh object with a curve")
+    settings_objectsConnect = BoolProperty(name="Objects Connect Settings", default=False, description="Connect objects with a curve controlled by hooks")
+    respect_order = BoolProperty(name="Order", default=False, description="Remember order objects were selected")
+    settings_particleTrace = BoolProperty(name="Particle Trace Settings", default=False, description="Trace particle path with a  curve")
+    settings_particleConnect = BoolProperty(name="Particle Connect Settings", default=False, description="Connect particles with a curves and animated over particle lifetime")

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-extensions-cvs mailing list