[Bf-blender-cvs] [db822888ef2] fluid-mantaflow: Mantaflow: Renamed variables to match new struct names

Sebastián Barschkis noreply at git.blender.org
Tue Oct 8 16:37:08 CEST 2019


Commit: db822888ef256a5bec11bce454459db0afdfec18
Author: Sebastián Barschkis
Date:   Tue Oct 8 16:36:56 2019 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rBdb822888ef256a5bec11bce454459db0afdfec18

Mantaflow: Renamed variables to match new struct names

Variable names were referring to SmokeFlowSettings and SmokeCollisionSettings which have been renamed to Manta...

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

M	source/blender/blenkernel/intern/manta.c

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

diff --git a/source/blender/blenkernel/intern/manta.c b/source/blender/blenkernel/intern/manta.c
index f72ab70ff19..3bfabbc9469 100644
--- a/source/blender/blenkernel/intern/manta.c
+++ b/source/blender/blenkernel/intern/manta.c
@@ -836,52 +836,52 @@ void mantaModifier_copy(const struct MantaModifierData *mmd,
     tmds->data_depth = mds->data_depth;
   }
   else if (tmmd->flow) {
-    MantaFlowSettings *tsfs = tmmd->flow;
-    MantaFlowSettings *sfs = mmd->flow;
+    MantaFlowSettings *tmfs = tmmd->flow;
+    MantaFlowSettings *mfs = mmd->flow;
 
-    tsfs->psys = sfs->psys;
-    tsfs->noise_texture = sfs->noise_texture;
+    tmfs->psys = mfs->psys;
+    tmfs->noise_texture = mfs->noise_texture;
 
     /* initial velocity */
-    tsfs->vel_multi = sfs->vel_multi;
-    tsfs->vel_normal = sfs->vel_normal;
-    tsfs->vel_random = sfs->vel_random;
-    tsfs->vel_coord[0] = sfs->vel_coord[0];
-    tsfs->vel_coord[1] = sfs->vel_coord[1];
-    tsfs->vel_coord[2] = sfs->vel_coord[2];
+    tmfs->vel_multi = mfs->vel_multi;
+    tmfs->vel_normal = mfs->vel_normal;
+    tmfs->vel_random = mfs->vel_random;
+    tmfs->vel_coord[0] = mfs->vel_coord[0];
+    tmfs->vel_coord[1] = mfs->vel_coord[1];
+    tmfs->vel_coord[2] = mfs->vel_coord[2];
 
     /* emission */
-    tsfs->density = sfs->density;
-    copy_v3_v3(tsfs->color, sfs->color);
-    tsfs->fuel_amount = sfs->fuel_amount;
-    tsfs->temp = sfs->temp;
-    tsfs->volume_density = sfs->volume_density;
-    tsfs->surface_distance = sfs->surface_distance;
-    tsfs->particle_size = sfs->particle_size;
-    tsfs->subframes = sfs->subframes;
+    tmfs->density = mfs->density;
+    copy_v3_v3(tmfs->color, mfs->color);
+    tmfs->fuel_amount = mfs->fuel_amount;
+    tmfs->temp = mfs->temp;
+    tmfs->volume_density = mfs->volume_density;
+    tmfs->surface_distance = mfs->surface_distance;
+    tmfs->particle_size = mfs->particle_size;
+    tmfs->subframes = mfs->subframes;
 
     /* texture control */
-    tsfs->texture_size = sfs->texture_size;
-    tsfs->texture_offset = sfs->texture_offset;
-    BLI_strncpy(tsfs->uvlayer_name, sfs->uvlayer_name, sizeof(tsfs->uvlayer_name));
-    tsfs->vgroup_density = sfs->vgroup_density;
-
-    tsfs->type = sfs->type;
-    tsfs->behavior = sfs->behavior;
-    tsfs->source = sfs->source;
-    tsfs->texture_type = sfs->texture_type;
-    tsfs->flags = sfs->flags;
+    tmfs->texture_size = mfs->texture_size;
+    tmfs->texture_offset = mfs->texture_offset;
+    BLI_strncpy(tmfs->uvlayer_name, mfs->uvlayer_name, sizeof(tmfs->uvlayer_name));
+    tmfs->vgroup_density = mfs->vgroup_density;
+
+    tmfs->type = mfs->type;
+    tmfs->behavior = mfs->behavior;
+    tmfs->source = mfs->source;
+    tmfs->texture_type = mfs->texture_type;
+    tmfs->flags = mfs->flags;
   }
   else if (tmmd->effec) {
-    MantaCollSettings *tscs = tmmd->effec;
-    MantaCollSettings *scs = mmd->effec;
+    MantaCollSettings *tmcs = tmmd->effec;
+    MantaCollSettings *mcs = mmd->effec;
 
-    tscs->surface_distance = scs->surface_distance;
-    tscs->type = scs->type;
+    tmcs->surface_distance = mcs->surface_distance;
+    tmcs->type = mcs->type;
 
     /* guiding options */
-    tscs->guiding_mode = scs->guiding_mode;
-    tscs->vel_multi = scs->vel_multi;
+    tmcs->guiding_mode = mcs->guiding_mode;
+    tmcs->vel_multi = mcs->vel_multi;
   }
 }
 
