Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenkernel/intern/object.c2
-rw-r--r--source/blender/blenloader/intern/versioning_280.c7
-rw-r--r--source/blender/draw/engines/workbench/workbench_deferred.c2
-rw-r--r--source/blender/makesdna/DNA_object_types.h16
-rw-r--r--source/blender/makesrna/intern/rna_object.c13
5 files changed, 13 insertions, 27 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index c1af6037e05..3d6cc05986b 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -866,8 +866,6 @@ void BKE_object_init(Object *ob)
/* Animation Visualization defaults */
animviz_settings_init(&ob->avs);
-
- ob->display.flag = OB_SHOW_SHADOW;
}
/* more general add: creates minimum required data, but without vertices etc. */
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 5e0eb849341..914b91d3eb0 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1360,13 +1360,6 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
- if (!DNA_struct_elem_find(fd->filesdna, "Object", "ObjectDisplay", "display")) {
- /* Initialize new object.ObjectDisplay */
- for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
- ob->display.flag = OB_SHOW_SHADOW;
- }
- }
-
if (!DNA_struct_elem_find(fd->filesdna, "ToolSettings", "char", "transform_pivot_point")) {
for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
scene->toolsettings->transform_pivot_point = V3D_AROUND_CENTER_MEDIAN;
diff --git a/source/blender/draw/engines/workbench/workbench_deferred.c b/source/blender/draw/engines/workbench/workbench_deferred.c
index fccb264525e..258a33bbda4 100644
--- a/source/blender/draw/engines/workbench/workbench_deferred.c
+++ b/source/blender/draw/engines/workbench/workbench_deferred.c
@@ -987,7 +987,7 @@ void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob)
}
}
- if (SHADOW_ENABLED(wpd) && (ob->display.flag & OB_SHOW_SHADOW)) {
+ if (SHADOW_ENABLED(wpd) && !(ob->dtx & OB_DRAW_NO_SHADOW_CAST)) {
bool is_manifold;
struct GPUBatch *geom_shadow = DRW_cache_object_edge_detection_get(ob, &is_manifold);
if (geom_shadow) {
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index d91fcac49c1..f951b7273c9 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -114,10 +114,6 @@ typedef struct LodLevel {
int obhysteresis;
} LodLevel;
-typedef struct ObjectDisplay {
- int flag;
-} ObjectDisplay;
-
/* Forward declaration for cache bbone deformation information.
*
* TODO(sergey): Consider moving it to more appropriate place. */
@@ -380,12 +376,8 @@ typedef struct Object {
int pad6;
int select_color;
- /* Runtime evaluation data. */
+ /* Runtime evaluation data (keep last). */
Object_Runtime runtime;
-
- /* Object Display */
- struct ObjectDisplay display;
- int pad9;
} Object;
/* Warning, this is not used anymore because hooks are now modifiers */
@@ -444,11 +436,6 @@ enum {
OB_TYPE_MAX,
};
-/* ObjectDisplay.flag */
-enum {
- OB_SHOW_SHADOW = (1 << 0),
-};
-
/* check if the object type supports materials */
#define OB_TYPE_SUPPORT_MATERIAL(_type) \
(((_type) >= OB_MESH && (_type) <= OB_MBALL) || ((_type) == OB_GPENCIL))
@@ -545,6 +532,7 @@ enum {
/* enable transparent draw */
OB_DRAWTRANSP = 1 << 7,
OB_DRAW_ALL_EDGES = 1 << 8, /* only for meshes currently */
+ OB_DRAW_NO_SHADOW_CAST = 1 << 9,
};
/* empty_drawtype: no flags */
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 74237f58861..01d4b543f74 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -1097,6 +1097,11 @@ static char *rna_MaterialSlot_path(PointerRNA *ptr)
return BLI_sprintfN("material_slots[%d]", index);
}
+static PointerRNA rna_Object_display_get(PointerRNA *ptr)
+{
+ return rna_pointer_inherit_refine(ptr, &RNA_ObjectDisplay, ptr->data);
+}
+
static char *rna_ObjectDisplay_path(PointerRNA *UNUSED(ptr))
{
return BLI_strdup("display");
@@ -2073,11 +2078,12 @@ static void rna_def_object_display(BlenderRNA *brna)
srna = RNA_def_struct(brna, "ObjectDisplay", NULL);
RNA_def_struct_ui_text(srna, "Object Display", "Object display settings for 3d viewport");
- RNA_def_struct_sdna(srna, "ObjectDisplay");
+ RNA_def_struct_sdna(srna, "Object");
+ RNA_def_struct_nested(brna, srna, "Object");
RNA_def_struct_path_func(srna, "rna_ObjectDisplay_path");
prop = RNA_def_property(srna, "show_shadows", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_SHOW_SHADOW);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "dtx", OB_DRAW_NO_SHADOW_CAST);
RNA_def_property_boolean_default(prop, true);
RNA_def_property_ui_text(prop, "Shadow", "Object cast shadows in the 3d viewport");
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
@@ -2753,8 +2759,9 @@ static void rna_def_object(BlenderRNA *brna)
/* Object Display */
prop = RNA_def_property(srna, "display", PROP_POINTER, PROP_NONE);
- RNA_def_property_pointer_sdna(prop, NULL, "display");
+ RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_struct_type(prop, "ObjectDisplay");
+ RNA_def_property_pointer_funcs(prop, "rna_Object_display_get", NULL, NULL, NULL);
RNA_def_property_ui_text(prop, "Object Display", "Object display settings for 3d viewport");
RNA_api_object(srna);