Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_space.c
| Show First 20 Lines • Show All 525 Lines • ▼ Show 20 Lines | static void rna_SpaceView3D_camera_update(Main *bmain, Scene *scene, PointerRNA *ptr) | ||||
| if (v3d->scenelock) { | if (v3d->scenelock) { | ||||
| wmWindowManager *wm = bmain->wm.first; | wmWindowManager *wm = bmain->wm.first; | ||||
| scene->camera = v3d->camera; | scene->camera = v3d->camera; | ||||
| WM_windows_scene_data_sync(&wm->windows, scene); | WM_windows_scene_data_sync(&wm->windows, scene); | ||||
| } | } | ||||
| } | } | ||||
| static void rna_SpaceView3D_lock_camera_and_layers_set(PointerRNA *ptr, bool value) | static void rna_SpaceView3D_use_local_camera_set(PointerRNA *ptr, bool value) | ||||
| { | { | ||||
| View3D *v3d = (View3D *)(ptr->data); | View3D *v3d = (View3D *)(ptr->data); | ||||
| bScreen *sc = (bScreen *)ptr->id.data; | bScreen *sc = (bScreen *)ptr->id.data; | ||||
| v3d->scenelock = value; | v3d->scenelock = !value; | ||||
| if (value) { | if (!value) { | ||||
| Scene *scene = ED_screen_scene_find(sc, G_MAIN->wm.first); | Scene *scene = ED_screen_scene_find(sc, G_MAIN->wm.first); | ||||
| /* TODO: restore local view. */ | |||||
| #if 0 | |||||
| int bit; | |||||
| v3d->lay = scene->lay; | |||||
| /* seek for layact */ | |||||
| bit = 0; | |||||
| while (bit < 32) { | |||||
| if (v3d->lay & (1u << bit)) { | |||||
| v3d->layact = (1u << bit); | |||||
| break; | |||||
| } | |||||
| bit++; | |||||
| } | |||||
| #endif | |||||
| v3d->camera = scene->camera; | v3d->camera = scene->camera; | ||||
| } | } | ||||
| } | } | ||||
| static float rna_View3DOverlay_GridScaleUnit_get(PointerRNA *ptr) | static float rna_View3DOverlay_GridScaleUnit_get(PointerRNA *ptr) | ||||
| { | { | ||||
| View3D *v3d = (View3D *)(ptr->data); | View3D *v3d = (View3D *)(ptr->data); | ||||
| bScreen *screen = ptr->id.data; | bScreen *screen = ptr->id.data; | ||||
| ▲ Show 20 Lines • Show All 2,617 Lines • ▼ Show 20 Lines | static void rna_def_space_view3d(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text(prop, "Context Gizmo", "Context sensitive gizmos for the active item"); | RNA_def_property_ui_text(prop, "Context Gizmo", "Context sensitive gizmos for the active item"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | ||||
| prop = RNA_def_property(srna, "show_gizmo_tool", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "show_gizmo_tool", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_negative_sdna(prop, NULL, "gizmo_flag", V3D_GIZMO_HIDE_TOOL); | RNA_def_property_boolean_negative_sdna(prop, NULL, "gizmo_flag", V3D_GIZMO_HIDE_TOOL); | ||||
| RNA_def_property_ui_text(prop, "Tool Gizmo", "Active tool gizmo"); | RNA_def_property_ui_text(prop, "Tool Gizmo", "Active tool gizmo"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | ||||
| prop = RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_local_camera", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "scenelock", 1); | RNA_def_property_boolean_negative_sdna(prop, NULL, "scenelock", 1); | ||||
| RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_lock_camera_and_layers_set"); | RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_use_local_camera_set"); | ||||
| RNA_def_property_ui_text(prop, "Lock Camera and Layers", | RNA_def_property_ui_text(prop, "Use Local Camera", | ||||
| "Use the scene's active camera and layers in this view, rather than local layers"); | "Use a local camera in this view, rather than scene's active camera camera"); | ||||
| RNA_def_property_ui_icon(prop, ICON_LOCKVIEW_OFF, 1); | |||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); | ||||
brecht: Actually this line to define an icon can be removed, just a checkbox in the UI is sufficient. | |||||
| prop = RNA_def_property(srna, "region_3d", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "region_3d", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "RegionView3D"); | RNA_def_property_struct_type(prop, "RegionView3D"); | ||||
| RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", NULL, NULL, NULL); | RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", NULL, NULL, NULL); | ||||
| RNA_def_property_ui_text(prop, "3D Region", "3D region in this space, in case of quad view the camera region"); | RNA_def_property_ui_text(prop, "3D Region", "3D region in this space, in case of quad view the camera region"); | ||||
| prop = RNA_def_property(srna, "region_quadviews", PROP_COLLECTION, PROP_NONE); | prop = RNA_def_property(srna, "region_quadviews", PROP_COLLECTION, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "RegionView3D"); | RNA_def_property_struct_type(prop, "RegionView3D"); | ||||
| ▲ Show 20 Lines • Show All 2,055 Lines • Show Last 20 Lines | |||||
Actually this line to define an icon can be removed, just a checkbox in the UI is sufficient.