[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3143] contrib/py/scripts/addons/btrace : -Reorganized GUI for all tools

Scott Wood scott at thewooddesign.com
Wed Mar 21 04:40:21 CET 2012


Revision: 3143
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3143
Author:   crazycourier
Date:     2012-03-21 03:40:10 +0000 (Wed, 21 Mar 2012)
Log Message:
-----------
-Reorganized GUI for all tools
-New "Color Blender" tools for animation and random colors assignment
-Cleaned up the code so it reads easier in some areas

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

Modified: contrib/py/scripts/addons/btrace/__init__.py
===================================================================
--- contrib/py/scripts/addons/btrace/__init__.py	2012-03-21 01:11:26 UTC (rev 3142)
+++ contrib/py/scripts/addons/btrace/__init__.py	2012-03-21 03:40:10 UTC (rev 3143)
@@ -17,23 +17,27 @@
 #END GPL LICENCE BLOCK
 
 bl_info = {
-    'name': "bTrace",
+    'name': "Btrace",
     'author': "liero, crazycourier, Atom, Meta-Androcto, MacKracken",
     'version': (1, 1, ),
-    'blender': (2, 61, 1),
+    'blender': (2, 62),
     'location': "View3D > Tools",
     'description': "Tools for converting/animating objects/particles into curves",
-    'warning': "Some features broken, Still under development",
+    'warning': "Still under development, bug reports appreciated",
     'wiki_url': "",
     'tracker_url': "http://projects.blender.org/tracker/?func=detail&atid=468&aid=29563&group_id=153",
-    'category': "Mesh"
+    'category': "Add Curve"
     }
+
 import bpy
 from .bTrace import *
-from bpy.props import *
+import selection_utils
+from bpy.props import FloatProperty, EnumProperty, IntProperty, BoolProperty, FloatVectorProperty
 
 ### Define Classes to register
-classes = [TracerProperties,
+classes = [
+    TracerProperties,
+    TracerPropertiesMenu,
     addTracerObjectPanel,
     OBJECT_OT_convertcurve,
     OBJECT_OT_objecttrace,
@@ -44,12 +48,17 @@
     OBJECT_OT_curvegrow,
     OBJECT_OT_reset,
     OBJECT_OT_fcnoise,
-    OBJECT_OT_meshfollow]
+    OBJECT_OT_meshfollow,
+    OBJECT_OT_materialChango,
+    OBJECT_OT_clearColorblender
+    ]
 
 def register():
     for c in classes:
         bpy.utils.register_class(c)
     bpy.types.WindowManager.curve_tracer = bpy.props.PointerProperty(type=TracerProperties)
+    bpy.types.WindowManager.btrace_menu = bpy.props.PointerProperty(type=TracerPropertiesMenu, update=deselect_others)
+
 def unregister():
     for c in classes:
         bpy.utils.unregister_class(c)

Modified: contrib/py/scripts/addons/btrace/bTrace.py
===================================================================
--- contrib/py/scripts/addons/btrace/bTrace.py	2012-03-21 01:11:26 UTC (rev 3142)
+++ contrib/py/scripts/addons/btrace/bTrace.py	2012-03-21 03:40:10 UTC (rev 3143)
@@ -32,14 +32,41 @@
 #### TO DO LIST ####
 ### [   ]  Add more options to curve radius/modulation plus cyclic/connect curve option
 
-import bpy, selection_utils
+import bpy
+import selection_utils
 from bpy.props import FloatProperty, EnumProperty, IntProperty, BoolProperty, FloatVectorProperty
 
 
+def deselect_others(ob, context):
+    '''For tool menu select, deselects others if one selected'''
+    selected = addTracerObjectPanel.selected
+    ob[selected] = False
+    keys = [key for key in ob.keys() if ob[key]]  # all the True keys
+    if len(keys) <= 0:
+        ob[selected] = True  # reselect
+        return None
+    for key in keys:
+        addTracerObjectPanel.selected = key
+        ob[key] = True
+
+
+# Class for properties panel
+class TracerPropertiesMenu(bpy.types.PropertyGroup):
+    '''Toolbar show/hide booleans for tool options'''
+    tool_objectTrace = BoolProperty(name="Object Trace", default=False, description="Trace selected mesh object with a curve", update=deselect_others)
+    tool_objectsConnect = BoolProperty(name="Objects Connect", default=False, description="Connect objects with a curve controlled by hooks", update=deselect_others)
+    tool_particleTrace = BoolProperty(name="Particle Trace", default=False, description="Trace particle path with a  curve", update=deselect_others)
+    tool_meshFollow = BoolProperty(name="Mesh Follow", default=False, description="Follow selection items on animated mesh object", update=deselect_others)
+    tool_particleConnect = BoolProperty(name="Particle Connect", default=False, description="Connect particles with a curves and animated over particle lifetime", update=deselect_others)
+    tool_growCurve = BoolProperty(name="Grow Curve", default=False, description="Animate curve bevel over time by keyframing points radius", update=deselect_others)
+    tool_handwrite = BoolProperty(name="Handwriting", default=False, description="Create and Animate curve using the grease pencil", update=deselect_others)
+    tool_fcurve = BoolProperty(name="F-Curve Noise", default=False, description="Add F-Curve noise to selected objects", update=deselect_others)
+    tool_colorblender = BoolProperty(name="Color Blender", default=False, description="Add F-Curve noise to selected objects", update=deselect_others)
+
+
 # Class to define properties
 class TracerProperties(bpy.types.PropertyGroup):
