[Bf-blender-cvs] [9ce645e] master: Better fix for T42054 - modifiers have a callback to say whether they need normals or no.

Bastien Montagne noreply at git.blender.org
Fri Oct 3 12:13:22 CEST 2014


Commit: 9ce645e7d9697162f577f433844da7771cbea9a6
Author: Bastien Montagne
Date:   Fri Oct 3 12:12:10 2014 +0200
Branches: master
https://developer.blender.org/rB9ce645e7d9697162f577f433844da7771cbea9a6

Better fix for T42054 - modifiers have a callback to say whether they need normals or no.

Thanks Campbell for the headup!

===================================================================

M	source/blender/modifiers/intern/MOD_wireframe.c

===================================================================

diff --git a/source/blender/modifiers/intern/MOD_wireframe.c b/source/blender/modifiers/intern/MOD_wireframe.c
index 108eee1..7349ca9 100644
--- a/source/blender/modifiers/intern/MOD_wireframe.c
+++ b/source/blender/modifiers/intern/MOD_wireframe.c
@@ -60,7 +60,7 @@ static void copyData(ModifierData *md, ModifierData *target)
 
 static bool isDisabled(ModifierData *UNUSED(md), int UNUSED(useRenderParams))
 {
-	return 0;
+	return false;
 }
 
 static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
@@ -75,6 +75,11 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
 
 }
 
+static bool dependsOnNormals(ModifierData *UNUSED(md))
+{
+	return true;
+}
+
 static DerivedMesh *WireframeModifier_do( WireframeModifierData *wmd, Object *ob, DerivedMesh *dm)
 {
 	DerivedMesh *result;
@@ -82,8 +87,6 @@ static DerivedMesh *WireframeModifier_do( WireframeModifierData *wmd, Object *ob
 
 	const int defgrp_index = defgroup_name_index(ob, wmd->defgrp_name);
 
-	DM_ensure_normals(dm);
-
 	bm = DM_to_bmesh(dm, true);
 
 	BM_mesh_wireframe(
@@ -137,7 +140,7 @@ ModifierTypeInfo modifierType_Wireframe = {
 	/* isDisabled */        isDisabled,
 	/* updateDepgraph */    NULL,
 	/* dependsOnTime */     NULL,
-	/* dependsOnNormals */	NULL,
+	/* dependsOnNormals */  dependsOnNormals,
 	/* foreachObjectLink */ NULL,
 	/* foreachIDLink */     NULL,
 	/* foreachTexLink */    NULL,




More information about the Bf-blender-cvs mailing list