Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_select.c
| Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | |||||
| * | * | ||||
| * If extend is used, we try to have the other compatible selected objects in the new mode as well. | * If extend is used, we try to have the other compatible selected objects in the new mode as well. | ||||
| * Otherwise only the new object will be active, selected and in the edit mode. | * Otherwise only the new object will be active, selected and in the edit mode. | ||||
| */ | */ | ||||
| static void do_outliner_activate_obdata( | static void do_outliner_activate_obdata( | ||||
| bContext *C, Scene *scene, ViewLayer *view_layer, Base *base, const bool extend) | bContext *C, Scene *scene, ViewLayer *view_layer, Base *base, const bool extend) | ||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
| Object *obact = OBACT(view_layer); | Object *obact = OBACT(view_layer); | ||||
| Object *ob = base->object; | Object *ob = base->object; | ||||
| bool use_all = false; | bool use_all = false; | ||||
| if (obact == NULL) { | if (obact == NULL) { | ||||
| ED_object_base_activate(C, base); | ED_object_base_activate(C, base); | ||||
| DEG_id_tag_update(&scene->id, ID_RECALC_SELECT); | DEG_id_tag_update(&scene->id, ID_RECALC_SELECT); | ||||
| WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); | WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); | ||||
| Show All 31 Lines | else { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void do_outliner_activate_pose( | static void do_outliner_activate_pose( | ||||
| bContext *C, Scene *scene, ViewLayer *view_layer, Base *base, const bool extend) | bContext *C, Scene *scene, ViewLayer *view_layer, Base *base, const bool extend) | ||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
| Object *obact = OBACT(view_layer); | Object *obact = OBACT(view_layer); | ||||
| Object *ob = base->object; | Object *ob = base->object; | ||||
| bool use_all = false; | bool use_all = false; | ||||
| if (obact == NULL) { | if (obact == NULL) { | ||||
| ED_object_base_activate(C, base); | ED_object_base_activate(C, base); | ||||
| DEG_id_tag_update(&scene->id, ID_RECALC_SELECT); | DEG_id_tag_update(&scene->id, ID_RECALC_SELECT); | ||||
| WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); | WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); | ||||
| ▲ Show 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | static eOLDrawState tree_element_set_active_object(bContext *C, | ||||
| if (scene->toolsettings->object_flag & SCE_OBJECT_MODE_LOCK) { | if (scene->toolsettings->object_flag & SCE_OBJECT_MODE_LOCK) { | ||||
| if (base != NULL) { | if (base != NULL) { | ||||
| Object *obact = OBACT(view_layer); | Object *obact = OBACT(view_layer); | ||||
| const eObjectMode object_mode = obact ? obact->mode : OB_MODE_OBJECT; | const eObjectMode object_mode = obact ? obact->mode : OB_MODE_OBJECT; | ||||
| if (base && !BKE_object_is_mode_compat(base->object, object_mode)) { | if (base && !BKE_object_is_mode_compat(base->object, object_mode)) { | ||||
| if (object_mode == OB_MODE_OBJECT) { | if (object_mode == OB_MODE_OBJECT) { | ||||
| struct Main *bmain = CTX_data_main(C); | struct Main *bmain = CTX_data_main(C); | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | ||||
| ED_object_mode_generic_exit(bmain, depsgraph, scene, base->object); | ED_object_mode_generic_exit(bmain, depsgraph, scene, base->object); | ||||
| } | } | ||||
| if (!BKE_object_is_mode_compat(base->object, object_mode)) { | if (!BKE_object_is_mode_compat(base->object, object_mode)) { | ||||
| base = NULL; | base = NULL; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,079 Lines • Show Last 20 Lines | |||||