[Bf-blender-cvs] [13769bcbe5c] master: Fluid: Rename smoke flow forces to fluid flow forces

Sebastián Barschkis noreply at git.blender.org
Thu May 14 10:41:46 CEST 2020


Commit: 13769bcbe5ccce70736ff73107d9284396043379
Author: Sebastián Barschkis
Date:   Thu May 14 10:30:11 2020 +0200
Branches: master
https://developer.blender.org/rB13769bcbe5ccce70736ff73107d9284396043379

Fluid: Rename smoke flow forces to fluid flow forces

Better to use more general term since in theory these forces can be used for smoke and liquid.

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

R100	release/datafiles/blender_icons16/icon16_force_smokeflow.dat	release/datafiles/blender_icons16/icon16_force_fluidflow.dat
R100	release/datafiles/blender_icons32/icon32_force_smokeflow.dat	release/datafiles/blender_icons32/icon32_force_fluidflow.dat
M	release/scripts/startup/bl_ui/properties_physics_field.py
M	source/blender/blenkernel/intern/effect.c
M	source/blender/blenkernel/intern/fluid.c
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M	source/blender/depsgraph/intern/depsgraph_physics.cc
M	source/blender/editors/datafiles/CMakeLists.txt
M	source/blender/editors/include/UI_icons.h
M	source/blender/editors/object/object_add.c
M	source/blender/makesdna/DNA_object_force_types.h
M	source/blender/makesrna/intern/rna_object_force.c
M	source/blender/modifiers/intern/MOD_fluid.c

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

diff --git a/release/datafiles/blender_icons16/icon16_force_smokeflow.dat b/release/datafiles/blender_icons16/icon16_force_fluidflow.dat
similarity index 100%
rename from release/datafiles/blender_icons16/icon16_force_smokeflow.dat
rename to release/datafiles/blender_icons16/icon16_force_fluidflow.dat
diff --git a/release/datafiles/blender_icons32/icon32_force_smokeflow.dat b/release/datafiles/blender_icons32/icon32_force_fluidflow.dat
similarity index 100%
rename from release/datafiles/blender_icons32/icon32_force_smokeflow.dat
rename to release/datafiles/blender_icons32/icon32_force_fluidflow.dat
diff --git a/release/scripts/startup/bl_ui/properties_physics_field.py b/release/scripts/startup/bl_ui/properties_physics_field.py
index 00dc068a51a..d1ff1dc9f5e 100644
--- a/release/scripts/startup/bl_ui/properties_physics_field.py
+++ b/release/scripts/startup/bl_ui/properties_physics_field.py
@@ -123,7 +123,7 @@ class PHYSICS_PT_field_settings(PhysicButtonsPanel, Panel):
             col.prop(field, "use_object_coords")
             col.prop(field, "use_2d_force")
 
-        elif field.type == 'SMOKE_FLOW':
+        elif field.type == 'FLUID_FLOW':
             col = flow.column()
             col.prop(field, "strength")
             col.prop(field, "flow")
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index bfb03dea39c..fe2c9ed51b8 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -113,7 +113,7 @@ PartDeflect *BKE_partdeflect_new(int type)
     case PFIELD_TEXTURE:
       pd->f_size = 1.0f;
       break;
-    case PFIELD_SMOKEFLOW:
+    case PFIELD_FLUIDFLOW:
       pd->f_flow = 1.0f;
       break;
   }
