Cleanup: Anim: Replace use of T_AUTOMERGE
#111268
@ -85,7 +85,7 @@ void ED_operatormacros_action()
|
||||
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_TRANSLATE);
|
||||
RNA_boolean_set(otmacro->ptr, "use_automerge_and_split", true);
|
||||
RNA_boolean_set(otmacro->ptr, "use_duplicated_keys", true);
|
||||
RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
|
||||
}
|
||||
|
||||
|
@ -509,7 +509,7 @@ void ED_operatormacros_graph()
|
||||
OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
WM_operatortype_macro_define(ot, "GRAPH_OT_duplicate");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
RNA_boolean_set(otmacro->ptr, "use_automerge_and_split", true);
|
||||
RNA_boolean_set(otmacro->ptr, "use_duplicated_keys", true);
|
||||
RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
|
||||
}
|
||||
|
||||
|
@ -147,6 +147,9 @@ enum eTFlag {
|
||||
T_NO_GIZMO = 1 << 24,
|
||||
|
||||
T_DRAW_SNAP_SOURCE = 1 << 25,
|
||||
|
||||
/** Special flag for when the transform code is called after keys have been duplicated. */
|
||||
T_DUPLICATED_KEYS = 1 << 26,
|
||||
};
|
||||
ENUM_OPERATORS(eTFlag, T_NO_GIZMO);
|
||||
|
||||
|
@ -1065,7 +1065,7 @@ static void special_aftertrans_update__actedit(bContext *C, TransInfo *t)
|
||||
bAnimContext ac;
|
||||
|
||||
const bool canceled = (t->state == TRANS_CANCEL);
|
||||
const bool duplicate = (t->flag & T_AUTOMERGE) != 0;
|
||||
const bool duplicate = (t->flag & T_DUPLICATED_KEYS) != 0;
|
||||
|
||||
/* initialize relevant anim-context 'context' data */
|
||||
if (ANIM_animdata_get_context(C, &ac) == 0) {
|
||||
|
@ -1005,7 +1005,7 @@ static void special_aftertrans_update__graph(bContext *C, TransInfo *t)
|
||||
const bool use_handle = (sipo->flag & SIPO_NOHANDLES) == 0;
|
||||
|
||||
const bool canceled = (t->state == TRANS_CANCEL);
|
||||
const bool duplicate = (t->flag & T_AUTOMERGE) != 0;
|
||||
const bool duplicate = (t->flag & T_DUPLICATED_KEYS) != 0;
|
||||
|
||||
/* initialize relevant anim-context 'context' data */
|
||||
if (ANIM_animdata_get_context(C, &ac) == 0) {
|
||||
|
@ -649,6 +649,14 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
|
||||
}
|
||||
}
|
||||
|
||||
if (op && (prop = RNA_struct_find_property(op->ptr, "use_duplicated_keys")) &&
|
||||
RNA_property_is_set(op->ptr, prop))
|
||||
{
|
||||
if (RNA_property_boolean_get(op->ptr, prop)) {
|
||||
t->flag |= T_DUPLICATED_KEYS;
|
||||
}
|
||||
}
|
||||
|
||||
/* Mirror is not supported with proportional editing, turn it off. */
|
||||
#if 0
|
||||
if (t->flag & T_PROP_EDIT) {
|
||||
|
@ -767,6 +767,9 @@ void Transform_Properties(wmOperatorType *ot, int flags)
|
||||
prop = RNA_def_boolean(
|
||||
ot->srna, "remove_on_cancel", false, "Remove on Cancel", "Remove elements on cancel");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_boolean(
|
||||
ot->srna, "use_duplicated_keys", false, "Duplicated Keys", "Transform duplicated keys");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
}
|
||||
|
||||
if (flags & P_CORRECT_UV) {
|
||||
|
Loading…
Reference in New Issue
Block a user