diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-01-22 07:30:07 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-01-22 07:30:07 +0400 |
commit | b1667911ef88e067817cb1702695a0d1e350dd78 (patch) | |
tree | 303dff319b59b89516127c065f9486e4dfd53975 /source/blender/editors/armature | |
parent | 6964b5a6c48f2fab19b4ce5a52ba23525a5f05eb (diff) |
reduce operator lookups in the UI (could do 4 hash lookups per button).
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r-- | source/blender/editors/armature/poselib.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index dcddde207f0..eb49f16584b 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -376,6 +376,10 @@ static void poselib_add_menu_invoke__replacemenu (bContext *C, uiLayout *layout, bAction *act= ob->poselib; /* never NULL */ TimeMarker *marker; + wmOperatorType *ot = WM_operatortype_find("POSELIB_OT_pose_add", 1); + + BLI_assert(ot != NULL); + /* set the operator execution context correctly */ uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); @@ -383,9 +387,9 @@ static void poselib_add_menu_invoke__replacemenu (bContext *C, uiLayout *layout, for (marker= act->markers.first; marker; marker= marker->next) { PointerRNA props_ptr; - props_ptr = uiItemFullO(layout, "POSELIB_OT_pose_add", - marker->name, ICON_ARMATURE_DATA, NULL, - WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); + props_ptr = uiItemFullO_ptr(layout, ot, + marker->name, ICON_ARMATURE_DATA, NULL, + WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_int_set(&props_ptr, "frame", marker->frame); RNA_string_set(&props_ptr, "name", marker->name); |