remove null checks for macro definitions, if these fail then something is broken elsewhere, better not fail silently.

This commit is contained in:
Campbell Barton
2013-10-26 08:01:33 +00:00
parent a4203573cb
commit 4a15df1571
3 changed files with 19 additions and 30 deletions

View File

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

View File

@@ -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 **********************************/

View File

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