Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_header.c
| Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | |||||
| static void handle_view3d_lock(bContext *C) | static void handle_view3d_lock(bContext *C) | ||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| ScrArea *sa = CTX_wm_area(C); | ScrArea *sa = CTX_wm_area(C); | ||||
| View3D *v3d = CTX_wm_view3d(C); | View3D *v3d = CTX_wm_view3d(C); | ||||
| if (v3d != NULL && sa != NULL) { | if (v3d != NULL && sa != NULL) { | ||||
| if (v3d->localvd == NULL && v3d->scenelock && sa->spacetype == SPACE_VIEW3D) { | if (v3d->localviewd == NULL && v3d->scenelock && sa->spacetype == SPACE_VIEW3D) { | ||||
| /* copy to scene */ | /* copy to scene */ | ||||
| scene->lay = v3d->lay; | scene->lay = v3d->lay; | ||||
| scene->layact = v3d->layact; | scene->layact = v3d->layact; | ||||
| scene->camera = v3d->camera; | scene->camera = v3d->camera; | ||||
| /* not through notifier, listener don't have context | /* not through notifier, listener don't have context | ||||
| * and non-open screens or spaces need to be updated too */ | * and non-open screens or spaces need to be updated too */ | ||||
| BKE_screen_view3d_main_sync(&bmain->screen, scene); | BKE_screen_view3d_main_sync(&bmain->screen, scene); | ||||
| ▲ Show 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | static int view3d_layers_invoke(bContext *C, wmOperator *op, const wmEvent *event) | ||||
| } | } | ||||
| view3d_layers_exec(C, op); | view3d_layers_exec(C, op); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| static int view3d_layers_poll(bContext *C) | static int view3d_layers_poll(bContext *C) | ||||
| { | { | ||||
| return (ED_operator_view3d_active(C) && CTX_wm_view3d(C)->localvd == NULL); | return (ED_operator_view3d_active(C) && CTX_wm_view3d(C)->localviewd == NULL); | ||||
| } | } | ||||
| void VIEW3D_OT_layers(wmOperatorType *ot) | void VIEW3D_OT_layers(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Layers"; | ot->name = "Layers"; | ||||
| ot->description = "Toggle layer(s) visibility"; | ot->description = "Toggle layer(s) visibility"; | ||||
| ot->idname = "VIEW3D_OT_layers"; | ot->idname = "VIEW3D_OT_layers"; | ||||
| ▲ Show 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | else { | ||||
| row = uiLayoutRow(layout, true); | row = uiLayoutRow(layout, true); | ||||
| uiItemR(row, &v3dptr, "show_manipulator", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); | uiItemR(row, &v3dptr, "show_manipulator", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); | ||||
| if (v3d->twflag & V3D_USE_MANIPULATOR) { | if (v3d->twflag & V3D_USE_MANIPULATOR) { | ||||
| uiItemR(row, &v3dptr, "transform_manipulators", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); | uiItemR(row, &v3dptr, "transform_manipulators", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); | ||||
| } | } | ||||
| uiItemR(row, &v3dptr, "transform_orientation", 0, "", ICON_NONE); | uiItemR(row, &v3dptr, "transform_orientation", 0, "", ICON_NONE); | ||||
| } | } | ||||
| if (obedit == NULL && v3d->localvd == NULL) { | if (obedit == NULL && v3d->localviewd == NULL) { | ||||
| unsigned int ob_lay = ob ? ob->lay : 0; | unsigned int ob_lay = ob ? ob->lay : 0; | ||||
| /* Layers */ | /* Layers */ | ||||
| uiTemplateLayers(layout, v3d->scenelock ? &sceneptr : &v3dptr, "layers", &v3dptr, "layers_used", ob_lay); | uiTemplateLayers(layout, v3d->scenelock ? &sceneptr : &v3dptr, "layers", &v3dptr, "layers_used", ob_lay); | ||||
| /* Scene lock */ | /* Scene lock */ | ||||
| uiItemR(layout, &v3dptr, "lock_camera_and_layers", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); | uiItemR(layout, &v3dptr, "lock_camera_and_layers", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); | ||||
| } | } | ||||
| uiTemplateEditModeSelection(layout, C); | uiTemplateEditModeSelection(layout, C); | ||||
| } | } | ||||