diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-05-03 16:09:09 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-05-05 16:54:43 +0300 |
commit | b365cc017adf3a8fb36006d6cb194d28be02e6d4 (patch) | |
tree | 9707a02b1ce75c285d731f41a9d49d2ec52dcad8 /source/blender/makesrna/intern | |
parent | 2094b454474de25e42cd6ec1f63ebc84f50f666a (diff) |
3D Viewport: move overlay settings from collections to 3D viewport.
For some we may add per object overrides, but for most we plan to keep them
strictly per viewport settings. Display settings from the mesh still need to
be moved here, only collections were done to remove that code.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_layer.c | 265 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_mesh.c | 20 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 7 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 85 |
4 files changed, 79 insertions, 298 deletions
diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c index cbc88835c1b..c9728e82442 100644 --- a/source/blender/makesrna/intern/rna_layer.c +++ b/source/blender/makesrna/intern/rna_layer.c @@ -47,14 +47,6 @@ #include "rna_internal.h" -const EnumPropertyItem rna_enum_layer_collection_mode_settings_type_items[] = { - {COLLECTION_MODE_OBJECT, "OBJECT", 0, "Object", ""}, - {COLLECTION_MODE_EDIT, "EDIT", 0, "Edit", ""}, - {COLLECTION_MODE_PAINT_WEIGHT, "PAINT_WEIGHT", 0, "Weight Paint", ""}, - {COLLECTION_MODE_PAINT_WEIGHT, "PAINT_VERTEX", 0, "Vertex Paint", ""}, - {0, NULL, 0, NULL, NULL} -}; - const EnumPropertyItem rna_enum_collection_type_items[] = { {COLLECTION_TYPE_NONE, "NONE", 0, "Normal", ""}, {COLLECTION_TYPE_GROUP_INTERNAL, "GROUP_INTERNAL", 0, "Group Internal", ""}, @@ -257,7 +249,7 @@ static void rna_SceneCollection_object_unlink( /****** layer collection engine settings *******/ -#define RNA_LAYER_ENGINE_GET_SET(_TYPE_, _ENGINE_, _MODE_, _NAME_) \ +#define RNA_LAYER_ENGINE_GET_SET(_TYPE_, _ENGINE_, _NAME_) \ static _TYPE_ rna_LayerEngineSettings_##_ENGINE_##_##_NAME_##_get(PointerRNA *ptr) \ { \ IDProperty *props = (IDProperty *)ptr->data; \ @@ -270,7 +262,7 @@ static void rna_LayerEngineSettings_##_ENGINE_##_##_NAME_##_set(PointerRNA *ptr, BKE_collection_engine_property_value_set_##_TYPE_(props, #_NAME_, value); \ } -#define RNA_LAYER_ENGINE_GET_SET_ARRAY(_TYPE_, _ENGINE_, _MODE_, _NAME_, _LEN_) \ +#define RNA_LAYER_ENGINE_GET_SET_ARRAY(_TYPE_, _ENGINE_, _NAME_, _LEN_) \ static void rna_LayerEngineSettings_##_ENGINE_##_##_NAME_##_get(PointerRNA *ptr, _TYPE_ *values) \ { \ IDProperty *props = (IDProperty *)ptr->data; \ @@ -287,66 +279,40 @@ static void rna_LayerEngineSettings_##_ENGINE_##_##_NAME_##_set(PointerRNA *ptr, } #define RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT(_NAME_) \ - RNA_LAYER_ENGINE_GET_SET(float, Clay, COLLECTION_MODE_NONE, _NAME_) + RNA_LAYER_ENGINE_GET_SET(float, Clay, _NAME_) #define RNA_LAYER_ENGINE_CLAY_GET_SET_FLOAT_ARRAY(_NAME_, _LEN_) \ - RNA_LAYER_ENGINE_GET_SET_ARRAY(float, Clay, COLLECTION_MODE_NONE, _NAME_, _LEN_) + RNA_LAYER_ENGINE_GET_SET_ARRAY(float, Clay, _NAME_, _LEN_) #define RNA_LAYER_ENGINE_CLAY_GET_SET_INT(_NAME_) \ - RNA_LAYER_ENGINE_GET_SET(int, Clay, COLLECTION_MODE_NONE, _NAME_) + RNA_LAYER_ENGINE_GET_SET(int, Clay, _NAME_) #define RNA_LAYER_ENGINE_CLAY_GET_SET_BOOL(_NAME_) \ - RNA_LAYER_ENGINE_GET_SET(bool, Clay, COLLECTION_MODE_NONE, _NAME_) + RNA_LAYER_ENGINE_GET_SET(bool, Clay, _NAME_) #define RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT(_NAME_) \ - RNA_LAYER_ENGINE_GET_SET(float, Eevee, COLLECTION_MODE_NONE, _NAME_) + RNA_LAYER_ENGINE_GET_SET(float, Eevee, _NAME_) #define RNA_LAYER_ENGINE_EEVEE_GET_SET_FLOAT_ARRAY(_NAME_, _LEN_) \ - RNA_LAYER_ENGINE_GET_SET_ARRAY(float, Eevee, COLLECTION_MODE_NONE, _NAME_, _LEN_) + RNA_LAYER_ENGINE_GET_SET_ARRAY(float, Eevee, _NAME_, _LEN_) #define RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(_NAME_) \ - RNA_LAYER_ENGINE_GET_SET(int, Eevee, COLLECTION_MODE_NONE, _NAME_) + RNA_LAYER_ENGINE_GET_SET(int, Eevee, _NAME_) #define RNA_LAYER_ENGINE_EEVEE_GET_SET_BOOL(_NAME_) \ - RNA_LAYER_ENGINE_GET_SET(bool, Eevee, COLLECTION_MODE_NONE, _NAME_) + RNA_LAYER_ENGINE_GET_SET(bool, Eevee, _NAME_) #define RNA_LAYER_ENGINE_WORKBENCH_GET_SET_FLOAT_ARRAY(_NAME_, _LEN_) \ - RNA_LAYER_ENGINE_GET_SET_ARRAY(float, Workbench, COLLECTION_MODE_NONE, _NAME_, _LEN_) + RNA_LAYER_ENGINE_GET_SET_ARRAY(float, Workbench, _NAME_, _LEN_) #define RNA_LAYER_ENGINE_WORKBENCH_GET_SET_FLOAT(_NAME_) \ - RNA_LAYER_ENGINE_GET_SET(float, Workbench, COLLECTION_MODE_NONE, _NAME_) + RNA_LAYER_ENGINE_GET_SET(float, Workbench, _NAME_) #define RNA_LAYER_ENGINE_WORKBENCH_GET_SET_INT(_NAME_) \ - RNA_LAYER_ENGINE_GET_SET(int, Workbench, COLLECTION_MODE_NONE, _NAME_) + RNA_LAYER_ENGINE_GET_SET(int, Workbench, _NAME_) #define RNA_LAYER_ENGINE_WORKBENCH_GET_SET_BOOL(_NAME_) \ - RNA_LAYER_ENGINE_GET_SET(bool, Workbench, COLLECTION_MODE_NONE, _NAME_) - -/* mode engines */ - -#define RNA_LAYER_MODE_OBJECT_GET_SET_FLOAT(_NAME_) \ - RNA_LAYER_ENGINE_GET_SET(float, ObjectMode, COLLECTION_MODE_OBJECT, _NAME_) - -#define RNA_LAYER_MODE_OBJECT_GET_SET_INT(_NAME_) \ - RNA_LAYER_ENGINE_GET_SET(int, ObjectMode, COLLECTION_MODE_OBJECT, _NAME_) - -#define RNA_LAYER_MODE_OBJECT_GET_SET_BOOL(_NAME_) \ - RNA_LAYER_ENGINE_GET_SET(bool, ObjectMode, COLLECTION_MODE_OBJECT, _NAME_) - -#define RNA_LAYER_MODE_EDIT_GET_SET_FLOAT(_NAME_) \ - RNA_LAYER_ENGINE_GET_SET(float, EditMode, COLLECTION_MODE_EDIT, _NAME_) - -#define RNA_LAYER_MODE_EDIT_GET_SET_INT(_NAME_) \ - RNA_LAYER_ENGINE_GET_SET(int, EditMode, COLLECTION_MODE_EDIT, _NAME_) - -#define RNA_LAYER_MODE_EDIT_GET_SET_BOOL(_NAME_) \ - RNA_LAYER_ENGINE_GET_SET(bool, EditMode, COLLECTION_MODE_EDIT, _NAME_) - -#define RNA_LAYER_MODE_PAINT_WEIGHT_GET_SET_BOOL(_NAME_) \ - RNA_LAYER_ENGINE_GET_SET(bool, PaintWeightMode, COLLECTION_MODE_PAINT_WEIGHT, _NAME_) - -#define RNA_LAYER_MODE_PAINT_VERTEX_GET_SET_BOOL(_NAME_) \ - RNA_LAYER_ENGINE_GET_SET(bool, PaintVertexMode, COLLECTION_MODE_PAINT_VERTEX, _NAME_) + RNA_LAYER_ENGINE_GET_SET(bool, Workbench, _NAME_) /* clay engine */ #ifdef WITH_CLAY_ENGINE @@ -428,27 +394,6 @@ RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(gi_diffuse_bounces) RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(gi_cubemap_resolution) RNA_LAYER_ENGINE_EEVEE_GET_SET_INT(gi_visibility_resolution) -/* object engine */ -RNA_LAYER_MODE_OBJECT_GET_SET_BOOL(show_wire) -RNA_LAYER_MODE_OBJECT_GET_SET_BOOL(show_backface_culling) - -/* mesh engine */ -RNA_LAYER_MODE_EDIT_GET_SET_BOOL(show_occlude_wire) -RNA_LAYER_MODE_EDIT_GET_SET_BOOL(show_weight) -RNA_LAYER_MODE_EDIT_GET_SET_BOOL(face_normals_show) -RNA_LAYER_MODE_EDIT_GET_SET_BOOL(vert_normals_show) -RNA_LAYER_MODE_EDIT_GET_SET_BOOL(loop_normals_show) -RNA_LAYER_MODE_EDIT_GET_SET_FLOAT(normals_length) -RNA_LAYER_MODE_EDIT_GET_SET_FLOAT(backwire_opacity) - -/* weight paint engine */ -RNA_LAYER_MODE_PAINT_WEIGHT_GET_SET_BOOL(use_shading) -RNA_LAYER_MODE_PAINT_WEIGHT_GET_SET_BOOL(use_wire) - -/* vertex paint engine */ -RNA_LAYER_MODE_PAINT_VERTEX_GET_SET_BOOL(use_shading) -RNA_LAYER_MODE_PAINT_VERTEX_GET_SET_BOOL(use_wire) - #undef RNA_LAYER_ENGINE_GET_SET static void rna_ViewLayerEngineSettings_update(bContext *C, PointerRNA *UNUSED(ptr)) @@ -471,20 +416,6 @@ static void rna_LayerCollectionEngineSettings_update(bContext *UNUSED(C), Pointe WM_main_add_notifier(NC_SCENE | ND_LAYER_CONTENT, NULL); } -static void rna_LayerCollectionEngineSettings_wire_update(bContext *C, PointerRNA *UNUSED(ptr)) -{ - Scene *scene = CTX_data_scene(C); - ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); - - if (ob != NULL && ob->type == OB_MESH) { - BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL); - } - - /* TODO(sergey): Use proper flag for tagging here. */ - DEG_id_tag_update(&scene->id, 0); -} - /***********************************/ static void engine_settings_use(IDProperty *root, IDProperty *props, PointerRNA *props_ptr, const char *identifier) @@ -543,10 +474,6 @@ static StructRNA *rna_ViewLayerSettings_refine(PointerRNA *ptr) return &RNA_ViewLayerEngineSettingsWorkbench; } break; - case IDP_GROUP_SUB_MODE_OBJECT: - case IDP_GROUP_SUB_MODE_EDIT: - case IDP_GROUP_SUB_MODE_PAINT_WEIGHT: - case IDP_GROUP_SUB_MODE_PAINT_VERTEX: default: BLI_assert(!"Mode not fully implemented"); break; @@ -573,7 +500,7 @@ static void rna_ViewLayerSettings_use(ID *id, IDProperty *props, const char *ide PointerRNA scene_props_ptr; IDProperty *scene_props; - scene_props = BKE_view_layer_engine_scene_get(scene, COLLECTION_MODE_NONE, props->name); + scene_props = BKE_view_layer_engine_scene_get(scene, props->name); RNA_pointer_create(id, &RNA_ViewLayerSettings, scene_props, &scene_props_ptr); engine_settings_use(props, scene_props, &scene_props_ptr, identifier); @@ -611,18 +538,6 @@ static StructRNA *rna_LayerCollectionSettings_refine(PointerRNA *ptr) return &RNA_LayerCollectionSettings; } break; - case IDP_GROUP_SUB_MODE_OBJECT: - return &RNA_LayerCollectionModeSettingsObject; - break; - case IDP_GROUP_SUB_MODE_EDIT: - return &RNA_LayerCollectionModeSettingsEdit; - break; - case IDP_GROUP_SUB_MODE_PAINT_WEIGHT: - return &RNA_LayerCollectionModeSettingsPaintWeight; - break; - case IDP_GROUP_SUB_MODE_PAINT_VERTEX: - return &RNA_LayerCollectionModeSettingsPaintVertex; - break; default: BLI_assert(!"Mode not fully implemented"); break; @@ -649,7 +564,7 @@ static void rna_LayerCollectionSettings_use(ID *id, IDProperty *props, const cha PointerRNA scene_props_ptr; IDProperty *scene_props; - scene_props = BKE_layer_collection_engine_scene_get(scene, COLLECTION_MODE_NONE, props->name); + scene_props = BKE_layer_collection_engine_scene_get(scene, props->name); RNA_pointer_create(id, &RNA_LayerCollectionSettings, scene_props, &scene_props_ptr); engine_settings_use(props, scene_props, &scene_props_ptr, identifier); @@ -1752,143 +1667,6 @@ static void rna_def_layer_collection_engine_settings_workbench(BlenderRNA *brna) RNA_define_verify_sdna(1); /* not in sdna */ } -static void rna_def_layer_collection_mode_settings_object(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "LayerCollectionModeSettingsObject", "LayerCollectionSettings"); - RNA_def_struct_ui_text(srna, "Collections Object Mode Settings", "Object Mode specific settings for this collection"); - RNA_define_verify_sdna(0); /* not in sdna */ - - /* see RNA_LAYER_ENGINE_GET_SET macro */ - - prop = RNA_def_property(srna, "show_wire", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Wire", "Add the object's wireframe over solid drawing"); - RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_ObjectMode_show_wire_get", "rna_LayerEngineSettings_ObjectMode_show_wire_set"); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, 0, "rna_LayerCollectionEngineSettings_update"); - - prop = RNA_def_property(srna, "show_backface_culling", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Backface Culling", ""); - RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_ObjectMode_show_backface_culling_get", "rna_LayerEngineSettings_ObjectMode_show_backface_culling_set"); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, 0, "rna_LayerCollectionEngineSettings_update"); - - RNA_define_verify_sdna(1); /* not in sdna */ -} - -static void rna_def_layer_collection_mode_settings_edit(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "LayerCollectionModeSettingsEdit", "LayerCollectionSettings"); - RNA_def_struct_ui_text(srna, "Collections Edit Mode Settings", "Edit Mode specific settings to be overridden per collection"); - RNA_define_verify_sdna(0); /* not in sdna */ - - /* see RNA_LAYER_ENGINE_GET_SET macro */ - - prop = RNA_def_property(srna, "show_occlude_wire", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Hidden Wire", "Use hidden wireframe display"); - RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_EditMode_show_occlude_wire_get", "rna_LayerEngineSettings_EditMode_show_occlude_wire_set"); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, 0, "rna_LayerCollectionEngineSettings_update"); - - prop = RNA_def_property(srna, "show_weight", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Show Weights", "Draw weights in editmode"); - RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_EditMode_show_weight_get", "rna_LayerEngineSettings_EditMode_show_weight_set"); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, 0, "rna_LayerCollectionEngineSettings_update"); - - prop = RNA_def_property(srna, "face_normals_show", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Draw Normals", "Display face normals as lines"); - RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_EditMode_face_normals_show_get", "rna_LayerEngineSettings_EditMode_face_normals_show_set"); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, 0, "rna_LayerCollectionEngineSettings_update"); - - prop = RNA_def_property(srna, "vert_normals_show", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Draw Vertex Normals", "Display vertex normals as lines"); - RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_EditMode_vert_normals_show_get", "rna_LayerEngineSettings_EditMode_vert_normals_show_set"); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, 0, "rna_LayerCollectionEngineSettings_update"); - - prop = RNA_def_property(srna, "loop_normals_show", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Draw Split Normals", "Display vertex-per-face normals as lines"); - RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_EditMode_loop_normals_show_get", "rna_LayerEngineSettings_EditMode_loop_normals_show_set"); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, 0, "rna_LayerCollectionEngineSettings_update"); - - prop = RNA_def_property(srna, "normals_length", PROP_FLOAT, PROP_FACTOR); - RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view"); - RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_EditMode_normals_length_get", "rna_LayerEngineSettings_EditMode_normals_length_set", NULL); - RNA_def_property_range(prop, 0.00001, 1000.0); - RNA_def_property_ui_range(prop, 0.01, 10.0, 10.0, 2); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, 0, "rna_LayerCollectionEngineSettings_update"); - - prop = RNA_def_property(srna, "backwire_opacity", PROP_FLOAT, PROP_FACTOR); - RNA_def_property_ui_text(prop, "Backwire Opacity", "Opacity when rendering transparent wires"); - RNA_def_property_float_funcs(prop, "rna_LayerEngineSettings_EditMode_backwire_opacity_get", "rna_LayerEngineSettings_EditMode_backwire_opacity_set", NULL); - RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, 0, "rna_LayerCollectionEngineSettings_update"); - - RNA_define_verify_sdna(1); /* not in sdna */ -} - -static void rna_def_layer_collection_mode_settings_paint_weight(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "LayerCollectionModeSettingsPaintWeight", "LayerCollectionSettings"); - RNA_def_struct_ui_text(srna, "Collections Weight Paint Mode Settings", "Weight Paint Mode specific settings to be overridden per collection"); - RNA_define_verify_sdna(0); /* not in sdna */ - - /* see RNA_LAYER_ENGINE_GET_SET macro */ - - prop = RNA_def_property(srna, "use_shading", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Use Shading", "Whether to use shaded or shadeless drawing"); - RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_PaintWeightMode_use_shading_get", "rna_LayerEngineSettings_PaintWeightMode_use_shading_set"); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, 0, "rna_LayerCollectionEngineSettings_update"); - - prop = RNA_def_property(srna, "use_wire", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Show Wire", "Whether to overlay wireframe onto the mesh"); - RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_PaintWeightMode_use_wire_get", "rna_LayerEngineSettings_PaintWeightMode_use_wire_set"); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollectionEngineSettings_wire_update"); - - RNA_define_verify_sdna(1); /* not in sdna */ -} - -static void rna_def_layer_collection_mode_settings_paint_vertex(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "LayerCollectionModeSettingsPaintVertex", "LayerCollectionSettings"); - RNA_def_struct_ui_text(srna, "Collections Vertex Paint Mode Settings", "Vertex Paint Mode specific settings to be overridden per collection"); - RNA_define_verify_sdna(0); /* not in sdna */ - - /* see RNA_LAYER_ENGINE_GET_SET macro */ - - prop = RNA_def_property(srna, "use_shading", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Use Shading", "Whether to use shaded or shadeless drawing"); - RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_PaintVertexMode_use_shading_get", "rna_LayerEngineSettings_PaintVertexMode_use_shading_set"); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, 0, "rna_LayerCollectionEngineSettings_update"); - - prop = RNA_def_property(srna, "use_wire", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_ui_text(prop, "Show Wire", "Whether to overlay wireframe onto the mesh"); - RNA_def_property_boolean_funcs(prop, "rna_LayerEngineSettings_PaintVertexMode_use_wire_get", "rna_LayerEngineSettings_PaintVertexMode_use_wire_set"); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollectionEngineSettings_wire_update"); - - RNA_define_verify_sdna(1); /* not in sdna */ -} - static void rna_def_view_layer_settings(BlenderRNA *brna) { StructRNA *srna; @@ -1928,13 +1706,6 @@ static void rna_def_view_layer_settings(BlenderRNA *brna) rna_def_view_layer_engine_settings_workbench(brna); rna_def_view_layer_engine_settings_eevee(brna); -#if 0 - rna_def_view_layer_mode_settings_object(brna); - rna_def_view_layer_mode_settings_edit(brna); - rna_def_view_layer_mode_settings_paint_weight(brna); - rna_def_view_layer_mode_settings_paint_vertex(brna); -#endif - RNA_define_verify_sdna(1); } @@ -1976,10 +1747,6 @@ static void rna_def_layer_collection_settings(BlenderRNA *brna) #endif rna_def_layer_collection_engine_settings_workbench(brna); - rna_def_layer_collection_mode_settings_object(brna); - rna_def_layer_collection_mode_settings_edit(brna); - rna_def_layer_collection_mode_settings_paint_weight(brna); - rna_def_layer_collection_mode_settings_paint_vertex(brna); RNA_define_verify_sdna(1); } diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 79a9d072ad2..9ec196034f3 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -3516,26 +3516,6 @@ static void rna_def_mesh(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Draw Faces", "Display all faces as shades in the 3D view and UV editor"); RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); - prop = RNA_def_property(srna, "show_normal_face", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWNORMALS); - RNA_def_property_ui_text(prop, "Draw Normals", "Display face normals as lines"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); - - prop = RNA_def_property(srna, "show_normal_loop", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_LNORMALS); - RNA_def_property_ui_text(prop, "Draw Split Normals", "Display vertex-per-face normals as lines"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); - - prop = RNA_def_property(srna, "show_normal_vertex", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_VNORMALS); - RNA_def_property_ui_text(prop, "Draw Vertex Normals", "Display vertex normals as lines"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); - - prop = RNA_def_property(srna, "show_weight", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEIGHT); - RNA_def_property_ui_text(prop, "Show Weights", "Draw weights in editmode"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data_edit_color"); /* needs to rebuild 'dm' */ - prop = RNA_def_property(srna, "show_edge_crease", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWCREASES); RNA_def_property_ui_text(prop, "Draw Creases", "Display creases created for Subdivision Surface modifier"); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index b93c3cf1dc6..f55247df15d 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2582,13 +2582,6 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Proportional Size", "Display size for proportional editing circle"); RNA_def_property_range(prop, 0.00001, 5000.0); - prop = RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE); - RNA_def_property_float_sdna(prop, NULL, "normalsize"); - RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view"); - RNA_def_property_range(prop, 0.00001, 1000.0); - RNA_def_property_ui_range(prop, 0.01, 10.0, 10.0, 2); - RNA_def_property_update(prop, NC_GEOM | ND_DATA, NULL); - prop = RNA_def_property(srna, "double_threshold", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "doublimit"); RNA_def_property_ui_text(prop, "Double Threshold", "Limit for removing duplicates and 'Auto Merge'"); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 4b726e6b993..101ef0a2e9a 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2197,49 +2197,50 @@ static void rna_def_space_view3d_shading(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Viewport Shading", "Method to display/shade objects in the 3D View"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_3DViewShading_type_update"); - RNA_def_struct_sdna(srna, "View3DShading"); - prop = RNA_def_property(srna, "light", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "light"); + RNA_def_property_enum_sdna(prop, NULL, "shading.light"); RNA_def_property_enum_items(prop, rna_enum_viewport_lighting_items); RNA_def_property_ui_text(prop, "Lighting", "Lighting Method for Solid/Texture Viewport Shading"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_3DViewShading_type_update"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); prop = RNA_def_property(srna, "show_object_overlap", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_SHADING_OBJECT_OVERLAP); + RNA_def_property_boolean_sdna(prop, NULL, "shading.flag", V3D_SHADING_OBJECT_OVERLAP); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Object Overlap", "Show Object Overlap"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_3DViewShading_type_update"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); prop = RNA_def_property(srna, "studio_light", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "shading.studio_light"); RNA_def_property_enum_items(prop, studio_lighting_items); RNA_def_property_ui_text(prop, "Studiolight", "Studio lighting setup"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_3DViewShading_type_update"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); prop = RNA_def_property(srna, "color_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "shading.color_type"); RNA_def_property_enum_items(prop, color_type_items); RNA_def_property_ui_text(prop, "Color", "Color Type"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_3DViewShading_type_update"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); prop = RNA_def_property(srna, "single_color", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "shading.single_color"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Color", "Color for single color mode"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_3DViewShading_type_update"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); prop = RNA_def_property(srna, "show_shadows", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_SHADING_SHADOW); + RNA_def_property_boolean_sdna(prop, NULL, "shading.flag", V3D_SHADING_SHADOW); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Shadow", "Show Shadow"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_3DViewShading_type_update"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); prop = RNA_def_property(srna, "ambient_light_intensity", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "ambient_intensity"); + RNA_def_property_float_sdna(prop, NULL, "shading.ambient_intensity"); RNA_def_property_float_default(prop, 0.5); RNA_def_property_ui_text(prop, "Ambient Light", "Intensity of ambient light for shadows"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_range(prop, 0.00f, 1.0f, 1, 3); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_3DViewShading_type_update"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); } static void rna_def_space_view3d_overlay(BlenderRNA *brna) @@ -2323,20 +2324,65 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna) "Show dashed lines indicating parent or constraint relationships"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); - RNA_def_struct_sdna(srna, "View3DOverlay"); + /* TODO: this should become a per object setting? */ + prop = RNA_def_property(srna, "show_backface_culling", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_BACKFACE_CULLING); + RNA_def_property_ui_text(prop, "Backface Culling", "Use back face culling to hide the back side of faces"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); prop = RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_OVERLAY_HIDE_CURSOR); + RNA_def_property_boolean_negative_sdna(prop, NULL, "overlay.flag", V3D_OVERLAY_HIDE_CURSOR); 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_face_orientation", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_OVERLAY_FACE_ORIENTATION); + RNA_def_property_boolean_sdna(prop, NULL, "overlay.flag", V3D_OVERLAY_FACE_ORIENTATION); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Face Orientation", "Show the Face Orientation Overlay"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_3DViewShading_type_update"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + prop = RNA_def_property(srna, "show_paint_wire", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "overlay.paint_flag", V3D_OVERLAY_PAINT_WIRE); + RNA_def_property_ui_text(prop, "Show Wire", "Use wireframe display in painting modes"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + + prop = RNA_def_property(srna, "show_occlude_wire", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "overlay.edit_flag", V3D_OVERLAY_EDIT_OCCLUDE_WIRE); + RNA_def_property_ui_text(prop, "Hidden Wire", "Use hidden wireframe display in edit mode"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + + prop = RNA_def_property(srna, "show_weight", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "overlay.edit_flag", V3D_OVERLAY_EDIT_WEIGHT); + RNA_def_property_ui_text(prop, "Show Weights", "Draw weights in editmode"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + prop = RNA_def_property(srna, "show_face_normals", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACE_NORMALS); + RNA_def_property_ui_text(prop, "Draw Normals", "Display face normals as lines"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + + prop = RNA_def_property(srna, "show_vertex_normals", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "overlay.edit_flag", V3D_OVERLAY_EDIT_VERT_NORMALS); + RNA_def_property_ui_text(prop, "Draw Vertex Normals", "Display vertex normals as lines"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + + prop = RNA_def_property(srna, "show_split_normals", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "overlay.edit_flag", V3D_OVERLAY_EDIT_LOOP_NORMALS); + RNA_def_property_ui_text(prop, "Draw Split Normals", "Display vertex-per-face normals as lines"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + + prop = RNA_def_property(srna, "normals_length", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "overlay.normals_length"); + RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view"); + RNA_def_property_range(prop, 0.00001, 1000.0); + RNA_def_property_ui_range(prop, 0.01, 10.0, 10.0, 2); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + + prop = RNA_def_property(srna, "backwire_opacity", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "overlay.backwire_opacity"); + RNA_def_property_ui_text(prop, "Backwire Opacity", "Opacity when rendering transparent wires"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); } static void rna_def_space_view3d(BlenderRNA *brna) @@ -2495,11 +2541,6 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Textured Solid", "Display face-assigned textures in solid view"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); - prop = RNA_def_property(srna, "show_backface_culling", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_BACKFACE_CULLING); - RNA_def_property_ui_text(prop, "Backface Culling", "Use back face culling to hide the back side of faces"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); - prop = RNA_def_property(srna, "show_mode_shade_override", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_MODE_SHADE_OVERRIDE); RNA_def_property_ui_text(prop, "Full Shading", "Use full shading for mode drawing (to view final result)"); |