diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-06 18:43:53 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-06 18:53:40 +0300 |
commit | a48b52d5466939044589bc332918463eef186ba8 (patch) | |
tree | 0aa15a5e9391e345e208d09d49d4f38cfd226877 /source/blender/makesrna | |
parent | 63f3e1ac7c8a0e65fa2a347c7769cd8c07c0dc78 (diff) |
3D View: support object type visibility/selection
Trying to have a single option for this is too likely to be
insufficient in some cases.
Instead, support object type visibility & selectability per view-port.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 58 |
1 files changed, 48 insertions, 10 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 2a7bb5994c3..13978f3f5ee 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2609,16 +2609,6 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Show 3D Cursor", "Display 3D Cursor Overlay"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); - prop = RNA_def_property(srna, "show_non_geometry", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna( - prop, NULL, "overlay.object_type_exclude", - ((1 << OB_TYPE_MAX) - 1) & - ~((1 << OB_MESH) | (1 << OB_CURVE) | (1 << OB_SURF) | (1 << OB_FONT) | (1 << OB_MBALL))); - RNA_def_property_boolean_default(prop, true); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_ui_text(prop, "Show Non Renderable", "Draw not renderable objects in the overlay"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); - prop = RNA_def_property(srna, "show_text", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "overlay.flag", V3D_OVERLAY_HIDE_TEXT); RNA_def_property_ui_text(prop, "Show Text", "Display overlay text"); @@ -3024,6 +3014,54 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Volume Alpha", "Opacity (alpha) of the cameras' frustum volume"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + { + struct { + const char *name; + int type_mask; + const char *identifier[2]; + } info[] = { + {"Mesh", (1 << OB_MESH), + {"show_object_viewport_mesh", "show_object_select_mesh"}}, + {"Curve", (1 << OB_CURVE), + {"show_object_viewport_curve", "show_object_select_curve"}}, + {"Surface", (1 << OB_SURF), + {"show_object_viewport_surf", "show_object_select_surf"}}, + {"Meta", (1 << OB_MBALL), + {"show_object_viewport_meta", "show_object_select_meta"}}, + {"Font", (1 << OB_FONT), + {"show_object_viewport_font", "show_object_select_font"}}, + {"Armature", (1 << OB_ARMATURE), + {"show_object_viewport_armature", "show_object_select_armature"}}, + {"Lattice", (1 << OB_LATTICE), + {"show_object_viewport_lattice", "show_object_select_lattice"}}, + {"Empty", (1 << OB_EMPTY), + {"show_object_viewport_empty", "show_object_select_empty"}}, + {"Camera", (1 << OB_CAMERA), + {"show_object_viewport_camera", "show_object_select_camera"}}, + {"Lamp", (1 << OB_LAMP), + {"show_object_viewport_lamp", "show_object_select_lamp"}}, + {"Speaker", (1 << OB_SPEAKER), + {"show_object_viewport_speaker", "show_object_select_speaker"}}, + {"Light Probe", (1 << OB_LIGHTPROBE), + {"show_object_viewport_light_probe", "show_object_select_light_probe"}}, + }; + + const char *view_mask_member[2] = { + "object_type_exclude_viewport", + "object_type_exclude_select", + }; + for (int mask_index = 0; mask_index < 2; mask_index++) { + for (int type_index = 0; type_index < ARRAY_SIZE(info); type_index++) { + prop = RNA_def_property(srna, info[type_index].identifier[mask_index], PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna( + prop, NULL, view_mask_member[mask_index], info[type_index].type_mask); + RNA_def_property_ui_text(prop, info[type_index].name, ""); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); + + } + } + } + /* Nested Structs */ prop = RNA_def_property(srna, "shading", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); |