diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-10-26 12:01:33 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-10-26 12:01:33 +0400 |
commit | 4a15df15711628c65282cc4d5a1dfd852776e014 (patch) | |
tree | bd6433fd953270ac4bf118ae0bc32ad386f875f6 /source/blender/editors | |
parent | a4203573cb5c60dbdc0518251546814980973469 (diff) |
remove null checks for macro definitions, if these fail then something is broken elsewhere, better not fail silently.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/armature/armature_ops.c | 32 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_ops.c | 9 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_ops.c | 8 |
3 files changed, 19 insertions, 30 deletions
diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c index 0090522d1e1..3c41765034d 100644 --- a/source/blender/editors/armature/armature_ops.c +++ b/source/blender/editors/armature/armature_ops.c @@ -165,37 +165,31 @@ void ED_operatormacros_armature(void) { wmOperatorType *ot; wmOperatorTypeMacro *otmacro; - + ot = WM_operatortype_append_macro("ARMATURE_OT_duplicate_move", "Duplicate", "Make copies of the selected bones within the same armature and move them", OPTYPE_UNDO | OPTYPE_REGISTER); - if (ot) { - WM_operatortype_macro_define(ot, "ARMATURE_OT_duplicate"); - otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); - } + WM_operatortype_macro_define(ot, "ARMATURE_OT_duplicate"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + RNA_enum_set(otmacro->ptr, "proportional", 0); ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_move", "Extrude", "Create new bones from the selected joints and move them", OPTYPE_UNDO | OPTYPE_REGISTER); - if (ot) { - otmacro = WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude"); - RNA_boolean_set(otmacro->ptr, "forked", FALSE); - otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); - } - + otmacro = WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude"); + RNA_boolean_set(otmacro->ptr, "forked", FALSE); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + RNA_enum_set(otmacro->ptr, "proportional", 0); + /* XXX would it be nicer to just be able to have standard extrude_move, but set the forked property separate? * that would require fixing a properties bug 19733 */ ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked", "Create new bones from the selected joints and move them", OPTYPE_UNDO | OPTYPE_REGISTER); - if (ot) { - otmacro = WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude"); - RNA_boolean_set(otmacro->ptr, "forked", TRUE); - otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); - } + otmacro = WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude"); + RNA_boolean_set(otmacro->ptr, "forked", TRUE); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + RNA_enum_set(otmacro->ptr, "proportional", 0); } void ED_keymap_armature(wmKeyConfig *keyconf) diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c index 2ef61fa580a..346ffcbc3e2 100644 --- a/source/blender/editors/space_action/action_ops.c +++ b/source/blender/editors/space_action/action_ops.c @@ -97,12 +97,9 @@ void ED_operatormacros_action(void) ot = WM_operatortype_append_macro("ACTION_OT_duplicate_move", "Duplicate", "Make a copy of all selected keyframes and move them", OPTYPE_UNDO | OPTYPE_REGISTER); - if (ot) { - WM_operatortype_macro_define(ot, "ACTION_OT_duplicate"); - otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform"); - RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE); - } - + WM_operatortype_macro_define(ot, "ACTION_OT_duplicate"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform"); + RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE); } /* ************************** registration - keymaps **********************************/ diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index 6dc3f7ac3dc..74114f8ca9d 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -254,11 +254,9 @@ void ED_operatormacros_graph(void) ot = WM_operatortype_append_macro("GRAPH_OT_duplicate_move", "Duplicate", "Make a copy of all selected keyframes and move them", OPTYPE_UNDO | OPTYPE_REGISTER); - if (ot) { - WM_operatortype_macro_define(ot, "GRAPH_OT_duplicate"); - otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform"); - RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE); - } + WM_operatortype_macro_define(ot, "GRAPH_OT_duplicate"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform"); + RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE); } |