Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_tools.cc
| Show All 20 Lines | |||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DNA_meta_types.h" | #include "DNA_meta_types.h" | ||||
| #include "DNA_modifier_types.h" | #include "DNA_modifier_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_pointcloud_types.h" | #include "DNA_pointcloud_types.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_sequence_types.h" | #include "DNA_sequence_types.h" | ||||
| #include "DNA_simulation_types.h" | #include "DNA_simulation_types.h" | ||||
| #include "DNA_video_edit_types.h" | |||||
| #include "DNA_volume_types.h" | #include "DNA_volume_types.h" | ||||
| #include "DNA_world_types.h" | #include "DNA_world_types.h" | ||||
| #include "BLI_blenlib.h" | #include "BLI_blenlib.h" | ||||
| #include "BLI_ghash.h" | #include "BLI_ghash.h" | ||||
| #include "BLI_linklist.h" | #include "BLI_linklist.h" | ||||
| #include "BLI_map.hh" | #include "BLI_map.hh" | ||||
| #include "BLI_set.hh" | #include "BLI_set.hh" | ||||
| ▲ Show 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | switch ((ID_Type)idcode) { | ||||
| case ID_PC: | case ID_PC: | ||||
| case ID_CF: | case ID_CF: | ||||
| case ID_WS: | case ID_WS: | ||||
| case ID_LP: | case ID_LP: | ||||
| case ID_CV: | case ID_CV: | ||||
| case ID_PT: | case ID_PT: | ||||
| case ID_VO: | case ID_VO: | ||||
| case ID_SIM: | case ID_SIM: | ||||
| case ID_VE: | |||||
| is_standard_id = true; | is_standard_id = true; | ||||
| break; | break; | ||||
| case ID_WM: | case ID_WM: | ||||
| case ID_SCR: | case ID_SCR: | ||||
| /* Those are ignored here. */ | /* Those are ignored here. */ | ||||
| /* NOTE: while Screens should be manageable here, deleting a screen used by a workspace | /* NOTE: while Screens should be manageable here, deleting a screen used by a workspace | ||||
| * will cause crashes when trying to use that workspace, so for now let's play minimal, | * will cause crashes when trying to use that workspace, so for now let's play minimal, | ||||
| * safe change. */ | * safe change. */ | ||||
| ▲ Show 20 Lines • Show All 1,788 Lines • ▼ Show 20 Lines | else if (event == OL_DOP_HIDE) { | ||||
| ebone->flag |= BONE_HIDDEN_A; | ebone->flag |= BONE_HIDDEN_A; | ||||
| ebone->flag &= ~BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL; | ebone->flag &= ~BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL; | ||||
| } | } | ||||
| else if (event == OL_DOP_UNHIDE) { | else if (event == OL_DOP_UNHIDE) { | ||||
| ebone->flag &= ~BONE_HIDDEN_A; | ebone->flag &= ~BONE_HIDDEN_A; | ||||
| } | } | ||||
| } | } | ||||
| static void sequence_fn(int event, TreeElement *te, TreeStoreElem * /*tselem*/, void *scene_ptr) | static void sequence_fn(int event, | ||||
| TreeElement *te, | |||||
| TreeStoreElem * /*tselem*/, | |||||
| void *video_edit_ptr) | |||||
| { | { | ||||
| TreeElementSequence *te_seq = tree_element_cast<TreeElementSequence>(te); | TreeElementSequence *te_seq = tree_element_cast<TreeElementSequence>(te); | ||||
| Sequence *seq = &te_seq->getSequence(); | Sequence *seq = &te_seq->getSequence(); | ||||
| Scene *scene = (Scene *)scene_ptr; | VideoEdit *video_edit = (VideoEdit *)video_edit_ptr; | ||||
| Editing *ed = SEQ_editing_get(scene); | if (BLI_findindex(video_edit->seqbasep, seq) != -1) { | ||||
| if (BLI_findindex(ed->seqbasep, seq) != -1) { | |||||
| if (event == OL_DOP_SELECT) { | if (event == OL_DOP_SELECT) { | ||||
| ED_sequencer_select_sequence_single(scene, seq, true); | ED_sequencer_select_sequence_single(video_edit, seq, true); | ||||
| } | } | ||||
| else if (event == OL_DOP_DESELECT) { | else if (event == OL_DOP_DESELECT) { | ||||
| seq->flag &= ~SELECT; | seq->flag &= ~SELECT; | ||||
| } | } | ||||
| else if (event == OL_DOP_HIDE) { | else if (event == OL_DOP_HIDE) { | ||||
| if (!(seq->flag & SEQ_MUTE)) { | if (!(seq->flag & SEQ_MUTE)) { | ||||
| seq->flag |= SEQ_MUTE; | seq->flag |= SEQ_MUTE; | ||||
| SEQ_relations_invalidate_dependent(scene, seq); | SEQ_relations_invalidate_dependent(video_edit, seq); | ||||
| } | } | ||||
| } | } | ||||
| else if (event == OL_DOP_UNHIDE) { | else if (event == OL_DOP_UNHIDE) { | ||||
| if (seq->flag & SEQ_MUTE) { | if (seq->flag & SEQ_MUTE) { | ||||
| seq->flag &= ~SEQ_MUTE; | seq->flag &= ~SEQ_MUTE; | ||||
| SEQ_relations_invalidate_dependent(scene, seq); | SEQ_relations_invalidate_dependent(video_edit, seq); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void gpencil_layer_fn(int event, | static void gpencil_layer_fn(int event, | ||||
| TreeElement *te, | TreeElement *te, | ||||
| TreeStoreElem * /*tselem*/, | TreeStoreElem * /*tselem*/, | ||||
| ▲ Show 20 Lines • Show All 1,252 Lines • ▼ Show 20 Lines | switch (datalevel) { | ||||
| case TSE_EBONE: { | case TSE_EBONE: { | ||||
| outliner_do_data_operation(space_outliner, datalevel, event, ebone_fn, nullptr); | outliner_do_data_operation(space_outliner, datalevel, event, ebone_fn, nullptr); | ||||
| WM_event_add_notifier(C, NC_OBJECT | ND_POSE, nullptr); | WM_event_add_notifier(C, NC_OBJECT | ND_POSE, nullptr); | ||||
| ED_undo_push(C, "EditBone operation"); | ED_undo_push(C, "EditBone operation"); | ||||
| break; | break; | ||||
| } | } | ||||
| case TSE_SEQUENCE: { | case TSE_SEQUENCE: { | ||||
| Scene *scene = CTX_data_scene(C); | VideoEdit *video_edit = CTX_data_video_edit(C); | ||||
| outliner_do_data_operation(space_outliner, datalevel, event, sequence_fn, scene); | outliner_do_data_operation(space_outliner, datalevel, event, sequence_fn, video_edit); | ||||
| WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER | NA_SELECTED, scene); | WM_event_add_notifier(C, NC_VIDEO_EDIT | ND_SEQUENCER | NA_SELECTED, video_edit); | ||||
| ED_undo_push(C, "Sequencer operation"); | ED_undo_push(C, "Sequencer operation"); | ||||
| break; | break; | ||||
| } | } | ||||
| case TSE_GP_LAYER: { | case TSE_GP_LAYER: { | ||||
| outliner_do_data_operation(space_outliner, datalevel, event, gpencil_layer_fn, nullptr); | outliner_do_data_operation(space_outliner, datalevel, event, gpencil_layer_fn, nullptr); | ||||
| WM_event_add_notifier(C, NC_GPENCIL | ND_DATA, nullptr); | WM_event_add_notifier(C, NC_GPENCIL | ND_DATA, nullptr); | ||||
| ED_undo_push(C, "Grease Pencil Layer operation"); | ED_undo_push(C, "Grease Pencil Layer operation"); | ||||
| ▲ Show 20 Lines • Show All 217 Lines • Show Last 20 Lines | |||||