[Bf-blender-cvs] [a0581daf753] blender2.8: UI: use property split for motion paths

William Reynish noreply at git.blender.org
Tue Sep 11 08:42:29 CEST 2018


Commit: a0581daf753a81ac1e410c6aa0c9cfd233b04793
Author: William Reynish
Date:   Tue Sep 11 16:49:52 2018 +1000
Branches: blender2.8
https://developer.blender.org/rBa0581daf753a81ac1e410c6aa0c9cfd233b04793

UI: use property split for motion paths

===================================================================

M	release/scripts/startup/bl_ui/properties_animviz.py
M	release/scripts/startup/bl_ui/properties_data_armature.py
M	release/scripts/startup/bl_ui/properties_object.py
M	release/scripts/startup/bl_ui/properties_view_layer.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_animviz.py b/release/scripts/startup/bl_ui/properties_animviz.py
index 7ba503bffd2..eb031b54caa 100644
--- a/release/scripts/startup/bl_ui/properties_animviz.py
+++ b/release/scripts/startup/bl_ui/properties_animviz.py
@@ -38,63 +38,67 @@ class MotionPathButtonsPanel:
 
         # Display Range
         layout.use_property_split = True
-        layout.row().prop(mps, "type")
 
-        col = layout.column()
+        layout.prop(mps, "type")
 
-        sub = col.column(align=True)
         if mps.type == 'CURRENT_FRAME':
-            sub.prop(mps, "frame_before", text="Frame Range Before")
-            sub.prop(mps, "frame_after", text="After")
+            col = layout.column(align=True)
+            col.prop(mps, "frame_before", text="Frame Range Before")
+            col.prop(mps, "frame_after", text="After")
+            col.prop(mps, "frame_step", text="Step")
         elif mps.type == 'RANGE':
+            row = layout.row()
+            sub = row.column()
+            if mps.type == 'RANGE':
+                if bones:
+                    sub.operator("pose.paths_range_update", text="", icon='TIME')
+                else:
+                    sub.operator("object.paths_range_update", text="", icon='TIME')
+            sub = row.column(align=True)
             sub.prop(mps, "frame_start", text="Frame Range Start")
             sub.prop(mps, "frame_end", text="End")
+            sub.prop(mps, "frame_step", text="Step")
 
-        sub.prop(mps, "frame_step", text="Step")
-
-        if mps.type == 'RANGE':
+        if mpath:
+            col = layout.column(align=True)
+            col.enabled = False
             if bones:
-                sub.operator("pose.paths_range_update")
+                col.prop(mpath, "frame_start", text="Bone Cache From")
             else:
-                sub.operator("object.paths_range_update")
-
-        col = layout.column(align=True)
-        if bones:
-            col.label(text="Cache for Bone:")
-        else:
-            col.label(text="Cache")
+                col.prop(mpath, "frame_start", text="Cache From")
+            col.prop(mpath, "frame_end", text="To")
 
-        if mpath:
-            sub = col.column(align=True)
-            sub.enabled = False
-            sub.prop(mpath, "frame_start", text="From")
-            sub.prop(mpath, "frame_end", text="To")
-
-            sub = col.row(align=True)
+            row = layout.row(align=True)
             if bones:
-                sub.operator("pose.paths_update", text="Update Paths", icon='BONE_DATA')
-                sub.operator("pose.paths_clear", text="", icon='X')
+                row.operator("pose.paths_update", text="Update Paths", icon='BONE_DATA')
+                row.operator("pose.paths_clear", text="", icon='X')
             else:
-                sub.operator("object.paths_update", text="Update Paths", icon='OBJECT_DATA')
-                sub.operator("object.paths_clear", text="", icon='X')
+                row.operator("object.paths_update", text="Update Paths", icon='OBJECT_DATA')
+                row.operator("object.paths_clear", text="", icon='X')
         else:
-            sub = col.column(align=True)
-            sub.label(text="Nothing to show yet...", icon='ERROR')
+            col = layout.column(align=True)
+            col.label(text="Nothing to show yet...", icon='ERROR')
             if bones:
-                sub.operator("pose.paths_calculate", text="Calculate...", icon='BONE_DATA')
+                col.operator("pose.paths_calculate", text="Calculate...", icon='BONE_DATA')
             else:
-                sub.operator("object.paths_calculate", text="Calculate...", icon='OBJECT_DATA')
+                col.operator("object.paths_calculate", text="Calculate...", icon='OBJECT_DATA')
 
-        # Display Settings
 
-        layout.label(text="Display")
+class MotionPathButtonsPanel_display:
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_label = "Display"
+
+    def draw_settings(self, context, avs, mpath, bones=False):
+        layout = self.layout
+
+        mps = avs.motion_path
+
+        layout.use_property_split = True
+        layout.use_property_decorate = False
 
         col = layout.column()
         col.prop(mps, "show_frame_numbers", text="Frame Numbers")
-        if mpath is not None:
-            col.prop(mpath, "lines", text="Lines")
-            col.prop(mpath, "line_thickness", text="Thickness")
-
         col.prop(mps, "show_keyframe_highlight", text="Keyframes")
         sub = col.column()
         sub.enabled = mps.show_keyframe_highlight
@@ -104,11 +108,15 @@ class MotionPathButtonsPanel:
 
         # Customize path
         if mpath is not None:
