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:
authorClément Foucault <foucault.clem@gmail.com>2019-01-29 05:06:59 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-01-29 17:07:53 +0300
commitbc99f4903c5f55d35b5fec32d6e18400f25089fb (patch)
tree2fc65d8a39a7529d0cc885b26805ebc5c6e54f1e /source/blender/makesrna
parentd88492d4ad432a66d72269fe5fa514b18d0407ff (diff)
Workbench: Add transparency support for materials
This adds the posibility of having certain materials transparent in solid mode. The option is (for now) per material only and thus only shows in material color mode. This uses the same rendering technique as Xray mode. Note that objects are not considered transparent for selection with this.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_material.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index a5b02db6a28..b32d3aa9d78 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -384,6 +384,12 @@ static void rna_def_material_display(StructRNA *srna)
RNA_def_property_ui_text(prop, "Metallic", "Amount of mirror reflection for raytrace");
RNA_def_property_update(prop, 0, "rna_Material_update");
+ prop = RNA_def_property(srna, "transparency", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_sdna(prop, NULL, "transparency");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Transparency", "Amount of transparency in solid mode");
+ RNA_def_property_update(prop, 0, "rna_Material_draw_update");
+
/* Freestyle line color */
prop = RNA_def_property(srna, "line_color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "line_col");