@@ -1024,7 +1024,7 @@ static void do_physical_effector(EffectorCache *eff,
 
       mul_v3_fl(force, -efd->falloff * fac * (strength * fac + damp));
       break;
-    case PFIELD_SMOKEFLOW:
+    case PFIELD_FLUIDFLOW:
       zero_v3(force);
 #ifdef WITH_FLUID
       if (pd->f_source) {
@@ -1046,7 +1046,7 @@ static void do_physical_effector(EffectorCache *eff,
   if (pd->flag & PFIELD_DO_LOCATION) {
     madd_v3_v3fl(total_force, force, 1.0f / point->vel_to_sec);
 
-    if (ELEM(pd->forcefield, PFIELD_HARMONIC, PFIELD_DRAG, PFIELD_SMOKEFLOW) == 0 &&
+    if (ELEM(pd->forcefield, PFIELD_HARMONIC, PFIELD_DRAG, PFIELD_FLUIDFLOW) == 0 &&
         pd->f_flow != 0.0f) {
       madd_v3_v3fl(total_force, point->vel, -pd->f_flow * efd->falloff);
     }
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c
index 6e4c343eac3..fddc6b5e0ee 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -3196,7 +3196,7 @@ static void update_effectors(
 {
   ListBase *effectors;
   /* make sure smoke flow influence is 0.0f */
-  mds->effector_weights->weight[PFIELD_SMOKEFLOW] = 0.0f;
+  mds->effector_weights->weight[PFIELD_FLUIDFLOW] = 0.0f;
   effectors = BKE_effectors_create(depsgraph, ob, NULL, mds->effector_weights);
 
   if (effectors) {
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 8f977e07f17..ae90ad8a281 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -433,7 +433,7 @@ void DepsgraphRelationBuilder::add_particle_forcefield_relations(const Operation
       }
 
       /* Smoke flow relations. */
-      if (relation->pd->forcefield == PFIELD_SMOKEFLOW && relation->pd->f_source) {
+      if (relation->pd->forcefield == PFIELD_FLUIDFLOW && relation->pd->f_source) {
         ComponentKey trf_key(&relation->pd->f_source->id, NodeType::TRANSFORM);
         add_relation(trf_key, key, "Smoke Force Domain");
         ComponentKey eff_key(&relation->pd->f_source->id, NodeType::GEOMETRY);
diff --git a/source/blender/depsgraph/intern/depsgraph_physics.cc b/source/blender/depsgraph/intern/depsgraph_physics.cc
index a9391e5fe8b..44c3d23ace4 100644
--- a/source/blender/depsgraph/intern/depsgraph_physics.cc
+++ b/source/blender/depsgraph/intern/depsgraph_physics.cc
@@ -141,11 +141,11 @@ void DEG_add_forcefield_relations(DepsNodeHandle *handle,
     }
 
     /* Smoke flow relations. */
-    if (relation->pd->forcefield == PFIELD_SMOKEFLOW && relation->pd->f_source != nullptr) {
+    if (relation->pd->forcefield == PFIELD_FLUIDFLOW && relation->pd->f_source != nullptr) {
       DEG_add_object_pointcache_relation(
-          handle, relation->pd->f_source, DEG_OB_COMP_TRANSFORM, "Smoke Force Domain");
+          handle, relation->pd->f_source, DEG_OB_COMP_TRANSFORM, "Fluid Force Domain");
       DEG_add_object_pointcache_relation(
-          handle, relation->pd->f_source, DEG_OB_COMP_GEOMETRY, "Smoke Force Domain");
+          handle, relation->pd->f_source, DEG_OB_COMP_GEOMETRY, "Fluid Force Domain");
     }
 
     /* Absorption forces need collision relation. */
diff --git a/source/blender/editors/datafiles/CMakeLists.txt b/source/blender/editors/datafiles/CMakeLists.txt
index 3e9d2def78e..1a5b3d6ac45 100644
--- a/source/blender/editors/datafiles/CMakeLists.txt
+++ b/source/blender/editors/datafiles/CMakeLists.txt
@@ -336,7 +336,7 @@ set(ICON_NAMES
   force_boid
   force_turbulence
   force_drag
-  force_smokeflow
+  force_fluidflow
   image_plane
   image_background
   image_reference
diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h
index 6fdef4a06e0..452a1fca111 100644
--- a/source/blender/editors/include/UI_icons.h
+++ b/source/blender/editors/include/UI_icons.h
@@ -428,7 +428,7 @@ DEF_ICON(FORCE_CURVE)
 DEF_ICON(FORCE_BOID)
 DEF_ICON(FORCE_TURBULENCE)
 DEF_ICON(FORCE_DRAG)
-DEF_ICON(FORCE_SMOKEFLOW)
+DEF_ICON(FORCE_FLUIDFLOW)
 DEF_ICON_BLANK(673)
 DEF_ICON_BLANK(674)
 DEF_ICON(RIGID_BODY)
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 0e609b5e903..74fba4d0cf9 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -146,7 +146,7 @@ static const EnumPropertyItem field_type_items[] = {
     {PFIELD_BOID, "BOID", ICON_FORCE_BOID, "Boid", ""},
     {PFIELD_TURBULENCE, "TURBULENCE", ICON_FORCE_TURBULENCE, "Turbulence", ""},
     {PFIELD_DRAG, "DRAG", ICON_FORCE_DRAG, "Drag", ""},
-    {PFIELD_SMOKEFLOW, "SMOKE", ICON_FORCE_SMOKEFLOW, "Smoke Flow", ""},
+    {PFIELD_FLUIDFLOW, "FLUID", ICON_FORCE_FLUIDFLOW, "Fluid Flow", ""},
     {0, NULL, 0, NULL, NULL},
 };
 
diff --git a/source/blender/makesdna/DNA_object_force_types.h b/source/blender/makesdna/DNA_object_force_types.h
index 73cfcddf984..85520f5a930 100644
--- a/source/blender/makesdna/DNA_object_force_types.h
+++ b/source/blender/makesdna/DNA_object_force_types.h
@@ -59,8 +59,8 @@ typedef enum ePFieldType {
   PFIELD_TURBULENCE = 11,
   /** Linear & quadratic drag. */
   PFIELD_DRAG = 12,
-  /** Force based on smoke simulation air flow. */
-  PFIELD_SMOKEFLOW = 13,
+  /** Force based on fluid simulation velocities. */
+  PFIELD_FLUIDFLOW = 13,
 
   /* Keep last. */
   NUM_PFIELD_TYPES,
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index e79c186aae4..3317ae91f98 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -1332,7 +1332,7 @@ static void rna_def_effector_weight(BlenderRNA *brna)
   RNA_def_property_float_sdna(prop, NULL, "weight[13]");
   RNA_def_property_range(prop, -200.0f, 200.0f);
   RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
-  RNA_def_property_ui_text(prop, "Smoke Flow", "Smoke Flow effector weight");
+  RNA_def_property_ui_text(prop, "Fluid Flow", "Fluid Flow effector weight");
   RNA_def_property_update(prop, 0, "rna_EffectorWeight_update");
 }
 
@@ -1396,11 +1396,11 @@ static void rna_def_field(BlenderRNA *brna)
        "Turbulence",
        "Create turbulence with a noise field"},
       {PFIELD_DRAG, "DRAG", ICON_FORCE_DRAG, "Drag", "Create a force that dampens motion"},
-      {PFIELD_SMOKEFLOW,
-       "SMOKE_FLOW",
-       ICON_FORCE_SMOKEFLOW,
-       "Smoke Flow",
-       "Create a force based on smoke simulation air flow"},
+      {PFIELD_FLUIDFLOW,
+       "FLUID_FLOW",
+       ICON_FORCE_FLUIDFLOW,
+       "Fluid Flow",
+       "Create a force based on fluid simulation velocities"},
       {0, NULL, 0, NULL, NULL},
   };
 
diff --git a/source/blender/modifiers/intern/MOD_fluid.c b/source/blender/modifiers/intern/MOD_fluid.c
index 4880bd06ee9..d3f05ee714f 100644
--- a/source/blender/modifiers/intern/MOD_fluid.c
+++ b/source/blender/modifiers/intern/MOD_fluid.c
@@ -159,7 +159,7 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
                                  ctx->object,
                                  mmd->domain->effector_weights,
                                  true,
-                                 PFIELD_SMOKEFLOW,
+                                 PFIELD_FLUIDFLOW,
                                  "Fluid Force Field");
 
     if (mmd->domain->guide_parent != NULL) {



More information about the Bf-blender-cvs mailing list