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>2017-11-19 15:00:27 +0300
committerJoshua Leung <aligorith@gmail.com>2017-11-19 15:57:21 +0300
commitc5f59f5854732f7d2c2020ca7ec67f1eaa043b78 (patch)
tree03daf522dfdc68ddf3dfb460ebbc7d2488ef0968 /source/blender/editors/armature/pose_edit.c
parentc01ffefb687260c11b3eae8411e5af051f0ce10a (diff)
Tweaks to make it easier to update bone motion paths (without the active bone needing to have any paths itself)
This commit introduces the following changes: * Modified the poll callback on the "Update Paths" operator for bones so that it only checks if there are bones that have motion paths (instead of checking whether the active bone has paths). This makes it easier to update paths without having to first select one that has them - useful when the paths are all on hidden/hard-to-select bones. * Add a readonly property, "has_motion_paths" to the animviz.motion_path RNA struct, providing easier access to the internal flag used above. This makes it possible for the UI to display the "Update" button without having to check various bones for motion paths. Notes: * The flag being used in these changes already existed, and was only really intended for internal use. However, since it was already used in many places for determining if auto-update of all bone paths was needed (e.g. after certain editing ops), it should be safe to use here too. * The update_paths operator currently bakes all paths when activated, so there's currently no loss of functionality with changing to not checking if the active bone has any paths (e.g. we couldn't only update the active bone only either). That is still listed as a todo in the code.
Diffstat (limited to 'source/blender/editors/armature/pose_edit.c')
-rw-r--r--source/blender/editors/armature/pose_edit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c
index c49a370c286..57c01157f8e 100644
--- a/source/blender/editors/armature/pose_edit.c
+++ b/source/blender/editors/armature/pose_edit.c
@@ -265,8 +265,8 @@ void POSE_OT_paths_calculate(wmOperatorType *ot)
static int pose_update_paths_poll(bContext *C)
{
if (ED_operator_posemode_exclusive(C)) {
- bPoseChannel *pchan = CTX_data_active_pose_bone(C);
- return (pchan && pchan->mpath);
+ Object *ob = CTX_data_active_object(C);
+ return (ob->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS) != 0;
}
return false;