Fix #82514: Default Value for Viewport Display Color's Alpha Wrong.
For now duplicate default diffuse color values into RNA code too. Sad work-around, but fixes the problem, until we get rid of hacks like 'interpret 4 consecutive floats in DNA as an array of 4 floats in RNA'.
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
/** \name Material Struct
|
||||
* \{ */
|
||||
|
||||
/* Keep RGBA diffuse defaults in sync with #rna_def_material_display in rna_material.cc */
|
||||
#define _DNA_DEFAULT_Material \
|
||||
{ \
|
||||
.r = 0.8, \
|
||||
|
||||
@@ -453,6 +453,10 @@ static void rna_def_material_display(StructRNA *srna)
|
||||
RNA_def_property_array(prop, 4);
|
||||
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
|
||||
RNA_def_property_ui_text(prop, "Diffuse Color", "Diffuse color of the material");
|
||||
/* See #82514 for details, for now re-define defaults here. Keep in sync with
|
||||
* #DNA_material_defaults.h */
|
||||
static float diffuse_color_default[4] = {0.8f, 0.8f, 0.8f, 1.0f};
|
||||
RNA_def_property_float_array_default(prop, diffuse_color_default);
|
||||
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
|
||||
|
||||
prop = RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
|
||||
|
||||
Reference in New Issue
Block a user