-    enabled = IntProperty(default=0)
-    # Object Curve Settings
+    '''Options for tools'''
     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")
@@ -64,8 +91,8 @@
     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
-    curve_settings = BoolProperty(name="Curve Settings", default=False, description="Change the settings for the created curve")
+    show_curve_settings = BoolProperty(name="Curve Settings", default=False, description="Change the curve settings for the created curve")
+    material_settings = BoolProperty(name="Material Settings", default=False, description="Change the material 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")
@@ -78,16 +105,7 @@
     settings_particleConnect = BoolProperty(name="Particle Connect Settings", default=False, description="Connect particles with a curves and animated over particle lifetime")
     settings_growCurve = BoolProperty(name="Grow Curve Settings", default=False, description="Animate curve bevel over time by keyframing points radius")
     settings_fcurve = BoolProperty(name="F-Curve Settings", default=False, description="F-Curve Settings")
-    settings_meshfollow = BoolProperty(name="Mesh Follow Settings", default=False, description="Mesh Follow Settings")
-    # Toolbar Tool show/hide booleans
-    tool_objectTrace = BoolProperty(name="Object Trace", default=False, description="Trace selected mesh object with a curve")
-    tool_objectsConnect = BoolProperty(name="Objects Connect", default=False, description="Connect objects with a curve controlled by hooks")
-    tool_particleTrace = BoolProperty(name="Particle Trace", default=False, description="Trace particle path with a  curve")
-    tool_meshFollow = BoolProperty(name="Mesh Follow", default=False, description="Follow selection items on animated mesh object")
-    tool_particleConnect = BoolProperty(name="Particle Connect", default=False, description="Connect particles with a curves and animated over particle lifetime")
-    tool_growCurve = BoolProperty(name="Grow Curve", default=False, description="Animate curve bevel over time by keyframing points radius")
-    tool_handwrite = BoolProperty(name="Handwriting", default=False, description="Create and Animate curve using the grease pencil")
-    tool_fcurve = BoolProperty(name="F-Curve Noise", default=False, description="Add F-Curve noise to selected objects")
+    settings_toggle = BoolProperty(name="Settings", default=False, description="Toggle Settings")
     # Animation Options
     anim_auto = BoolProperty(name='Auto Frame Range', default=True, description='Automatically calculate Frame Range')
     anim_f_start = IntProperty(name='Start', min=1, max=2500, default=1, description='Start frame / Hidden object')
@@ -118,291 +136,346 @@
     trace_mat_color = FloatVectorProperty(name="Material Color", description="Choose material color", min=0, max=1, default=(0.0,0.3,0.6), subtype="COLOR")
     trace_mat_random = BoolProperty(name="Random Color", default=False, description='Make the material colors random')
 
+    # Material custom Properties properties
+    mat_simple_adv_toggle = EnumProperty(name="Material Options", items=(("SIMPLE", "Simple", "Show Simple Material Options"), ("ADVANCED", "Advanced", "Show Advanced Material Options")), description="Choose which Material Options to show", default="SIMPLE")
+    mat_run_color_blender = BoolProperty(name="Run Color Blender", default=False, description="Generate colors from a color scheme")
+    mmColors = bpy.props.EnumProperty(
+        items=(("RANDOM", "Random", "Use random colors"),
+                ("CUSTOM", "Custom", "Use custom colors"),
+                ("BW", "Black/White", "Use Black and White"),
+                ("BRIGHT", "Bright Colors", "Use Bright colors"),
+                ("EARTH", "Earth", "Use Earth colors"),
+                ("GREENBLUE", "Green to Blue", "Use Green to Blue colors")),
+        description="Choose which type of colors the materials uses",
+        default="BRIGHT",
+        name="Define a color palette")
+    # Custom property for how many keyframes to skip
+    mmSkip = bpy.props.IntProperty(name="frames", min=1, max=500, default=20, description="Number of frames between each keyframes")
+    # Custom property to enable/disable random order for the 

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-extensions-cvs mailing list