Revision: 14357
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14357
Author:   genscher
Date:     2008-04-08 14:58:25 +0200 (Tue, 08 Apr 2008)

Log Message:
-----------
Sorry, reverting bad things in modifier.c

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/modifier.c

Modified: trunk/blender/source/blender/blenkernel/intern/modifier.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/modifier.c   2008-04-08 
12:55:35 UTC (rev 14356)
+++ trunk/blender/source/blender/blenkernel/intern/modifier.c   2008-04-08 
12:58:25 UTC (rev 14357)
@@ -58,7 +58,6 @@
 #include "DNA_material_types.h"
 #include "DNA_mesh_types.h"
 #include "DNA_meshdata_types.h"
-#include "DNA_sph_types.h"
 #include "DNA_modifier_types.h"
 #include "DNA_object_types.h"
 #include "DNA_object_force.h"
@@ -91,7 +90,6 @@
 #include "BKE_object.h"
 #include "BKE_mesh.h"
 #include "BKE_softbody.h"
-#include "BKE_sph.h"
 #include "BKE_cloth.h"
 #include "BKE_material.h"
 #include "BKE_particle.h"
@@ -152,9 +150,9 @@
 }
 
 static void curveModifier_foreachObjectLink(
-                ModifierData *md, Object *ob,
-                void (*walk)(void *userData, Object *ob, Object **obpoin),
-                void *userData)
+                                           ModifierData *md, Object *ob,
+        void (*walk)(void *userData, Object *ob, Object **obpoin),
+               void *userData)
 {
        CurveModifierData *cmd = (CurveModifierData*) md;
 
@@ -162,8 +160,8 @@
 }
 
 static void curveModifier_updateDepgraph(
-                ModifierData *md, DagForest *forest,
-                Object *ob, DagNode *obNode)
+                                        ModifierData *md, DagForest *forest,
+      Object *ob, DagNode *obNode)
 {
        CurveModifierData *cmd = (CurveModifierData*) md;
 
@@ -171,23 +169,23 @@
                DagNode *curNode = dag_get_node(forest, cmd->object);
 
                dag_add_relation(forest, curNode, obNode,
-                                DAG_RL_DATA_DATA | DAG_RL_OB_DATA);
+                                DAG_RL_DATA_DATA | DAG_RL_OB_DATA);
        }
 }
 
 static void curveModifier_deformVerts(
-                ModifierData *md, Object *ob, DerivedMesh *derivedData,
-                float (*vertexCos)[3], int numVerts)
+                                     ModifierData *md, Object *ob, DerivedMesh 
*derivedData,
+         float (*vertexCos)[3], int numVerts)
 {
        CurveModifierData *cmd = (CurveModifierData*) md;
 
        curve_deform_verts(cmd->object, ob, derivedData, vertexCos, numVerts,
-                          cmd->name, cmd->defaxis);
+                          cmd->name, cmd->defaxis);
 }
 
 static void curveModifier_deformVertsEM(
-                ModifierData *md, Object *ob, EditMesh *editData,
-                DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
+                                       ModifierData *md, Object *ob, EditMesh 
*editData,
+     DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
 {
        DerivedMesh *dm = derivedData;
 
@@ -228,9 +226,9 @@
 }
 
 static void latticeModifier_foreachObjectLink(
-                   ModifierData *md, Object *ob,
-                   void (*walk)(void *userData, Object *ob, Object **obpoin),
-                   void *userData)
+                                             ModifierData *md, Object *ob,
+          void (*walk)(void *userData, Object *ob, Object **obpoin),
+                 void *userData)
 {
        LatticeModifierData *lmd = (LatticeModifierData*) md;
 
@@ -238,7 +236,7 @@
 }
 
 static void latticeModifier_updateDepgraph(ModifierData *md, DagForest *forest,
-                                           Object *ob, DagNode *obNode)
+                                          Object *ob, DagNode *obNode)
 {
        LatticeModifierData *lmd = (LatticeModifierData*) md;
 
@@ -246,7 +244,7 @@
                DagNode *latNode = dag_get_node(forest, lmd->object);
 
                dag_add_relation(forest, latNode, obNode,
-                                DAG_RL_DATA_DATA | DAG_RL_OB_DATA);
+                                DAG_RL_DATA_DATA | DAG_RL_OB_DATA);
        }
 }
 
