Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_sequencer/sequencer_modifier.c
| Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | void SEQUENCER_OT_strip_modifier_add(wmOperatorType *ot) | ||||
| /* properties */ | /* properties */ | ||||
| prop = RNA_def_enum(ot->srna, | prop = RNA_def_enum(ot->srna, | ||||
| "type", | "type", | ||||
| rna_enum_sequence_modifier_type_items, | rna_enum_sequence_modifier_type_items, | ||||
| seqModifierType_ColorBalance, | seqModifierType_ColorBalance, | ||||
| "Type", | "Type", | ||||
| ""); | ""); | ||||
| ot->prop = prop; | ot->prop = prop; | ||||
| } | } | ||||
| /*********************** Remove modifier operator *************************/ | /*********************** Remove modifier operator *************************/ | ||||
| static int strip_modifier_remove_exec(bContext *C, wmOperator *op) | static int strip_modifier_remove_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| Show All 14 Lines | static int strip_modifier_remove_exec(bContext *C, wmOperator *op) | ||||
| BKE_sequence_invalidate_cache_preprocessed(scene, seq); | BKE_sequence_invalidate_cache_preprocessed(scene, seq); | ||||
| WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); | WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void SEQUENCER_OT_strip_modifier_remove(wmOperatorType *ot) | void SEQUENCER_OT_strip_modifier_remove(wmOperatorType *ot) | ||||
| { | { | ||||
| PropertyRNA *prop; | |||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Remove Strip Modifier"; | ot->name = "Remove Strip Modifier"; | ||||
| ot->idname = "SEQUENCER_OT_strip_modifier_remove"; | ot->idname = "SEQUENCER_OT_strip_modifier_remove"; | ||||
| ot->description = "Remove a modifier from the strip"; | ot->description = "Remove a modifier from the strip"; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->exec = strip_modifier_remove_exec; | ot->exec = strip_modifier_remove_exec; | ||||
| ot->poll = strip_modifier_active_poll; | ot->poll = strip_modifier_active_poll; | ||||
| /* flags */ | /* flags */ | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| /* properties */ | /* properties */ | ||||
| RNA_def_string(ot->srna, "name", "Name", MAX_NAME, "Name", "Name of modifier to remove"); | prop = RNA_def_string(ot->srna, "name", "Name", MAX_NAME, "Name", "Name of modifier to remove"); | ||||
| RNA_def_property_flag(prop, PROP_HIDDEN); | |||||
| } | } | ||||
| /*********************** Move operator *************************/ | /*********************** Move operator *************************/ | ||||
| enum { | enum { | ||||
| SEQ_MODIFIER_MOVE_UP = 0, | SEQ_MODIFIER_MOVE_UP = 0, | ||||
| SEQ_MODIFIER_MOVE_DOWN, | SEQ_MODIFIER_MOVE_DOWN, | ||||
| }; | }; | ||||
| Show All 30 Lines | static int strip_modifier_move_exec(bContext *C, wmOperator *op) | ||||
| BKE_sequence_invalidate_cache_preprocessed(scene, seq); | BKE_sequence_invalidate_cache_preprocessed(scene, seq); | ||||
| WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); | WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void SEQUENCER_OT_strip_modifier_move(wmOperatorType *ot) | void SEQUENCER_OT_strip_modifier_move(wmOperatorType *ot) | ||||
| { | { | ||||
| PropertyRNA *prop; | |||||
| static const EnumPropertyItem direction_items[] = { | static const EnumPropertyItem direction_items[] = { | ||||
| {SEQ_MODIFIER_MOVE_UP, "UP", 0, "Up", "Move modifier up in the stack"}, | {SEQ_MODIFIER_MOVE_UP, "UP", 0, "Up", "Move modifier up in the stack"}, | ||||
| {SEQ_MODIFIER_MOVE_DOWN, "DOWN", 0, "Down", "Move modifier down in the stack"}, | {SEQ_MODIFIER_MOVE_DOWN, "DOWN", 0, "Down", "Move modifier down in the stack"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Move Strip Modifier"; | ot->name = "Move Strip Modifier"; | ||||
| ot->idname = "SEQUENCER_OT_strip_modifier_move"; | ot->idname = "SEQUENCER_OT_strip_modifier_move"; | ||||
| ot->description = "Move modifier up and down in the stack"; | ot->description = "Move modifier up and down in the stack"; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ot->exec = strip_modifier_move_exec; | ot->exec = strip_modifier_move_exec; | ||||
| ot->poll = strip_modifier_active_poll; | ot->poll = strip_modifier_active_poll; | ||||
| /* flags */ | /* flags */ | ||||
| ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; | ||||
| /* properties */ | /* properties */ | ||||
| RNA_def_string(ot->srna, "name", "Name", MAX_NAME, "Name", "Name of modifier to remove"); | prop = RNA_def_string(ot->srna, "name", "Name", MAX_NAME, "Name", "Name of modifier to remove"); | ||||
| RNA_def_enum(ot->srna, "direction", direction_items, SEQ_MODIFIER_MOVE_UP, "Type", ""); | RNA_def_property_flag(prop, PROP_HIDDEN); | ||||
| prop = RNA_def_enum(ot->srna, "direction", direction_items, SEQ_MODIFIER_MOVE_UP, "Type", ""); | |||||
| RNA_def_property_flag(prop, PROP_HIDDEN); | |||||
| } | } | ||||
| /*********************** Copy to selected operator *************************/ | /*********************** Copy to selected operator *************************/ | ||||
| enum { | enum { | ||||
| SEQ_MODIFIER_COPY_REPLACE = 0, | SEQ_MODIFIER_COPY_REPLACE = 0, | ||||
| SEQ_MODIFIER_COPY_APPEND = 1, | SEQ_MODIFIER_COPY_APPEND = 1, | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines | |||||