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.
This commit is contained in:
Dalai Felinto 2018-10-12 19:52:21 -03:00
parent c462c43c1a
commit 605fbad872
Notes: blender-bot 2023-02-14 11:42:40 +01:00
Referenced by issue #57188, Black noise on subsurface scattering objects
2 changed files with 7 additions and 1 deletions

View File

@ -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) \

View File

@ -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);