@@ -925,7 +925,7 @@ static int get_light(ViewLayer *view_layer, float *light)
 
 typedef struct ObstaclesFromDMData {
   MantaDomainSettings *mds;
-  MantaCollSettings *scs;
+  MantaCollSettings *mcs;
   const MVert *mvert;
   const MLoop *mloop;
   const MLoopTri *looptri;
@@ -990,10 +990,10 @@ static void obstacles_from_mesh_task_cb(void *__restrict userdata,
                            weights);
 
           /* Guiding has additional velocity multiplier */
-          if (data->scs->type == FLUID_EFFECTOR_TYPE_GUIDE) {
-            mul_v3_fl(hit_vel, data->scs->vel_multi);
+          if (data->mcs->type == FLUID_EFFECTOR_TYPE_GUIDE) {
+            mul_v3_fl(hit_vel, data->mcs->vel_multi);
 
-            switch (data->scs->guiding_mode) {
+            switch (data->mcs->guiding_mode) {
               case FLUID_EFFECTOR_GUIDING_AVERAGED:
                 data->velocityX[index] = (data->velocityX[index] + hit_vel[0]) * 0.5f;
                 data->velocityY[index] = (data->velocityY[index] + hit_vel[1]) * 0.5f;
@@ -1019,14 +1019,14 @@ static void obstacles_from_mesh_task_cb(void *__restrict userdata,
           }
           else {
             /* Apply (i.e. add) effector object velocity */
-            data->velocityX[index] += (data->scs->type == FLUID_EFFECTOR_TYPE_GUIDE) ?
-                                          hit_vel[0] * data->scs->vel_multi :
+            data->velocityX[index] += (data->mcs->type == FLUID_EFFECTOR_TYPE_GUIDE) ?
+                                          hit_vel[0] * data->mcs->vel_multi :
                                           hit_vel[0];
-            data->velocityY[index] += (data->scs->type == FLUID_EFFECTOR_TYPE_GUIDE) ?
-                                          hit_vel[1] * data->scs->vel_multi :
+            data->velocityY[index] += (data->mcs->type == FLUID_EFFECTOR_TYPE_GUIDE) ?
+                                          hit_vel[1] * data->mcs->vel_multi :
                                           hit_vel[1];
-            data->velocityZ[index] += (data->scs->type == FLUID_EFFECTOR_TYPE_GUIDE) ?
-                                          hit_vel[2] * data->scs->vel_multi :
+            data->velocityZ[index] += (data->mcs->type == FLUID_EFFECTOR_TYPE_GUIDE) ?
+                                          hit_vel[2] * data->mcs->vel_multi :
                                           hit_vel[2];
             //printf("adding effector object vel: [%f, %f, %f], dx is: %f\n", hit_vel[0], hit_vel[1], hit_vel[2], mds->dx);
           }
@@ -1036,7 +1036,7 @@ static void obstacles_from_mesh_task_cb(void *__restrict userdata,
       /* Get distance to mesh surface from both within and outside grid (mantaflow phi grid) */
       if (data->distances_map) {
         update_mesh_distances(
-            index, data->distances_map, data->tree, ray_start, data->scs->surface_distance);
+            index, data->distances_map, data->tree, ray_start, data->mcs->surface_distance);
 
         /* Ensure that num objects are also counted inside object. But dont count twice (see object inc for nearest point) */
         if (data->distances_map[index] < 0 && !hasIncObj) {
@@ -1049,7 +1049,7 @@ static void obstacles_from_mesh_task_cb(void *__restrict userdata,
 
 static void obstacles_from_mesh(Object *coll_ob,
                                 MantaDomainSettings *mds,
-                                MantaCollSettings *scs,
+                                MantaCollSettings *mcs,
                                 float *distances_map,
                                 float *velocityX,
                                 float *velocityY,
@@ -1057,7 +1057,7 @@ static void obstacles_from_mesh(Object *coll_ob,
                                 int *num_objects,
                                 float dt)
 {
-  if (!scs->mesh) {
+  if (!mcs->mesh) {
     return;
   }
   {
@@ -1071,7 +1071,7 @@ static void obstacles_from_mesh(Object *coll_ob,
     float *vert_vel = NULL;
     bool has_velocity = false;
 
-    me = BKE_mesh_copy_for_eval(scs->mesh, true);
+    me = BKE_mesh_copy_for_eval(mcs->mesh, true);
 
     /* Duplicate vertices to modify. */
     if (me->mvert) {
@@ -1091,13 +1091,13 @@ static void obstacles_from_mesh(Object *coll_ob,
     {
       vert_vel = MEM_callocN(sizeof(float) * numverts * 3, "manta_obs_velocity");
 
-      if (scs->numverts != numverts || !scs->verts_old) {
-        if (scs->verts_old) {
-          MEM_freeN(scs->verts_old);
+      if (mcs->numverts != numverts || !mcs->verts_old) {
+        if (mcs->verts_old) {
+          MEM_freeN(mcs->verts_old);
         }
 
-        scs->verts_old = MEM_callocN(sizeof(float) * numverts * 3, "manta_obs_verts_old");
-        scs->numverts = numverts;
+        mcs->verts_old = MEM_callocN(sizeof(float) * numverts * 3, "manta_obs_verts_old");
+        mcs->numverts = numverts;
       }
       else {
         has_velocity = true;
@@ -1124,15 +1124,15 @@ static void obstacles_from_mesh(Object *coll_ob,
       /* vert velocity */
       add_v3fl_v3fl_v3i(co, mvert[i].co, mds->shift);
       if (has_velocity) {
-        sub_v3_v3v3(&vert_vel[i * 3], co, &scs->verts_old[i * 3]);
+        sub_v3_v3v3(&vert_vel[i * 3], co, &mcs->verts_old[i * 3]);
         mul_v3_fl(&vert_vel[i * 3], mds->dx / dt);
       }
-      copy_v3_v3(&scs->verts_old[i * 3], co);
+      copy_v3_v3(&mcs->verts_old[i * 3], co);
     }
 
     if (BKE_bvhtree_from_mesh_get(&treeData, me, BVHTREE_FROM_LOOPTRI, 4)) {
       ObstaclesFromDMData data = {.mds = mds,
-                                  .scs = scs,
+                                  .mcs = mcs,
                                   .mvert = mvert,
                                   .mloop = mloop,
                                   .looptri = looptri,
@@ -1175,14 +1175,14 @@ static void update_obstacleflags(MantaDomainSettings *mds, Object **collobjs, in
                                                                         eModifierType_Manta);
 
     if ((mmd2->type & MOD_MANTA_TYPE_EFFEC) && mmd2->effec) {
-      MantaCollSettings *scs = mmd2->effec;
-      if (!scs) {
+      MantaCollSettings *mcs = mmd2->effec;
+      if (!mcs) {
         break;
       }
-      if (scs->type == FLUID_EFFECTOR_TYPE_COLLISION) {
+      if (mcs->type == FLUID_EFFECTOR_TYPE_COLLISION) {
         active_fields |= FLUID_DOMAIN_ACTIVE_OBSTACLE;
       }
-      if (scs->type == FLUID_EFFECTOR_TYPE_GUIDE) {
+      if (mcs->type == FLUID_EFFECTOR_TYPE_GUIDE) {
         active_fields |= FLUID_DOMAIN_ACTIVE_GUIDING;
       }
     }
@@ -1273,7 +1273,7 @@ static void update_obstacles(Depsgraph *depsgraph,
 
     // DG TODO: check if modifier is active?
     if ((mmd2->type & MOD_MANTA_TYPE_EFFEC) && mmd2->effec) {
-      MantaCollSettings *scs = mmd2->effec;
+      MantaCollSettings *mcs = mmd2->effec;
 
       /* Length of one frame. If using adaptive stepping, length is smaller than

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list