diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2019-01-24 19:20:04 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2019-01-24 19:25:22 +0300 |
commit | 6100dc6a202cb19a13b30210dc4a5afabd3afaa4 (patch) | |
tree | 747ad7bd1d276234443e5795e09b771d07092ce1 /source | |
parent | 15bae8ac0050a50904ac4f90e85e4463463b3c5d (diff) |
bring back possibility to override camera per view
this can now be found in the sidebar View panel
- uses existing 'lock_camera_and_layers' but renames the property to
'use_local_camera'
- uses RNA_def_property_boolean_negative_sdna to flip the value
- remove the local view code in
rna_SpaceView3D_lock_camera_and_layers_set
- update Python code
- update Addons code will be separate commit
Fixes T60756
Reviewers: billreynish, brecht
Maniphest Tasks: T60756
Differential Revision: https://developer.blender.org/D4247
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 640929ead19..6fa13cadbd6 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -531,31 +531,15 @@ static void rna_SpaceView3D_camera_update(Main *bmain, Scene *scene, PointerRNA } } -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); 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); - - /* 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; } } @@ -3189,12 +3173,11 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Tool Gizmo", "Active tool gizmo"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); - prop = RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "scenelock", 1); - RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_lock_camera_and_layers_set"); - RNA_def_property_ui_text(prop, "Lock Camera and Layers", - "Use the scene's active camera and layers in this view, rather than local layers"); - RNA_def_property_ui_icon(prop, ICON_LOCKVIEW_OFF, 1); + prop = RNA_def_property(srna, "use_local_camera", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "scenelock", 1); + RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceView3D_use_local_camera_set"); + RNA_def_property_ui_text(prop, "Use Local Camera", + "Use a local camera in this view, rather than scene's active camera camera"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); prop = RNA_def_property(srna, "region_3d", PROP_POINTER, PROP_NONE); |