+            col.prop(mpath, "lines", text="Lines")
+            col.prop(mpath, "line_thickness", text="Thickness")
+
+            split = col.split(factor=0.6)
 
-            col.prop(mpath, "use_custom_color", text="Custom Color")
-            sub = col.column()
+            split.prop(mpath, "use_custom_color", text="Custom Color")
+            sub = split.column()
             sub.enabled = mpath.use_custom_color
-            sub.prop(mpath, "color")
+            sub.prop(mpath, "color", text="")
 
 
 # FIXME: this panel still needs to be ported so that it will work correctly with animviz
diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py
index 4f0f18889fc..833643cdafc 100644
--- a/release/scripts/startup/bl_ui/properties_data_armature.py
+++ b/release/scripts/startup/bl_ui/properties_data_armature.py
@@ -288,6 +288,7 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
 
 from .properties_animviz import (
     MotionPathButtonsPanel,
+    MotionPathButtonsPanel_display,
     OnionSkinButtonsPanel,
 )
 
@@ -313,6 +314,29 @@ class DATA_PT_motion_paths(MotionPathButtonsPanel, Panel):
         self.draw_settings(context, avs, mpath, bones=True)
 
 
+class DATA_PT_motion_paths_display(MotionPathButtonsPanel_display, Panel):
+    #bl_label = "Bones Motion Paths"
+    bl_context = "data"
+    bl_parent_id = "DATA_PT_motion_paths"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        # XXX: include pose-mode check?
+        return (context.object) and (context.armature)
+
+    def draw(self, context):
+        # layout = self.layout
+
+        ob = context.object
+        avs = ob.pose.animation_visualization
+
+        pchan = context.active_pose_bone
+        mpath = pchan.motion_path if pchan else None
+
+        self.draw_settings(context, avs, mpath, bones=True)
+
+
 class DATA_PT_onion_skinning(OnionSkinButtonsPanel):  # , Panel): # inherit from panel when ready
     #bl_label = "Bones Onion Skinning"
     bl_context = "data"
@@ -342,6 +366,7 @@ classes = (
     DATA_PT_bone_groups,
     DATA_PT_pose_library,
     DATA_PT_motion_paths,
+    DATA_PT_motion_paths_display,
     DATA_PT_ghost,
     DATA_PT_iksolver_itasc,
     DATA_PT_custom_props_arm,
diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index 4f95f1fbf05..65126691d8c 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -328,6 +328,7 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
 
 from .properties_animviz import (
     MotionPathButtonsPanel,
+    MotionPathButtonsPanel_display,
     OnionSkinButtonsPanel,
 )
 
@@ -351,6 +352,26 @@ class OBJECT_PT_motion_paths(MotionPathButtonsPanel, Panel):
         self.draw_settings(context, avs, mpath)
 
 
+class OBJECT_PT_motion_paths_display(MotionPathButtonsPanel_display, Panel):
+    #bl_label = "Object Motion Paths"
+    bl_context = "object"
+    bl_parent_id = "OBJECT_PT_motion_paths"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        return (context.object)
+
+    def draw(self, context):
+        # layout = self.layout
+
+        ob = context.object
+        avs = ob.animation_visualization
+        mpath = ob.motion_path
+
+        self.draw_settings(context, avs, mpath)
+
+
 class OBJECT_PT_onion_skinning(OnionSkinButtonsPanel):  # , Panel): # inherit from panel when ready
     #bl_label = "Object Onion Skinning"
     bl_context = "object"
@@ -381,6 +402,7 @@ classes = (
     OBJECT_PT_duplication,
     OBJECT_PT_display,
     OBJECT_PT_motion_paths,
+    OBJECT_PT_motion_paths_display,
     OBJECT_PT_custom_props,
 )
 
diff --git a/release/scripts/startup/bl_ui/properties_view_layer.py b/release/scripts/startup/bl_ui/properties_view_layer.py
index f96bf041311..b962c8f5828 100644
--- a/release/scripts/startup/bl_ui/properties_view_layer.py
+++ b/release/scripts/startup/bl_ui/properties_view_layer.py
@@ -38,14 +38,21 @@ class VIEWLAYER_PT_layer(ViewLayerButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
+
+        layout.use_property_split = True
+
+        flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
+
         layout.use_property_split = True
 
         scene = context.scene
         rd = scene.render
         layer = bpy.context.view_layer
 
-        layout.prop(layer, "use", text="Use for Rendering")
-        layout.prop(rd, "use_single_layer", text="Render Single Layer")
+        col = flow.column()
+        col.prop(layer, "use", text="Use for Rendering")
+        col = flow.column()
+        col.prop(rd, "use_single_layer", text="Render Single Layer")
 
 
 class VIEWLAYER_PT_eevee_layer_passes(ViewLayerButtonsPanel, Panel):
@@ -55,19 +62,28 @@ class VIEWLAYER_PT_eevee_layer_passes(ViewLayerButtonsPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
+
         layout.use_property_split = True
 
+        flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
+
         scene = context.scene
         rd = scene.render
         view_layer = context.view_layer
 
-        col = layout.column()
+        col = flow.column()
         col.prop(view_layer, "use_pass_combined")
+        col = flo

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list