diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-10-13 01:52:21 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-10-13 01:53:07 +0300 |
commit | 605fbad872d635c36154ca0a58155c7b8fd09eb9 (patch) | |
tree | ea63ab0bb15dd5849866f6a9833bc6311f5a2534 /source | |
parent | c462c43c1a050650a4328ea9291630964dd3c1ae (diff) |
ED_pose_recalculate_paths: Run only for active object
New iterator CTX_DATA_BEGIN_FOR_ID, to restrict the loop to the specified object only.
This is not super efficient, but it should be fine for now.
I will talk to other developers. A more elegant solution would be to
have something like "active_object_selected_pose_bones" in the context.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_context.h | 6 | ||||
-rw-r--r-- | source/blender/editors/armature/pose_edit.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h index 28dcf9cb127..1c73434cde5 100644 --- a/source/blender/blenkernel/BKE_context.h +++ b/source/blender/blenkernel/BKE_context.h @@ -249,6 +249,12 @@ void CTX_data_list_add(bContextDataResult *result, void *data); CTX_DATA_BEGIN(C, Type, instance, member) \ Type_id instance_id = ctx_link->ptr.id.data; \ +#define CTX_DATA_BEGIN_FOR_ID(C, Type, instance, member, instance_id) \ + CTX_DATA_BEGIN(C, Type, instance, member) \ + if (ctx_link->ptr.id.data != (instance_id)) { \ + continue; \ + } + int ctx_data_list_count(const bContext *C, int (*func)(const bContext *, ListBase *)); #define CTX_DATA_COUNT(C, member) \ diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c index f23f8b4c7c4..7a973e5dd2a 100644 --- a/source/blender/editors/armature/pose_edit.c +++ b/source/blender/editors/armature/pose_edit.c @@ -316,7 +316,7 @@ static int pose_calculate_paths_exec(bContext *C, wmOperator *op) } /* set up path data for bones being calculated */ - CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones) + CTX_DATA_BEGIN_FOR_ID (C, bPoseChannel *, pchan, selected_pose_bones, &ob->id) { /* verify makes sure that the selected bone has a bone with the appropriate settings */ animviz_verify_motionpaths(op->reports, scene, ob, pchan); |