[Bf-blender-cvs] [9b6088cb9da] master: Simulation: Change BPH prefix to SIM
Jacques Lucke
noreply at git.blender.org
Thu Jul 16 14:37:32 CEST 2020
Commit: 9b6088cb9da4df1a893361997fc1a22986bf6f2e
Author: Jacques Lucke
Date: Thu Jul 16 14:37:21 2020 +0200
Branches: master
https://developer.blender.org/rB9b6088cb9da4df1a893361997fc1a22986bf6f2e
Simulation: Change BPH prefix to SIM
In a previous commit the `physics` folder has been renamed to `simulation`.
This commit updates the function/file prefix accordingly.
===================================================================
M source/blender/blenkernel/intern/cloth.c
M source/blender/makesrna/intern/rna_cloth.c
M source/blender/simulation/CMakeLists.txt
R065 source/blender/simulation/BPH_mass_spring.h source/blender/simulation/SIM_mass_spring.h
R090 source/blender/simulation/intern/BPH_mass_spring.cpp source/blender/simulation/intern/SIM_mass_spring.cpp
M source/blender/simulation/intern/hair_volume.cpp
M source/blender/simulation/intern/implicit.h
M source/blender/simulation/intern/implicit_blender.c
M source/blender/simulation/intern/implicit_eigen.cpp
===================================================================
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index f45cd5b679a..467bd68c631 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -47,7 +47,7 @@
#include "BKE_modifier.h"
#include "BKE_pointcache.h"
-#include "BPH_mass_spring.h"
+#include "SIM_mass_spring.h"
// #include "PIL_time.h" /* timing for debug prints */
@@ -344,12 +344,12 @@ static int do_init_cloth(Object *ob, ClothModifierData *clmd, Mesh *result, int
return 0;
}
- BKE_cloth_solver_set_positions(clmd);
+ SIM_cloth_solver_set_positions(clmd);
ClothSimSettings *parms = clmd->sim_parms;
if (parms->flags & CLOTH_SIMSETTINGS_FLAG_PRESSURE &&
!(parms->flags & CLOTH_SIMSETTINGS_FLAG_PRESSURE_VOL)) {
- BKE_cloth_solver_set_volume(clmd);
+ SIM_cloth_solver_set_volume(clmd);
}
clmd->clothObject->last_frame = MINFRAME - 1;
@@ -404,7 +404,7 @@ static int do_step_cloth(
// TIMEIT_START(cloth_step)
/* call the solver. */
- ret = BPH_cloth_solve(depsgraph, ob, framenr, clmd, effectors);
+ ret = SIM_cloth_solve(depsgraph, ob, framenr, clmd, effectors);
// TIMEIT_END(cloth_step)
@@ -479,7 +479,7 @@ void clothModifier_do(ClothModifierData *clmd,
if (cache_result == PTCACHE_READ_EXACT || cache_result == PTCACHE_READ_INTERPOLATED ||
(!can_simulate && cache_result == PTCACHE_READ_OLD)) {
- BKE_cloth_solver_set_positions(clmd);
+ SIM_cloth_solver_set_positions(clmd);
cloth_to_object(ob, clmd, vertexCos);
BKE_ptcache_validate(cache, framenr);
@@ -493,7 +493,7 @@ void clothModifier_do(ClothModifierData *clmd,
return;
}
if (cache_result == PTCACHE_READ_OLD) {
- BKE_cloth_solver_set_positions(clmd);
+ SIM_cloth_solver_set_positions(clmd);
}
else if (
/* 2.4x disabled lib, but this can be used in some cases, testing further - campbell */
@@ -537,7 +537,7 @@ void cloth_free_modifier(ClothModifierData *clmd)
cloth = clmd->clothObject;
if (cloth) {
- BPH_cloth_solver_free(clmd);
+ SIM_cloth_solver_free(clmd);
// Free the verts.
if (cloth->verts != NULL) {
@@ -619,7 +619,7 @@ void cloth_free_modifier_extern(ClothModifierData *clmd)
printf("cloth_free_modifier_extern in\n");
}
- BPH_cloth_solver_free(clmd);
+ SIM_cloth_solver_free(clmd);
// Free the verts.
if (cloth->verts != NULL) {
@@ -919,10 +919,10 @@ static int cloth_from_object(
}
// init our solver
- BPH_cloth_solver_init(ob, clmd);
+ SIM_cloth_solver_init(ob, clmd);
if (!first) {
- BKE_cloth_solver_set_positions(clmd);
+ SIM_cloth_solver_set_positions(clmd);
}
clmd->clothObject->bvhtree = bvhtree_build_from_cloth(clmd, clmd->coll_parms->epsilon);
diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c
index 594b77ea1ad..e99bd531c65 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -34,7 +34,7 @@
#include "BKE_cloth.h"
#include "BKE_modifier.h"
-#include "BPH_mass_spring.h"
+#include "SIM_mass_spring.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -482,18 +482,18 @@ static void rna_def_cloth_solver_result(BlenderRNA *brna)
PropertyRNA *prop;
static const EnumPropertyItem status_items[] = {
- {BPH_SOLVER_SUCCESS, "SUCCESS", 0, "Success", "Computation was successful"},
- {BPH_SOLVER_NUMERICAL_ISSUE,
+ {SIM_SOLVER_SUCCESS, "SUCCESS", 0, "Success", "Computation was successful"},
+ {SIM_SOLVER_NUMERICAL_ISSUE,
"NUMERICAL_ISSUE",
0,
"Numerical Issue",
"The provided data did not satisfy the prerequisites"},
- {BPH_SOLVER_NO_CONVERGENCE,
+ {SIM_SOLVER_NO_CONVERGENCE,
"NO_CONVERGENCE",
0,
"No Convergence",
"Iterative procedure did not converge"},
- {BPH_SOLVER_INVALID_INPUT,
+ {SIM_SOLVER_INVALID_INPUT,
"INVALID_INPUT",
0,
"Invalid Input",
diff --git a/source/blender/simulation/CMakeLists.txt b/source/blender/simulation/CMakeLists.txt
index 10520a18513..aced9664f51 100644
--- a/source/blender/simulation/CMakeLists.txt
+++ b/source/blender/simulation/CMakeLists.txt
@@ -34,7 +34,7 @@ set(INC_SYS
)
set(SRC
- intern/BPH_mass_spring.cpp
+ intern/SIM_mass_spring.cpp
intern/ConstrainedConjugateGradient.h
intern/eigen_utils.h
intern/hair_volume.cpp
@@ -42,7 +42,7 @@ set(SRC
intern/implicit_blender.c
intern/implicit_eigen.cpp
- BPH_mass_spring.h
+ SIM_mass_spring.h
)
set(LIB
diff --git a/source/blender/simulation/BPH_mass_spring.h b/source/blender/simulation/SIM_mass_spring.h
similarity index 65%
rename from source/blender/simulation/BPH_mass_spring.h
rename to source/blender/simulation/SIM_mass_spring.h
index 5a8c78812a4..d30a7160fd8 100644
--- a/source/blender/simulation/BPH_mass_spring.h
+++ b/source/blender/simulation/SIM_mass_spring.h
@@ -21,8 +21,8 @@
* \ingroup bph
*/
-#ifndef __BPH_MASS_SPRING_H__
-#define __BPH_MASS_SPRING_H__
+#ifndef __SIM_MASS_SPRING_H__
+#define __SIM_MASS_SPRING_H__
#ifdef __cplusplus
extern "C" {
@@ -35,25 +35,25 @@ struct ListBase;
struct Object;
typedef enum eMassSpringSolverStatus {
- BPH_SOLVER_SUCCESS = (1 << 0),
- BPH_SOLVER_NUMERICAL_ISSUE = (1 << 1),
- BPH_SOLVER_NO_CONVERGENCE = (1 << 2),
- BPH_SOLVER_INVALID_INPUT = (1 << 3),
+ SIM_SOLVER_SUCCESS = (1 << 0),
+ SIM_SOLVER_NUMERICAL_ISSUE = (1 << 1),
+ SIM_SOLVER_NO_CONVERGENCE = (1 << 2),
+ SIM_SOLVER_INVALID_INPUT = (1 << 3),
} eMassSpringSolverStatus;
-struct Implicit_Data *BPH_mass_spring_solver_create(int numverts, int numsprings);
-void BPH_mass_spring_solver_free(struct Implicit_Data *id);
-int BPH_mass_spring_solver_numvert(struct Implicit_Data *id);
+struct Implicit_Data *SIM_mass_spring_solver_create(int numverts, int numsprings);
+void SIM_mass_spring_solver_free(struct Implicit_Data *id);
+int SIM_mass_spring_solver_numvert(struct Implicit_Data *id);
-int BPH_cloth_solver_init(struct Object *ob, struct ClothModifierData *clmd);
-void BPH_cloth_solver_free(struct ClothModifierData *clmd);
-int BPH_cloth_solve(struct Depsgraph *depsgraph,
+int SIM_cloth_solver_init(struct Object *ob, struct ClothModifierData *clmd);
+void SIM_cloth_solver_free(struct ClothModifierData *clmd);
+int SIM_cloth_solve(struct Depsgraph *depsgraph,
struct Object *ob,
float frame,
struct ClothModifierData *clmd,
struct ListBase *effectors);
-void BKE_cloth_solver_set_positions(struct ClothModifierData *clmd);
-void BKE_cloth_solver_set_volume(ClothModifierData *clmd);
+void SIM_cloth_solver_set_positions(struct ClothModifierData *clmd);
+void SIM_cloth_solver_set_volume(ClothModifierData *clmd);
#ifdef __cplusplus
}
diff --git a/source/blender/simulation/intern/BPH_mass_spring.cpp b/source/blender/simulation/intern/SIM_mass_spring.cpp
similarity index 90%
rename from source/blender/simulation/intern/BPH_mass_spring.cpp
rename to source/blender/simulation/intern/SIM_mass_spring.cpp
index 051f11aa1d9..4834d6d351c 100644
--- a/source/blender/simulation/intern/BPH_mass_spring.cpp
+++ b/source/blender/simulation/intern/SIM_mass_spring.cpp
@@ -38,7 +38,7 @@
#include "BKE_collision.h"
#include "BKE_effect.h"
-#include "BPH_mass_spring.h"
+#include "SIM_mass_spring.h"
#include "implicit.h"
#include "DEG_depsgraph.h"
@@ -104,7 +104,7 @@ static void cloth_calc_pressure_gradient(ClothModifierData *clmd,
float pt[3];
for (unsigned int i = 0; i < mvert_num; i++) {
- BPH_mass_spring_get_position(data, i, pt);
+ SIM_mass_spring_get_position(data, i, pt);
r_vertex_pressure[i] = dot_v3v3(pt, gradient_vector);
}
}
@@ -127,7 +127,7 @@ static float cloth_calc_volume(ClothModifierData *clmd)
const MVertTri *vt = &tri[i];
if (cloth_get_pressure_weights(clmd, vt, weights)) {
- vol += BPH_tri_tetra_volume_signed_6x(data, vt->tri[0], vt->tri[1], vt->tri[2]);
+ vol += SIM_tri_tetra_volume_signed_6x(data, vt->tri[0], vt->tri[1], vt->tri[2]);
}
}
@@ -179,7 +179,7 @@ static float cloth_calc_average_pressure(ClothModifierData *clmd, const float *v
const MVertTri *vt = &tri[i];
if (cloth_get_pressure_weights(clmd, vt, weights)) {
- float area = BPH_tri_area(data, vt->tri[0], vt->tri[1], vt->tri[2]);
+ float area = SIM_tri_area(data, vt->tri[0], vt->tri[1], vt->tri[2]);
total_force += (vertex_pressure[vt->tri[0]] + vertex_pressure[vt->tri[1]] +
vertex_pressure[vt->tri[2]]) *
@@ -191,7 +191,7 @@ static float cloth_calc_average_pressure(ClothModifierData *clmd, const float *v
return total_force / total_area;
}
-int BPH_cloth_solver_init(Object *UNUSED(ob), ClothModifierData *clmd)
+int SIM_cloth_solver_init(Object *UNUSED(ob), ClothModifierData *clmd)
{
Cloth *cloth = clmd->clothObject;
ClothVertex *verts = cloth->verts;
@@ -200,30 +200,30 @@ int BPH_cloth_solver_init(Object *UNUSED(ob), ClothModifierData *clmd)
unsigned int i, nondiag;
nondiag = cloth_count_nondiag_blocks(cloth);
- cloth->implicit = id = BPH_mass_spring_solver_create(cloth->mvert_num, nondiag);
+ cloth->implicit = id = SIM_mass_spring_solver_create(cloth->mvert_num, nondiag);
for (i = 0; i < cloth->mvert_num; i++) {
- BPH_mass_spring_set_vertex_mass(id, i, verts[i].mass);
+ SIM_mass_spring_set_vertex_mass(id, i, verts[i].mass);
}
for (i = 0; i < cloth->mvert_num; i++) {
- BPH_mass_spring_set_motion_state(id, i, verts[i].x, ZERO);
+ SIM_mass_spring_set_motion_state(id, i, verts[i].x, ZERO);
}
return 1;
}
-void BPH_cloth_solver_free(ClothModifierData *clmd)
+void SIM_cloth_solver_free(ClothModifierData *clmd)
{
Cloth *cloth = clmd->clothObject;
if (cloth->implicit) {
- BPH_mass_spring_solver_free(cloth->implicit);
+ SIM_mass_spring_solver_free(cloth->implicit);
cloth->implicit = NULL;
}
}
-void BKE_cloth_solver_set_positions(ClothModifierData *clmd)
+void SIM_cloth_solver_set_positions(ClothModifierData *clmd)
{
Cloth *cloth = clmd->clothObject;
Cl
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list