[Bf-blender-cvs] [605fbad872d] blender2.8: ED_pose_recalculate_paths: Run only for active object
Dalai Felinto
noreply at git.blender.org
Sat Oct 13 00:55:03 CEST 2018
Commit: 605fbad872d635c36154ca0a58155c7b8fd09eb9
Author: Dalai Felinto
Date: Fri Oct 12 19:52:21 2018 -0300
Branches: blender2.8
https://developer.blender.org/rB605fbad872d635c36154ca0a58155c7b8fd09eb9
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.
===================================================================
M source/blender/blenkernel/BKE_context.h
M source/blender/editors/armature/pose_edit.c
===================================================================
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);
More information about the Bf-blender-cvs
mailing list