Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/ui/properties_animviz.py')
-rw-r--r--release/scripts/ui/properties_animviz.py133
1 files changed, 11 insertions, 122 deletions
diff --git a/release/scripts/ui/properties_animviz.py b/release/scripts/ui/properties_animviz.py
index 9eb046cc2c8..b337485ae10 100644
--- a/release/scripts/ui/properties_animviz.py
+++ b/release/scripts/ui/properties_animviz.py
@@ -19,27 +19,22 @@
# <pep8 compliant>
import bpy
-narrowui = bpy.context.user_preferences.view.properties_width_check
-################################################
# Generic Panels (Independent of DataType)
-class MotionPathButtonsPanel(bpy.types.Panel):
+class MotionPathButtonsPanel():
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):
+ def draw_settings(self, context, avs, bones=False):
layout = self.layout
mps = avs.motion_paths
- if wide_ui:
- layout.prop(mps, "type", expand=True)
- else:
- layout.prop(mps, "type", text="")
+ layout.prop(mps, "type", expand=True)
split = layout.split()
@@ -56,8 +51,7 @@ class MotionPathButtonsPanel(bpy.types.Panel):
if bones:
col.row().prop(mps, "bake_location", expand=True)
- if wide_ui:
- col = split.column()
+ col = split.column()
col.label(text="Display:")
col.prop(mps, "show_frame_numbers", text="Frame Numbers")
col.prop(mps, "highlight_keyframes", text="Keyframes")
@@ -67,7 +61,7 @@ class MotionPathButtonsPanel(bpy.types.Panel):
# FIXME: this panel still needs to be ported so that it will work correctly with animviz
-class OnionSkinButtonsPanel(bpy.types.Panel):
+class OnionSkinButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_label = "Onion Skinning"
@@ -77,12 +71,8 @@ class OnionSkinButtonsPanel(bpy.types.Panel):
layout = self.layout
arm = context.armature
- wide_ui = context.region.width > narrowui
- if wide_ui:
- layout.prop(arm, "ghost_type", expand=True)
- else:
- layout.prop(arm, "ghost_type", text="")
+ layout.prop(arm, "ghost_type", expand=True)
split = layout.split()
@@ -97,124 +87,23 @@ class OnionSkinButtonsPanel(bpy.types.Panel):
sub.prop(arm, "ghost_step", text="Range")
sub.prop(arm, "ghost_size", text="Step")
- if wide_ui:
- col = split.column()
+ col = split.column()
col.label(text="Display:")
col.prop(arm, "ghost_only_selected", text="Selected Only")
-################################################
-# Specific Panels for DataTypes
-
-
-class OBJECT_PT_motion_paths(MotionPathButtonsPanel):
- #bl_label = "Object Motion Paths"
- 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)
-
- layout.separator()
-
- split = layout.split()
-
- col = split.column()
- col.operator("object.paths_calculate", text="Calculate Paths")
-
- if wide_ui:
- 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 = "Bones Motion Paths"
- bl_context = "data"
-
- def poll(self, context):
- # XXX: include posemode check?
- return (context.object) and (context.armature)
-
- 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)
-
- layout.separator()
-
- split = layout.split()
-
- col = split.column()
- col.operator("pose.paths_calculate", text="Calculate Paths")
-
- if wide_ui:
- 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
-
- 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 = []
+# The specialised panel types are derived in their respective UI modules
+
def register():
- register = bpy.types.register
- for cls in classes:
- register(cls)
+ pass
def unregister():
- unregister = bpy.types.unregister
- for cls in classes:
- unregister(cls)
+ pass
if __name__ == "__main__":
register()