diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-06-29 17:41:00 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-06-29 18:18:11 +0300 |
commit | d140e70c496122915eb5c05aba83153e2e0d7998 (patch) | |
tree | 1e589247d69da64aa7b0e7802319237ec050b5d6 /source/blender/modifiers/intern/MOD_screw.c | |
parent | 147bd16ed1bb3415b30408b0eab110d0854eadd2 (diff) | |
parent | 295d0c52a26730edc6d4ed1276e4051cce006be5 (diff) |
Merge branch 'master' into temp-ghash-experimentstemp-ghash-experiments
Note that 'store hash' feature was removed for now - to complex to maintain (conflicts)
and relatively easy to re-add if we ever really want this one day.
Conflicts:
source/blender/blenlib/BLI_ghash.h
source/blender/blenlib/intern/BLI_ghash.c
source/blender/blenlib/intern/hash_mm2a.c
source/blender/bmesh/tools/bmesh_region_match.c
tests/gtests/blenlib/BLI_ghash_performance_test.cc
tests/gtests/blenlib/BLI_ghash_test.cc
tests/gtests/blenlib/CMakeLists.txt
Diffstat (limited to 'source/blender/modifiers/intern/MOD_screw.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_screw.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c index 2c9f5e32440..2e431884845 100644 --- a/source/blender/modifiers/intern/MOD_screw.c +++ b/source/blender/modifiers/intern/MOD_screw.c @@ -46,6 +46,8 @@ #include "BKE_cdderivedmesh.h" #include "depsgraph_private.h" +#include "DEG_depsgraph_build.h" + #include "MOD_modifiertypes.h" #include "MEM_guardedalloc.h" @@ -138,15 +140,15 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm = derivedData; DerivedMesh *result; ScrewModifierData *ltmd = (ScrewModifierData *) md; - const int useRenderParams = flag & MOD_APPLY_RENDER; + const bool use_render_params = (flag & MOD_APPLY_RENDER) != 0; int *origindex; int mpoly_index = 0; unsigned int step; unsigned int i, j; unsigned int i1, i2; - unsigned int step_tot = useRenderParams ? ltmd->render_steps : ltmd->steps; - const bool do_flip = ltmd->flag & MOD_SCREW_NORMAL_FLIP ? 1 : 0; + unsigned int step_tot = use_render_params ? ltmd->render_steps : ltmd->steps; + const bool do_flip = (ltmd->flag & MOD_SCREW_NORMAL_FLIP) != 0; const int quad_ord[4] = { do_flip ? 3 : 0, @@ -156,9 +158,9 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, }; const int quad_ord_ofs[4] = { do_flip ? 2 : 0, - do_flip ? 1 : 1, + 1, do_flip ? 0 : 2, - do_flip ? 3 : 3, + 3, }; unsigned int maxVerts = 0, maxEdges = 0, maxPolys = 0; @@ -1074,6 +1076,18 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, } } +static void updateDepsgraph(ModifierData *md, + struct Main *UNUSED(bmain), + struct Scene *UNUSED(scene), + Object *UNUSED(ob), + struct DepsNodeHandle *node) +{ + ScrewModifierData *ltmd = (ScrewModifierData *)md; + if (ltmd->ob_axis != NULL) { + DEG_add_object_relation(node, ltmd->ob_axis, DEG_OB_COMP_TRANSFORM, "Screw Modifier"); + } +} + static void foreachObjectLink( ModifierData *md, Object *ob, void (*walk)(void *userData, Object *ob, Object **obpoin), @@ -1107,6 +1121,7 @@ ModifierTypeInfo modifierType_Screw = { /* freeData */ NULL, /* isDisabled */ NULL, /* updateDepgraph */ updateDepgraph, + /* updateDepsgraph */ updateDepsgraph, /* dependsOnTime */ NULL, /* dependsOnNormals */ NULL, /* foreachObjectLink */ foreachObjectLink, |