@@ -265,8 +263,8 @@
 
 
 static void latticeModifier_deformVerts(
-                ModifierData *md, Object *ob, DerivedMesh *derivedData,
-                float (*vertexCos)[3], int numVerts)
+                                       ModifierData *md, Object *ob, 
DerivedMesh *derivedData,
+     float (*vertexCos)[3], int numVerts)
 {
        LatticeModifierData *lmd = (LatticeModifierData*) md;
 
@@ -274,12 +272,12 @@
        modifier_vgroup_cache(md, vertexCos); /* if next modifier needs 
original vertices */
        
        lattice_deform_verts(lmd->object, ob, derivedData,
-                            vertexCos, numVerts, lmd->name);
+                            vertexCos, numVerts, lmd->name);
 }
 
 static void latticeModifier_deformVertsEM(
-                ModifierData *md, Object *ob, EditMesh *editData,
-                DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
+                                         ModifierData *md, Object *ob, 
EditMesh *editData,
+       DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
 {
        DerivedMesh *dm = derivedData;
 
@@ -325,28 +323,28 @@
 }
 
 static DerivedMesh *subsurfModifier_applyModifier(
-                 ModifierData *md, Object *ob, DerivedMesh *derivedData,
-                 int useRenderParams, int isFinalCalc)
+               ModifierData *md, Object *ob, DerivedMesh *derivedData,
+  int useRenderParams, int isFinalCalc)
 {
        SubsurfModifierData *smd = (SubsurfModifierData*) md;
        DerivedMesh *result;
 
        result = subsurf_make_derived_from_derived(derivedData, smd,
-                                                  useRenderParams, NULL,
-                                                  isFinalCalc, 0);
+                       useRenderParams, NULL,
+   isFinalCalc, 0);
 
        return result;
 }
 
 static DerivedMesh *subsurfModifier_applyModifierEM(
-                 ModifierData *md, Object *ob, EditMesh *editData,
-                 DerivedMesh *derivedData)
+               ModifierData *md, Object *ob, EditMesh *editData,
+  DerivedMesh *derivedData)
 {
        SubsurfModifierData *smd = (SubsurfModifierData*) md;
        DerivedMesh *result;
 
        result = subsurf_make_derived_from_derived(derivedData, smd, 0,
-                                                  NULL, 0, 1);
+                       NULL, 0, 1);
 
        return result;
 }
@@ -378,8 +376,8 @@
 }
 
 static DerivedMesh *buildModifier_applyModifier(ModifierData *md, Object *ob,
-                                         DerivedMesh *derivedData,
-                                         int useRenderParams, int isFinalCalc)
+               DerivedMesh *derivedData,
+  int useRenderParams, int isFinalCalc)
 {
        DerivedMesh *dm = derivedData;
        DerivedMesh *result;
@@ -392,29 +390,29 @@
        GHashIterator *hashIter;
        /* maps vert indices in old mesh to indices in new mesh */
        GHash *vertHash = BLI_ghash_new(BLI_ghashutil_inthash,
-                                                                       
BLI_ghashutil_intcmp);
+                                       BLI_ghashutil_intcmp);
        /* maps edge indices in new mesh to indices in old mesh */
        GHash *edgeHash = BLI_ghash_new(BLI_ghashutil_inthash,
-                                                                       
BLI_ghashutil_intcmp);
+                                       BLI_ghashutil_intcmp);
 
        maxVerts = dm->getNumVerts(dm);
        vertMap = MEM_callocN(sizeof(*vertMap) * maxVerts,
-                             "build modifier vertMap");
+                             "build modifier vertMap");
        for(i = 0; i < maxVerts; ++i) vertMap[i] = i;
 
        maxEdges = dm->getNumEdges(dm);
        edgeMap = MEM_callocN(sizeof(*edgeMap) * maxEdges,
-                             "build modifier edgeMap");
+                             "build modifier edgeMap");
        for(i = 0; i < maxEdges; ++i) edgeMap[i] = i;
 
        maxFaces = dm->getNumFaces(dm);
        faceMap = MEM_callocN(sizeof(*faceMap) * maxFaces,
-                             "build modifier faceMap");
+                             "build modifier faceMap");
        for(i = 0; i < maxFaces; ++i) faceMap[i] = i;
 
        if (ob) {
                frac = bsystem_time(ob, (float)G.scene->r.cfra,
-                                   bmd->start - 1.0f) / bmd->length;
+                                   bmd->start - 1.0f) / bmd->length;
        } else {
                frac = G.scene->r.cfra - bmd->start / bmd->length;
        }
