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:
authorJoshua Leung <aligorith@gmail.com>2011-02-16 09:18:20 +0300
committerJoshua Leung <aligorith@gmail.com>2011-02-16 09:18:20 +0300
commit437bdbc96cd80dadb8517ae94dd5e9f5e3e4bf70 (patch)
tree0e7ceeb988d6f4311900ff3427fdcac4fa642bb2 /release
parent7748860aeb6dc653f529fbe1c030df3674c9fac4 (diff)
PoseLib Bugfixes, Cleanups, and Missing Operators
* All the various index-related issues should finally be sorted now. It seems you cannot just partially implement some of these active index getter/setters... * Standardised the call used by PoseLib operators to get the Object from which they get the active PoseLib data from * PoseLib operators which require some existing data to work now use a poll() which checks for this * Added back the operator used to make standard actions into ones usable by PoseLib * Added a dummy operator for the apply active pose button which really just calls the same backend functions as "Browse Interactive", but which has a nicer frontend (naming + description) for the purpose of being used in this way * Also, removed some useless code from here
Diffstat (limited to 'release')
-rw-r--r--release/scripts/ui/properties_data_armature.py38
1 files changed, 18 insertions, 20 deletions
diff --git a/release/scripts/ui/properties_data_armature.py b/release/scripts/ui/properties_data_armature.py
index 4efb49ac6a8..a1680daffe4 100644
--- a/release/scripts/ui/properties_data_armature.py
+++ b/release/scripts/ui/properties_data_armature.py
@@ -157,46 +157,44 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, bpy.types.Panel):
class DATA_PT_pose_library(ArmatureButtonsPanel, bpy.types.Panel):
bl_label = "Pose Library"
bl_options = {'DEFAULT_CLOSED'}
-
+
@classmethod
def poll(cls, context):
return (context.object and context.object.type == 'ARMATURE' and context.object.pose)
-
+
def draw(self, context):
layout = self.layout
-
+
ob = context.object
poselib = ob.pose_library
-
+
row = layout.row()
row.template_ID(ob, "pose_library", new="poselib.new", unlink="poselib.unlink")
-
+
if poselib:
activePoseIndex = poselib.pose_markers.active_index
- if len(poselib.pose_markers):
- activePose = poselib.pose_markers[activePoseIndex]
- activePoseName = activePose.name if activePose else None
+ if poselib.pose_markers.active:
+ activePoseName = poselib.pose_markers.active.name
else:
- activePose = None
- activePoseName = None
-
+ activePoseName = ""
+
row = layout.row()
row.template_list(poselib, "pose_markers", poselib.pose_markers, "active_index", rows=5)
-
+
col = row.column(align=True)
col.active = (poselib.library is None)
-
- # invoke should still be used for 'add', as it is needed to allow
+
+ # 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="")
-
- col.operator_context = 'EXEC_DEFAULT' # exec not invoke, so that menu doesn't need showing
+
+ col.operator_context = 'EXEC_DEFAULT' # exec not invoke, so that menu doesn't need showing
col.operator("poselib.pose_remove", icon='ZOOMOUT', text="").pose = activePoseName
- #col.operator_context = 'EXEC_DEFAULT' # exec not invoke, so modal preview loop doesn't run
- col.operator("poselib.browse_interactive", icon='ZOOM_SELECTED', text="").pose_index = activePoseIndex
-
- # TODO: "validate action" operator to be restored
+ col.operator("poselib.apply_pose", icon='ZOOM_SELECTED', text="").pose_index = activePoseIndex
+
+ row = layout.row()
+ row.operator("poselib.action_sanitise")
# TODO: this panel will soon be depreceated too