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/space_node | |
parent | 6964b5a6c48f2fab19b4ce5a52ba23525a5f05eb (diff) |
reduce operator lookups in the UI (could do 4 hash lookups per button).
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 7d475973c09..143173da5bc 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1233,7 +1233,10 @@ static void node_composit_buts_renderlayers(uiLayout *layout, bContext *C, Point PropertyRNA *prop; const char *layer_name; char scene_name[MAX_ID_NAME-2]; - + wmOperatorType *ot = WM_operatortype_find("RENDER_OT_render", 1); + + BLI_assert(ot != 0); + uiTemplateID(layout, C, ptr, "scene", NULL, NULL, NULL); if(!node->id) return; @@ -1249,10 +1252,10 @@ static void node_composit_buts_renderlayers(uiLayout *layout, bContext *C, Point scn_ptr = RNA_pointer_get(ptr, "scene"); RNA_string_get(&scn_ptr, "name", scene_name); - WM_operator_properties_create(&op_ptr, "RENDER_OT_render"); + WM_operator_properties_create_ptr(&op_ptr, ot); RNA_string_set(&op_ptr, "layer", layer_name); RNA_string_set(&op_ptr, "scene", scene_name); - uiItemFullO(row, "RENDER_OT_render", "", ICON_RENDER_STILL, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0); + uiItemFullO_ptr(row, ot, "", ICON_RENDER_STILL, op_ptr.data, WM_OP_INVOKE_DEFAULT, 0); } |