[Bf-blender-cvs] [8e13e32] temp-sybren-poselib: Poselib UI tweaks

Sybren A. Stüvel noreply at git.blender.org
Fri Sep 30 18:12:37 CEST 2016


Commit: 8e13e325100e69832ccad9f4637036bb57269592
Author: Sybren A. Stüvel
Date:   Fri Sep 30 15:10:25 2016 +0200
Branches: temp-sybren-poselib
https://developer.blender.org/rB8e13e325100e69832ccad9f4637036bb57269592

Poselib UI tweaks

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

M	release/scripts/startup/bl_ui/properties_data_armature.py

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

diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py
index fb45566..d47a7e5 100644
--- a/release/scripts/startup/bl_ui/properties_data_armature.py
+++ b/release/scripts/startup/bl_ui/properties_data_armature.py
@@ -188,24 +188,29 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, Panel):
         # column of operators for active pose
         # - goes beside list
         col = row.column(align=True)
-        col.operator_context = 'EXEC_DEFAULT'  # exec not invoke, so that menu doesn't need showing
 
         # invoke should still be used for 'add', as it is needed to allow
         # add/replace options to be used properly
         col.operator("poselib.pose_add", icon='ZOOMIN', text="")
         pose_marker_active = poselib.pose_markers.active
 
-        if pose_marker_active is not None:
+        # The following operators just need to be executed, not invoked;
+        # otherwise they show a menu which we don't want.
+        col.operator_context = 'EXEC_DEFAULT'
+
+        if pose_marker_active:
             col.operator("poselib.pose_remove", icon='ZOOMOUT', text="")
-            col.operator("poselib.apply_pose", icon='ZOOM_SELECTED', text="").pose_index = poselib.pose_markers.active_index
+            props = col.operator("poselib.apply_pose", icon='ZOOM_SELECTED', text="")
+            props.pose_index = poselib.pose_markers.active_index
 
         col.operator("poselib.action_sanitize", icon='HELP', text="")  # XXX: put in menu?
 
-        if pose_marker_active is not None:
+        if pose_marker_active:
             col.operator("poselib.pose_move", icon='TRIA_UP', text="").direction = 'UP'
             col.operator("poselib.pose_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
 
-            layout.prop(pose_marker_active, "camera")
+            layout.prop(pose_marker_active, "camera",
+                        text='Camera for %s' % pose_marker_active.name)
         # layout.operator("poselib.render_previews")
 
 # TODO: this panel will soon be deprecated too




More information about the Bf-blender-cvs mailing list