From 81b6d308a771405ef326b1e4cebbc3359e830a6c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 30 Sep 2010 10:51:36 +0000 Subject: [#23673] Modifier construction gives correct result in viewport but incorrect in render. When there are 2+ consecutive deform modifiers, the second modifier was getting incorrect normals, this only showed up for the displace modifier since its the only deform modifier that uses vertex normals. It would have been easy to fix this by always calculating normals on deform modifiers, but slow. To fix this I added a function to check if a deform modifier needs normals, so the normal calculation function only runs if there are 2 modifiers in a row and the second uses normals. --- source/blender/modifiers/intern/MOD_subsurf.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/modifiers/intern/MOD_subsurf.c') diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c index 799df64b2b5..cd3657b9674 100644 --- a/source/blender/modifiers/intern/MOD_subsurf.c +++ b/source/blender/modifiers/intern/MOD_subsurf.c @@ -139,6 +139,7 @@ ModifierTypeInfo modifierType_Subsurf = { /* isDisabled */ isDisabled, /* updateDepgraph */ 0, /* dependsOnTime */ 0, + /* dependsOnNormals */ 0, /* foreachObjectLink */ 0, /* foreachIDLink */ 0, }; -- cgit v1.2.3 From fbf208d63fe0ba9770cb225726eb94888aa0994d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Oct 2010 06:29:17 +0000 Subject: add UNUSED() to modifiers, also removed some unused args. --- source/blender/modifiers/intern/MOD_subsurf.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source/blender/modifiers/intern/MOD_subsurf.c') diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c index cd3657b9674..3264717c97a 100644 --- a/source/blender/modifiers/intern/MOD_subsurf.c +++ b/source/blender/modifiers/intern/MOD_subsurf.c @@ -35,6 +35,7 @@ #include "DNA_scene_types.h" #include "DNA_object_types.h" +#include "BKE_utildefines.h" #include "BKE_cdderivedmesh.h" #include "BKE_scene.h" #include "BKE_subsurf.h" @@ -83,9 +84,10 @@ static int isDisabled(ModifierData *md, int useRenderParams) return get_render_subsurf_level(&md->scene->r, levels) == 0; } -static DerivedMesh *applyModifier( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - int useRenderParams, int isFinalCalc) +static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), + DerivedMesh *derivedData, + int useRenderParams, + int isFinalCalc) { SubsurfModifierData *smd = (SubsurfModifierData*) md; DerivedMesh *result; @@ -102,9 +104,9 @@ static DerivedMesh *applyModifier( return result; } -static DerivedMesh *applyModifierEM( - ModifierData *md, Object *ob, struct EditMesh *editData, - DerivedMesh *derivedData) +static DerivedMesh *applyModifierEM(ModifierData *md, Object *UNUSED(ob), + struct EditMesh *UNUSED(editData), + DerivedMesh *derivedData) { SubsurfModifierData *smd = (SubsurfModifierData*) md; DerivedMesh *result; -- cgit v1.2.3 From 8f21a43535cb200c0569566a1b012aec883aa53c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 7 Jan 2011 18:36:47 +0000 Subject: split BKE_utildefines.h, now it only has blender specific defines like GS() MAKE_ID, FILE_MAXDIR, moved the generic defines to BLI_utildefines.h. no functional changes. --- source/blender/modifiers/intern/MOD_subsurf.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/modifiers/intern/MOD_subsurf.c') diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c index 3264717c97a..94dc2273e70 100644 --- a/source/blender/modifiers/intern/MOD_subsurf.c +++ b/source/blender/modifiers/intern/MOD_subsurf.c @@ -35,6 +35,8 @@ #include "DNA_scene_types.h" #include "DNA_object_types.h" +#include "BLI_utildefines.h" + #include "BKE_utildefines.h" #include "BKE_cdderivedmesh.h" #include "BKE_scene.h" -- cgit v1.2.3 From 89c9aaaa25cc7ce60c305d8e30e1c008cb117cf1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 7 Jan 2011 19:18:31 +0000 Subject: remove references to BKE_utildefines where its not needed. - move GS() define into DNA_ID.h - add BLI_utildefines as an automatic include with makesrna generated files. --- source/blender/modifiers/intern/MOD_subsurf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/modifiers/intern/MOD_subsurf.c') diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c index 94dc2273e70..1238c891f33 100644 --- a/source/blender/modifiers/intern/MOD_subsurf.c +++ b/source/blender/modifiers/intern/MOD_subsurf.c @@ -37,7 +37,7 @@ #include "BLI_utildefines.h" -#include "BKE_utildefines.h" + #include "BKE_cdderivedmesh.h" #include "BKE_scene.h" #include "BKE_subsurf.h" -- cgit v1.2.3 From 329e2d8037050e06d16984924a412e8b32ad4351 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 31 Jan 2011 20:02:51 +0000 Subject: Todo issue: sculpting on deformed mesh Used a crazyspace approach (like in edit mode), but only modifiers with deformMatricies are allowed atm (currently shapekeys and armature modifiers only). All the rest modifiers had an warning message that they aren't applied because of sculpt mode. Deformation of multires is also unsupported. With all this restictions users will always see the actual "layer" (or maybe mesh state would be more correct word) they are sculpting on. Internal changes: - All modifiers could have deformMatricies callback (the same as deformMatriciesEM but for non-edit mode usage) - Added function to build crazyspace for sculpting (sculpt_get_deform_matrices), but it could be generalized for usage in other painting modes (particle edit mode, i.e) Todo: - Implement crazyspace correction to support all kinds of deformation modifiers - Maybe deformation of multires isn't so difficult? - And maybe we could avoid extra bad-level-stub for ED_sculpt_modifiers_changed without code duplicating? --- source/blender/modifiers/intern/MOD_subsurf.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/modifiers/intern/MOD_subsurf.c') diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c index 1238c891f33..4ba139305d8 100644 --- a/source/blender/modifiers/intern/MOD_subsurf.c +++ b/source/blender/modifiers/intern/MOD_subsurf.c @@ -133,6 +133,7 @@ ModifierTypeInfo modifierType_Subsurf = { /* copyData */ copyData, /* deformVerts */ 0, + /* deformMatrices */ 0, /* deformVertsEM */ 0, /* deformMatricesEM */ 0, /* applyModifier */ applyModifier, -- cgit v1.2.3 From caa7bea1c591277556b5cf3a076e90f1804a84f6 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Fri, 25 Feb 2011 13:57:17 +0000 Subject: doxygendoxygen: blender/modifiers tagged. --- source/blender/modifiers/intern/MOD_subsurf.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/modifiers/intern/MOD_subsurf.c') diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c index 4ba139305d8..823cc03cff2 100644 --- a/source/blender/modifiers/intern/MOD_subsurf.c +++ b/source/blender/modifiers/intern/MOD_subsurf.c @@ -30,6 +30,11 @@ * */ +/** \file blender/modifiers/intern/MOD_subsurf.c + * \ingroup modifiers + */ + + #include "stddef.h" #include "DNA_scene_types.h" -- cgit v1.2.3