[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27136] trunk/blender/release/scripts/ui: AnimViz (Motion Paths + Ghosting) panels are registered so that they will show up in a sensible location in the properties window .

Joshua Leung aligorith at gmail.com
Thu Feb 25 13:01:43 CET 2010


Revision: 27136
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27136
Author:   aligorith
Date:     2010-02-25 13:01:43 +0100 (Thu, 25 Feb 2010)

Log Message:
-----------
AnimViz (Motion Paths + Ghosting) panels are registered so that they will show up in a sensible location in the properties window. Also made these panels collapsed by default.

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/properties_animviz.py
    trunk/blender/release/scripts/ui/properties_data_armature.py
    trunk/blender/release/scripts/ui/properties_object.py

Modified: trunk/blender/release/scripts/ui/properties_animviz.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_animviz.py	2010-02-25 06:05:56 UTC (rev 27135)
+++ trunk/blender/release/scripts/ui/properties_animviz.py	2010-02-25 12:01:43 UTC (rev 27136)
@@ -29,6 +29,7 @@
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_label = "Motion Paths"
+    bl_default_closed = True
 
     def draw_settings(self, context, avs, wide_ui, bones=False):
         layout = self.layout
@@ -68,6 +69,7 @@
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_label = "Onion Skinning"
+    bl_default_closed = True
 
     def draw(self, context):
         layout = self.layout
@@ -101,7 +103,6 @@
 ################################################
 # Specific Panels for DataTypes
 
-
 class OBJECT_PT_motion_paths(MotionPathButtonsPanel):
     #bl_label = "Object Motion Paths"
     bl_context = "object"
@@ -128,9 +129,23 @@
             col = split.column()
         col.operator("object.paths_clear", text="Clear Paths")
 
+class OBJECT_PT_onion_skinning(OnionSkinButtonsPanel):
+    #bl_label = "Object Onion Skinning"
+    bl_context = "object"
 
+    def poll(self, context):
+        return (context.object)
+        
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        wide_ui = context.region.width > narrowui
+
+        self.draw_settings(context, ob.animation_visualisation, wide_ui)
+
 class DATA_PT_motion_paths(MotionPathButtonsPanel):
-    #bl_label = "Bone Motion Paths"
+    #bl_label = "Bones Motion Paths"
     bl_context = "data"
 
     def poll(self, context):
@@ -156,15 +171,33 @@
             col = split.column()
         col.operator("pose.paths_clear", text="Clear Paths")
 
+class DATA_PT_onion_skinning(OnionSkinButtonsPanel):
+    #bl_label = "Bones Onion Skinning"
+    bl_context = "data"
 
-classes = [
-    OBJECT_PT_motion_paths,
-    DATA_PT_motion_paths]
+    def poll(self, context):
+        # XXX: include posemode check?
+        return (context.object) and (context.armature)
 
-# OBJECT_PT_onion_skinning
-# DATA_PT_onion_skinning
+    def draw(self, context):
+        layout = self.layout
 
+        ob = context.object
+        wide_ui = context.region.width > narrowui
 
+        self.draw_settings(context, ob.pose.animation_visualisation, wide_ui, bones=True)
+
+# NOTE: 
+# The specialised panel types defined here (i.e. OBJECT_PT_*, etc.)
+# aren't registered here, but are rather imported to (and registered)
+# in the files defining the contexts where they reside. Otherwise,
+# these panels appear at the top of the lists by default.
+#
+# However, we keep these empty register funcs here just in case
+# something will need them again one day, and also to make 
+# it easier to maintain these scripts.
+classes = []
+
 def register():
     register = bpy.types.register
     for cls in classes:

Modified: trunk/blender/release/scripts/ui/properties_data_armature.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_armature.py	2010-02-25 06:05:56 UTC (rev 27135)
+++ trunk/blender/release/scripts/ui/properties_data_armature.py	2010-02-25 12:01:43 UTC (rev 27136)
@@ -253,6 +253,9 @@
                 row.prop(itasc, "dampmax", text="Damp", slider=True)
                 row.prop(itasc, "dampeps", text="Eps", slider=True)
 
+# import generic panels from other files 
+from properties_animviz import DATA_PT_motion_paths, DATA_PT_onion_skinning
+
 classes = [
     DATA_PT_context_arm,
     DATA_PT_skeleton,
@@ -261,6 +264,9 @@
     DATA_PT_ghost,
     DATA_PT_iksolver_itasc,
 
+    DATA_PT_motion_paths,
+    #DATA_PT_onion_skinning,
+
     DATA_PT_custom_props_arm]
 
 

Modified: trunk/blender/release/scripts/ui/properties_object.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_object.py	2010-02-25 06:05:56 UTC (rev 27135)
+++ trunk/blender/release/scripts/ui/properties_object.py	2010-02-25 12:01:43 UTC (rev 27136)
@@ -304,6 +304,8 @@
         row.prop(ob, "track_override_parent", text="Override Parent")
         row.active = (ob.parent is not None)
 
+# import generic panels from other files 
+from properties_animviz import OBJECT_PT_motion_paths, OBJECT_PT_onion_skinning
 
 classes = [
     OBJECT_PT_context_object,
@@ -314,6 +316,9 @@
     OBJECT_PT_display,
     OBJECT_PT_duplication,
     OBJECT_PT_animation,
+    
+    OBJECT_PT_motion_paths,
+    #OBJECT_PT_onion_skinning,
 
     OBJECT_PT_custom_props]
 





More information about the Bf-blender-cvs mailing list