@@ -429,157 +427,157 @@
 
                if(bmd->randomize)
                        BLI_array_randomize(faceMap, sizeof(*faceMap),
-                                           maxFaces, bmd->seed);
+                                           maxFaces, bmd->seed);
 
                /* get the set of all vert indices that will be in the final 
mesh,
-                * mapped to the new indices
-                */
+               * mapped to the new indices
+               */
                for(i = 0; i < numFaces; ++i) {
                        MFace mf;
                        dm->getFace(dm, faceMap[i], &mf);
 
                        if(!BLI_ghash_haskey(vertHash, 
SET_INT_IN_POINTER(mf.v1)))
                                BLI_ghash_insert(vertHash, 
SET_INT_IN_POINTER(mf.v1),
-                                                
SET_INT_IN_POINTER(BLI_ghash_size(vertHash)));
+                                       
SET_INT_IN_POINTER(BLI_ghash_size(vertHash)));
                        if(!BLI_ghash_haskey(vertHash, 
SET_INT_IN_POINTER(mf.v2)))
                                BLI_ghash_insert(vertHash, 
SET_INT_IN_POINTER(mf.v2),
-                                                
SET_INT_IN_POINTER(BLI_ghash_size(vertHash)));
+                                       
SET_INT_IN_POINTER(BLI_ghash_size(vertHash)));
                        if(!BLI_ghash_haskey(vertHash, 
SET_INT_IN_POINTER(mf.v3)))
                                BLI_ghash_insert(vertHash, 
SET_INT_IN_POINTER(mf.v3),
-                                                
SET_INT_IN_POINTER(BLI_ghash_size(vertHash)));
+                                       
SET_INT_IN_POINTER(BLI_ghash_size(vertHash)));
                        if(mf.v4 && !BLI_ghash_haskey(vertHash, 
SET_INT_IN_POINTER(mf.v4)))
                                BLI_ghash_insert(vertHash, 
SET_INT_IN_POINTER(mf.v4),
-                                                
SET_INT_IN_POINTER(BLI_ghash_size(vertHash)));
+                                       
SET_INT_IN_POINTER(BLI_ghash_size(vertHash)));
                }
 
                /* get the set of edges that will be in the new mesh (i.e. all 
edges
-                * that have both verts in the new mesh)
-                */
+               * that have both verts in the new mesh)
+               */
                maxEdges = dm->getNumEdges(dm);
                for(i = 0; i < maxEdges; ++i) {
                        MEdge me;
                        dm->getEdge(dm, i, &me);
 
                        if(BLI_ghash_haskey(vertHash, SET_INT_IN_POINTER(me.v1))
-                          && BLI_ghash_haskey(vertHash, 
SET_INT_IN_POINTER(me.v2)))
+                                               && BLI_ghash_haskey(vertHash, 
SET_INT_IN_POINTER(me.v2)))
                                BLI_ghash_insert(edgeHash,
-                                                
SET_INT_IN_POINTER(BLI_ghash_size(edgeHash)), SET_INT_IN_POINTER(i));
+                                       
SET_INT_IN_POINTER(BLI_ghash_size(edgeHash)), SET_INT_IN_POINTER(i));
                }
        } else if(numEdges) {
                if(bmd->randomize)
                        BLI_array_randomize(edgeMap, sizeof(*edgeMap),
-                                           maxEdges, bmd->seed);
+                                           maxEdges, bmd->seed);
 
                /* get the set of all vert indices that will be in the final 
mesh,
-                * mapped to the new indices
-                */
+               * mapped to the new indices
+               */
                for(i = 0; i < numEdges; ++i) {
                        MEdge me;
                        dm->getEdge(dm, edgeMap[i], &me);
 
                        if(!BLI_ghash_haskey(vertHash, 
SET_INT_IN_POINTER(me.v1)))
                                BLI_ghash_insert(vertHash, 
SET_INT_IN_POINTER(me.v1),
-                                                
SET_INT_IN_POINTER(BLI_ghash_size(vertHash)));
+                                       
SET_INT_IN_POINTER(BLI_ghash_size(vertHash)));
                        if(!BLI_ghash_haskey(vertHash, 
SET_INT_IN_POINTER(me.v2)))
                                BLI_ghash_insert(vertHash, 
SET_INT_IN_POINTER(me.v2),
-                                                
SET_INT_IN_POINTER(BLI_ghash_size(vertHash)));
+                                       
SET_INT_IN_POINTER(BLI_ghash_size(vertHash)));
                }
 
                /* get the set of edges that will be in the new mesh
-                */
+               */
                for(i = 0; i < numEdges; ++i) {
                        MEdge me;
                        dm->getEdge(dm, edgeMap[i], &me);
 

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to