diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-02-25 15:01:43 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-02-25 15:01:43 +0300 |
commit | 4b80d4e60d7357c283fd68cd7cb3501074d63dcd (patch) | |
tree | 02bbc93a6a497cc143132d2b4c8d92d265b71c19 /release | |
parent | 4d3accd0cb1088849d468163152905b668737724 (diff) |
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.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/ui/properties_animviz.py | 47 | ||||
-rw-r--r-- | release/scripts/ui/properties_data_armature.py | 6 | ||||
-rw-r--r-- | release/scripts/ui/properties_object.py | 5 |
3 files changed, 51 insertions, 7 deletions
diff --git a/release/scripts/ui/properties_animviz.py b/release/scripts/ui/properties_animviz.py index 7d25694c92a..71b49cea2f2 100644 --- a/release/scripts/ui/properties_animviz.py +++ b/release/scripts/ui/properties_animviz.py @@ -29,6 +29,7 @@ class MotionPathButtonsPanel(bpy.types.Panel): 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 @@ class OnionSkinButtonsPanel(bpy.types.Panel): 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 @@ class OnionSkinButtonsPanel(bpy.types.Panel): ################################################ # Specific Panels for DataTypes - class OBJECT_PT_motion_paths(MotionPathButtonsPanel): #bl_label = "Object Motion Paths" bl_context = "object" @@ -128,9 +129,23 @@ class OBJECT_PT_motion_paths(MotionPathButtonsPanel): 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,14 +171,32 @@ class DATA_PT_motion_paths(MotionPathButtonsPanel): 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" + + def poll(self, context): + # XXX: include posemode check? + return (context.object) and (context.armature) + + def draw(self, context): + layout = self.layout -classes = [ - OBJECT_PT_motion_paths, - DATA_PT_motion_paths] + ob = context.object + wide_ui = context.region.width > narrowui -# OBJECT_PT_onion_skinning -# DATA_PT_onion_skinning + 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 diff --git a/release/scripts/ui/properties_data_armature.py b/release/scripts/ui/properties_data_armature.py index 4183ba07a6c..b7864618de6 100644 --- a/release/scripts/ui/properties_data_armature.py +++ b/release/scripts/ui/properties_data_armature.py @@ -253,6 +253,9 @@ class DATA_PT_iksolver_itasc(DataButtonsPanel): 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 @@ classes = [ DATA_PT_ghost, DATA_PT_iksolver_itasc, + DATA_PT_motion_paths, + #DATA_PT_onion_skinning, + DATA_PT_custom_props_arm] diff --git a/release/scripts/ui/properties_object.py b/release/scripts/ui/properties_object.py index d42d4474306..b11180411f4 100644 --- a/release/scripts/ui/properties_object.py +++ b/release/scripts/ui/properties_object.py @@ -304,6 +304,8 @@ class OBJECT_PT_animation(ObjectButtonsPanel): 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 @@ classes = [ OBJECT_PT_display, OBJECT_PT_duplication, OBJECT_PT_animation, + + OBJECT_PT_motion_paths, + #OBJECT_PT_onion_skinning, OBJECT_PT_custom_props] |