From 7d0fcaa69a64eed8a37598213b120582f12fb437 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 28 Feb 2019 18:03:48 +0100 Subject: 'Fix' T61942: Triangulate modifier breaks custom normals. Not a bug, but supporting preservation of custom normals in that specific modifier makes sense, in game pipeline contexts. Could also ease work of IO add-ons that want to export triangulated geometry... --- source/blender/makesrna/intern/rna_modifier.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/makesrna/intern/rna_modifier.c') diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index ae22fbd5e54..31c78533151 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -4353,6 +4353,13 @@ static void rna_def_modifier_triangulate(BlenderRNA *brna) RNA_def_property_enum_items(prop, rna_enum_modifier_triangulate_ngon_method_items); RNA_def_property_ui_text(prop, "Polygon Method", "Method for splitting the polygons into triangles"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop = RNA_def_property(srna, "keep_custom_normals", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_TRIANGULATE_KEEP_CUSTOMLOOP_NORMALS); + RNA_def_property_ui_text(prop, "Keep Normals", + "Try to preserve custom normals (WARNING: depending on chosen triangulation method, " + "shading may not be fully preserved, 'Fixed' method usually gives the best result here)"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_meshcache(BlenderRNA *brna) -- cgit v1.2.3