Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Tönne <lukas.toenne@gmail.com>2015-01-20 20:29:31 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2015-01-20 20:32:06 +0300
commit9d9dc06014ea7f8fd186246d1e55d429c5193cb6 (patch)
treefaad9521f23f32c9ce1b9331f9763c69d52bedae /source/blender
parent3356f3f0bb15fa50c2920e4bc428a8375b43f321 (diff)
Made SimDebugData into a single global instance.
This way it doesn't have to be stored as DNA runtime pointers or passed down as a function argument. Currently there is now no property or button to enable debugging, this will be added again later.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_effect.h35
-rw-r--r--source/blender/blenkernel/intern/collision.c14
-rw-r--r--source/blender/blenkernel/intern/effect.c71
-rw-r--r--source/blender/blenloader/intern/readfile.c3
-rw-r--r--source/blender/editors/space_view3d/drawobject.c6
-rw-r--r--source/blender/editors/space_view3d/drawsimdebug.c6
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c3
-rw-r--r--source/blender/editors/space_view3d/view3d_intern.h2
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c27
-rw-r--r--source/blender/modifiers/intern/MOD_cloth.c5
-rw-r--r--source/blender/physics/intern/BPH_mass_spring.cpp7
-rw-r--r--source/blender/physics/intern/hair_volume.cpp24
-rw-r--r--source/blender/physics/intern/implicit.h4
-rw-r--r--source/blender/physics/intern/implicit_blender.c8
-rw-r--r--source/blender/physics/intern/implicit_eigen.cpp8
16 files changed, 80 insertions, 145 deletions
diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h
index c85145470b1..c4c27e1060d 100644
--- a/source/blender/blenkernel/BKE_effect.h
+++ b/source/blender/blenkernel/BKE_effect.h
@@ -188,36 +188,39 @@ typedef struct SimDebugData {
struct GHash *gh;
} SimDebugData;
-struct SimDebugData *BKE_sim_debug_data_new(void);
+extern SimDebugData *_sim_debug_data;
-void BKE_sim_debug_data_add_element(struct SimDebugData *debug_data, int type, const float v1[3], const float v2[3],
+void BKE_sim_debug_data_set_enabled(bool enable);
+bool BKE_sim_debug_data_get_enabled(void);
+void BKE_sim_debug_data_free(void);
+
+void BKE_sim_debug_data_add_element(int type, const float v1[3], const float v2[3],
float r, float g, float b, const char *category, unsigned int hash);
-void BKE_sim_debug_data_remove_element(struct SimDebugData *debug_data, unsigned int hash);
+void BKE_sim_debug_data_remove_element(unsigned int hash);
-#define BKE_sim_debug_data_add_dot(debug_data, p, r, g, b, category, ...) { \
+#define BKE_sim_debug_data_add_dot(p, r, g, b, category, ...) { \
const float v2[3] = { 0.0f, 0.0f, 0.0f }; \
- BKE_sim_debug_data_add_element(debug_data, SIM_DEBUG_ELEM_DOT, p, v2, r, g, b, category, SIM_DEBUG_HASH(__VA_ARGS__)); \
+ BKE_sim_debug_data_add_element(SIM_DEBUG_ELEM_DOT, p, v2, r, g, b, category, SIM_DEBUG_HASH(__VA_ARGS__)); \
}
-#define BKE_sim_debug_data_add_circle(debug_data, p, radius, r, g, b, category, ...) { \
+#define BKE_sim_debug_data_add_circle(p, radius, r, g, b, category, ...) { \
const float v2[3] = { radius, 0.0f, 0.0f }; \
- BKE_sim_debug_data_add_element(debug_data, SIM_DEBUG_ELEM_CIRCLE, p, v2, r, g, b, category, SIM_DEBUG_HASH(__VA_ARGS__)); \
+ BKE_sim_debug_data_add_element(SIM_DEBUG_ELEM_CIRCLE, p, v2, r, g, b, category, SIM_DEBUG_HASH(__VA_ARGS__)); \
}
-#define BKE_sim_debug_data_add_line(debug_data, p1, p2, r, g, b, category, ...) { \
- BKE_sim_debug_data_add_element(debug_data, SIM_DEBUG_ELEM_LINE, p1, p2, r, g, b, category, SIM_DEBUG_HASH(__VA_ARGS__)); \
+#define BKE_sim_debug_data_add_line(p1, p2, r, g, b, category, ...) { \
+ BKE_sim_debug_data_add_element(SIM_DEBUG_ELEM_LINE, p1, p2, r, g, b, category, SIM_DEBUG_HASH(__VA_ARGS__)); \
}
-#define BKE_sim_debug_data_add_vector(debug_data, p, d, r, g, b, category, ...) { \
- BKE_sim_debug_data_add_element(debug_data, SIM_DEBUG_ELEM_VECTOR, p, d, r, g, b, category, SIM_DEBUG_HASH(__VA_ARGS__)); \
+#define BKE_sim_debug_data_add_vector(p, d, r, g, b, category, ...) { \
+ BKE_sim_debug_data_add_element(SIM_DEBUG_ELEM_VECTOR, p, d, r, g, b, category, SIM_DEBUG_HASH(__VA_ARGS__)); \
}
-#define BKE_sim_debug_data_remove(debug_data, ...) \
- BKE_sim_debug_data_remove_element(debug_data, SIM_DEBUG_HASH(__VA_ARGS__))
+#define BKE_sim_debug_data_remove(...) \
+ BKE_sim_debug_data_remove_element(SIM_DEBUG_HASH(__VA_ARGS__))
-void BKE_sim_debug_data_clear(struct SimDebugData *debug_data);
-void BKE_sim_debug_data_clear_category(struct SimDebugData *debug_data, const char *category);
-void BKE_sim_debug_data_free(struct SimDebugData *debug_data);
+void BKE_sim_debug_data_clear(void);
+void BKE_sim_debug_data_clear_category(const char *category);
#endif
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index 92cd1ee0611..5266c5b323d 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -990,11 +990,9 @@ static bool cloth_points_collision_response_static(ClothModifierData *clmd, Coll
mag_v_rel = dot_v3v3(v_rel_old, collpair->normal);
/**** DEBUG ****/
- if (clmd->debug_data) {
- BKE_sim_debug_data_add_dot(clmd->debug_data, collpair->pa, 0.9, 0.2, 0.2, "collision", 833, collpair->face1, collpair->face2);
- BKE_sim_debug_data_add_dot(clmd->debug_data, collpair->pb, 0.2, 0.9, 0.2, "collision", 834, collpair->face1, collpair->face2);
- BKE_sim_debug_data_add_line(clmd->debug_data, collpair->pa, collpair->pb, 0.8, 0.8, 0.8, "collision", 835, collpair->face1, collpair->face2);
- }
+ BKE_sim_debug_data_add_dot(collpair->pa, 0.9, 0.2, 0.2, "collision", 833, collpair->face1, collpair->face2);
+ BKE_sim_debug_data_add_dot(collpair->pb, 0.2, 0.9, 0.2, "collision", 834, collpair->face1, collpair->face2);
+ BKE_sim_debug_data_add_line(collpair->pa, collpair->pb, 0.8, 0.8, 0.8, "collision", 835, collpair->face1, collpair->face2);
/********/
if (mag_v_rel < -ALMOST_ZERO) {
@@ -1106,7 +1104,7 @@ BLI_INLINE bool cloth_point_face_collision_params(const float p1[3], const float
}
static CollPair *cloth_point_collpair(float p1[3], float p2[3], MVert *mverts, int bp1, int bp2, int bp3,
- int index_cloth, int index_coll, float epsilon, CollPair *collpair, SimDebugData *UNUSED(debug_data))
+ int index_cloth, int index_coll, float epsilon, CollPair *collpair)
{
float *co1 = mverts[bp1].co, *co2 = mverts[bp2].co, *co3 = mverts[bp3].co;
float lambda, distance1, distance2;
@@ -1163,9 +1161,9 @@ static CollPair* cloth_point_collision(ModifierData *md1, ModifierData *md2,
vert = &clmd->clothObject->verts[overlap->indexA];
face = &collmd->mfaces[overlap->indexB];
- collpair = cloth_point_collpair(vert->tx, vert->x, mverts, face->v1, face->v2, face->v3, overlap->indexA, overlap->indexB, epsilon, collpair, clmd->debug_data);
+ collpair = cloth_point_collpair(vert->tx, vert->x, mverts, face->v1, face->v2, face->v3, overlap->indexA, overlap->indexB, epsilon, collpair);
if (face->v4)
- collpair = cloth_point_collpair(vert->tx, vert->x, mverts, face->v3, face->v4, face->v1, overlap->indexA, overlap->indexB, epsilon, collpair, clmd->debug_data);
+ collpair = cloth_point_collpair(vert->tx, vert->x, mverts, face->v3, face->v4, face->v1, overlap->indexA, overlap->indexB, epsilon, collpair);
return collpair;
}
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index e43bde7ea38..c896fa2bbcf 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -1029,6 +1029,8 @@ void pdDoEffectors(ListBase *effectors, ListBase *colliders, EffectorWeights *we
/* ======== Simulation Debugging ======== */
+SimDebugData *_sim_debug_data = NULL;
+
unsigned int BKE_sim_debug_data_hash(int i)
{
return BLI_ghashutil_uinthash((unsigned int)i);
@@ -1080,12 +1082,31 @@ static void debug_element_free(void *val)
MEM_freeN(elem);
}
-SimDebugData *BKE_sim_debug_data_new(void)
+void BKE_sim_debug_data_set_enabled(bool enable)
{
- SimDebugData *debug_data = MEM_callocN(sizeof(SimDebugData), "sim debug data");
- debug_data->gh = BLI_ghash_new(debug_element_hash, debug_element_compare, "sim debug element hash");
- return debug_data;
-
+ if (enable) {
+ if (!_sim_debug_data) {
+ _sim_debug_data = MEM_callocN(sizeof(SimDebugData), "sim debug data");
+ _sim_debug_data->gh = BLI_ghash_new(debug_element_hash, debug_element_compare, "sim debug element hash");
+ }
+ }
+ else {
+ BKE_sim_debug_data_free();
+ }
+}
+
+bool BKE_sim_debug_data_get_enabled(void)
+{
+ return _sim_debug_data != NULL;
+}
+
+void BKE_sim_debug_data_free(void)
+{
+ if (_sim_debug_data) {
+ if (_sim_debug_data->gh)
+ BLI_ghash_free(_sim_debug_data->gh, NULL, debug_element_free);
+ MEM_freeN(_sim_debug_data);
+ }
}
static void debug_data_insert(SimDebugData *debug_data, SimDebugElement *elem)
@@ -1099,11 +1120,11 @@ static void debug_data_insert(SimDebugData *debug_data, SimDebugElement *elem)
BLI_ghash_insert(debug_data->gh, elem, elem);
}
-void BKE_sim_debug_data_add_element(SimDebugData *debug_data, int type, const float v1[3], const float v2[3], float r, float g, float b, const char *category, unsigned int hash)
+void BKE_sim_debug_data_add_element(int type, const float v1[3], const float v2[3], float r, float g, float b, const char *category, unsigned int hash)
{
unsigned int category_hash = BLI_ghashutil_strhash_p(category);
SimDebugElement *elem;
- if (!debug_data)
+ if (!_sim_debug_data)
return;
elem = MEM_callocN(sizeof(SimDebugElement), "sim debug data element");
@@ -1116,54 +1137,44 @@ void BKE_sim_debug_data_add_element(SimDebugData *debug_data, int type, const fl
copy_v3_v3(elem->v1, v1);
copy_v3_v3(elem->v2, v2);
- debug_data_insert(debug_data, elem);
+ debug_data_insert(_sim_debug_data, elem);
}
-void BKE_sim_debug_data_remove_element(SimDebugData *debug_data, unsigned int hash)
+void BKE_sim_debug_data_remove_element(unsigned int hash)
{
SimDebugElement dummy;
- if (!debug_data)
+ if (!_sim_debug_data)
return;
dummy.hash = hash;
- BLI_ghash_remove(debug_data->gh, &dummy, NULL, debug_element_free);
+ BLI_ghash_remove(_sim_debug_data->gh, &dummy, NULL, debug_element_free);
}
-void BKE_sim_debug_data_clear(SimDebugData *debug_data)
+void BKE_sim_debug_data_clear(void)
{
- if (!debug_data)
+ if (!_sim_debug_data)
return;
- if (debug_data->gh)
- BLI_ghash_clear(debug_data->gh, NULL, debug_element_free);
+ if (_sim_debug_data->gh)
+ BLI_ghash_clear(_sim_debug_data->gh, NULL, debug_element_free);
}
-void BKE_sim_debug_data_clear_category(SimDebugData *debug_data, const char *category)
+void BKE_sim_debug_data_clear_category(const char *category)
{
int category_hash = (int)BLI_ghashutil_strhash_p(category);
- if (!debug_data)
+ if (!_sim_debug_data)
return;
- if (debug_data->gh) {
+ if (_sim_debug_data->gh) {
GHashIterator iter;
- BLI_ghashIterator_init(&iter, debug_data->gh);
+ BLI_ghashIterator_init(&iter, _sim_debug_data->gh);
while(!BLI_ghashIterator_done(&iter)) {
SimDebugElement *elem = BLI_ghashIterator_getValue(&iter);
BLI_ghashIterator_step(&iter); /* removing invalidates the current iterator, so step before removing */
if (elem->category_hash == category_hash)
- BLI_ghash_remove(debug_data->gh, elem, NULL, debug_element_free);
+ BLI_ghash_remove(_sim_debug_data->gh, elem, NULL, debug_element_free);
}
}
}
-
-void BKE_sim_debug_data_free(SimDebugData *debug_data)
-{
- if (!debug_data)
- return;
-
- if (debug_data->gh)
- BLI_ghash_free(debug_data->gh, NULL, debug_element_free);
- MEM_freeN(debug_data);
-}
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index be1311249ee..8d41682334b 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3871,8 +3871,6 @@ static void lib_link_particlesystems(FileData *fd, Object *ob, ID *id, ListBase
psys->clmd->ptcaches.first = psys->clmd->ptcaches.last= NULL;
psys->clmd->coll_parms->group = newlibadr(fd, id->lib, psys->clmd->coll_parms->group);
psys->clmd->modifier.error = NULL;
-
- psys->clmd->debug_data = NULL;
}
}
else {
@@ -4692,7 +4690,6 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
}
clmd->solver_result = NULL;
- clmd->debug_data = NULL;
}
else if (md->type == eModifierType_Fluidsim) {
FluidsimModifierData *fluidmd = (FluidsimModifierData *)md;
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index d9b4e8164e4..0d0ef725705 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -7617,12 +7617,6 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
}
draw_new_particle_system(scene, v3d, rv3d, base, psys, dt, dflag);
-
- /* debug data */
- if (psys->part->type == PART_HAIR) {
- if (psys->clmd && psys->clmd->debug_data)
- draw_sim_debug_data(scene, v3d, ar, base, psys->clmd->debug_data);
- }
}
invert_m4_m4(ob->imat, ob->obmat);
view3d_cached_text_draw_end(v3d, ar, 0, NULL);
diff --git a/source/blender/editors/space_view3d/drawsimdebug.c b/source/blender/editors/space_view3d/drawsimdebug.c
index 5f3779d540f..6113bfd4143 100644
--- a/source/blender/editors/space_view3d/drawsimdebug.c
+++ b/source/blender/editors/space_view3d/drawsimdebug.c
@@ -147,13 +147,13 @@ static void draw_sim_debug_elements(SimDebugData *debug_data, float imat[4][4])
glEnd();
}
-void draw_sim_debug_data(Scene *UNUSED(scene), View3D *UNUSED(v3d), ARegion *ar, Base *UNUSED(base), SimDebugData *debug_data)
+void draw_sim_debug_data(Scene *UNUSED(scene), View3D *UNUSED(v3d), ARegion *ar)
{
RegionView3D *rv3d = ar->regiondata;
/*Object *ob = base->object;*/
float imat[4][4];
- if (!debug_data)
+ if (!_sim_debug_data)
return;
invert_m4_m4(imat, rv3d->viewmatob);
@@ -164,7 +164,7 @@ void draw_sim_debug_data(Scene *UNUSED(scene), View3D *UNUSED(v3d), ARegion *ar,
glPushMatrix();
glLoadMatrixf(rv3d->viewmat);
- draw_sim_debug_elements(debug_data, imat);
+ draw_sim_debug_elements(_sim_debug_data, imat);
glPopMatrix();
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index ba462221e69..ed30c8794fd 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -3580,9 +3580,12 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
/* draw viewport using opengl */
if (v3d->drawtype != OB_RENDER || !view3d_main_area_do_render_draw(scene) || clip_border) {
view3d_main_area_draw_objects(C, scene, v3d, ar, &grid_unit);
+
#ifdef DEBUG_DRAW
bl_debug_draw();
#endif
+ draw_sim_debug_data(scene, v3d, ar);
+
ED_region_pixelspace(ar);
}
diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h
index 1cd5c5453c2..25dbc8830fe 100644
--- a/source/blender/editors/space_view3d/view3d_intern.h
+++ b/source/blender/editors/space_view3d/view3d_intern.h
@@ -180,7 +180,7 @@ void draw_mesh_paint(View3D *v3d, RegionView3D *rv3d,
struct Object *ob, struct DerivedMesh *dm, const int draw_flags);
/* drawsimdebug.c */
-void draw_sim_debug_data(Scene *scene, View3D *v3d, ARegion *ar, Base *base, struct SimDebugData *debug_data);
+void draw_sim_debug_data(Scene *scene, View3D *v3d, ARegion *ar);
/* view3d_draw.c */
void view3d_main_area_draw(const struct bContext *C, struct ARegion *ar);
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 27e01cf7d29..43d7b45675c 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -573,8 +573,6 @@ typedef struct ClothModifierData {
float hair_grid_cellsize;
struct ClothSolverResult *solver_result;
-
- struct SimDebugData *debug_data; /* debug info */
} ClothModifierData;
typedef struct CollisionModifierData {
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 39977e05605..18bfea026e1 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -720,28 +720,6 @@ static int rna_LaplacianDeformModifier_is_bind_get(PointerRNA *ptr)
return ((lmd->flag & MOD_LAPLACIANDEFORM_BIND) && (lmd->cache_system != NULL));
}
-static int rna_ClothModifier_show_debug_data_get(PointerRNA *ptr)
-{
- ClothModifierData *clmd = (ClothModifierData *)ptr->data;
- return clmd->debug_data != NULL;
-}
-
-static void rna_ClothModifier_show_debug_data_set(PointerRNA *ptr, int value)
-{
- ClothModifierData *clmd = (ClothModifierData *)ptr->data;
- if (value) {
- if (!clmd->debug_data) {
- clmd->debug_data = BKE_sim_debug_data_new();
- }
- }
- else {
- if (clmd->debug_data) {
- BKE_sim_debug_data_free(clmd->debug_data);
- clmd->debug_data = NULL;
- }
- }
-}
-
/* NOTE: Curve and array modifiers requires curve path to be evaluated,
* dependency graph will make sure that curve eval would create such a path,
* but if curve was already evaluated we might miss path.
@@ -2496,11 +2474,6 @@ static void rna_def_modifier_cloth(BlenderRNA *brna)
prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_ui_text(prop, "Point Cache", "");
-
- prop = RNA_def_property(srna, "show_debug_data", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_funcs(prop, "rna_ClothModifier_show_debug_data_get", "rna_ClothModifier_show_debug_data_set");
- RNA_def_property_ui_text(prop, "Debug", "Show debug info");
- RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop = RNA_def_property(srna, "hair_grid_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "hair_grid_min");
diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c
index 3d5caf6570b..71a83dfa742 100644
--- a/source/blender/modifiers/intern/MOD_cloth.c
+++ b/source/blender/modifiers/intern/MOD_cloth.c
@@ -69,8 +69,6 @@ static void initData(ModifierData *md)
return;
cloth_init(clmd);
-
- clmd->debug_data = NULL;
}
static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3],
@@ -180,7 +178,6 @@ static void copyData(ModifierData *md, ModifierData *target)
tclmd->clothObject = NULL;
tclmd->hairdata = NULL;
tclmd->solver_result = NULL;
- tclmd->debug_data = NULL;
}
static bool dependsOnTime(ModifierData *UNUSED(md))
@@ -214,8 +211,6 @@ static void freeData(ModifierData *md)
if (clmd->solver_result)
MEM_freeN(clmd->solver_result);
-
- BKE_sim_debug_data_free(clmd->debug_data);
}
}
diff --git a/source/blender/physics/intern/BPH_mass_spring.cpp b/source/blender/physics/intern/BPH_mass_spring.cpp
index 112287150cd..668efbba315 100644
--- a/source/blender/physics/intern/BPH_mass_spring.cpp
+++ b/source/blender/physics/intern/BPH_mass_spring.cpp
@@ -712,7 +712,6 @@ static void cloth_continuum_step(ClothModifierData *clmd, float dt)
if (smoothfac > 0.0f || density_strength > 0.0f) {
HairGrid *grid = BPH_hair_volume_create_vertex_grid(clmd->sim_parms->voxel_cell_size, gmin, gmax);
- BPH_hair_volume_set_debug_data(grid, clmd->debug_data);
BPH_hair_volume_set_debug_value(grid, parms->debug1, parms->debug2, parms->debug3, parms->debug4);
cloth_continuum_fill_grid(grid, cloth);
@@ -903,9 +902,7 @@ int BPH_cloth_solve(Object *ob, float frame, ClothModifierData *clmd, ListBase *
ColliderContacts *contacts = NULL;
int totcolliders = 0;
- BPH_mass_spring_solver_debug_data(id, clmd->debug_data);
-
- BKE_sim_debug_data_clear_category(clmd->debug_data, "collision");
+ BKE_sim_debug_data_clear_category("collision");
if (!clmd->solver_result)
clmd->solver_result = (ClothSolverResult *)MEM_callocN(sizeof(ClothSolverResult), "cloth solver result");
@@ -997,8 +994,6 @@ int BPH_cloth_solve(Object *ob, float frame, ClothModifierData *clmd, ListBase *
copy_v3_v3(verts[i].txold, verts[i].x);
}
- BPH_mass_spring_solver_debug_data(id, NULL);
-
return 1;
}
diff --git a/source/blender/physics/intern/hair_volume.cpp b/source/blender/physics/intern/hair_volume.cpp
index c8f9edb3a98..c181cdc0f37 100644
--- a/source/blender/physics/intern/hair_volume.cpp
+++ b/source/blender/physics/intern/hair_volume.cpp
@@ -92,7 +92,6 @@ typedef struct HairGrid {
float gmin[3], gmax[3];
float cellsize, inv_cellsize;
- struct SimDebugData *debug_data;
float debug1, debug2;
int debug3, debug4;
} HairGrid;
@@ -405,21 +404,20 @@ BLI_INLINE void hair_volume_add_segment_2D(HairGrid *grid,
#if 0
{
- SimDebugData *debug_data = grid->debug_data;
float wloc[3], x2w[3], x3w[3];
grid_to_world(grid, wloc, loc_k);
grid_to_world(grid, x2w, x2);
grid_to_world(grid, x3w, x3);
if (vert_k->samples > 0)
- BKE_sim_debug_data_add_circle(debug_data, wloc, 0.01f, 1.0, 1.0, 0.3, "grid", 2525, debug_i, j, k);
+ BKE_sim_debug_data_add_circle(wloc, 0.01f, 1.0, 1.0, 0.3, "grid", 2525, debug_i, j, k);
if (grid->debug_value) {
- BKE_sim_debug_data_add_dot(debug_data, wloc, 1, 0, 0, "grid", 93, debug_i, j, k);
- BKE_sim_debug_data_add_dot(debug_data, x2w, 0.1, 0.1, 0.7, "grid", 649, debug_i, j, k);
- BKE_sim_debug_data_add_line(debug_data, wloc, x2w, 0.3, 0.8, 0.3, "grid", 253, debug_i, j, k);
- BKE_sim_debug_data_add_line(debug_data, wloc, x3w, 0.8, 0.3, 0.3, "grid", 254, debug_i, j, k);
-// BKE_sim_debug_data_add_circle(debug_data, x2w, len_v3v3(wloc, x2w), 0.2, 0.7, 0.2, "grid", 255, i, j, k);
+ BKE_sim_debug_data_add_dot(wloc, 1, 0, 0, "grid", 93, debug_i, j, k);
+ BKE_sim_debug_data_add_dot(x2w, 0.1, 0.1, 0.7, "grid", 649, debug_i, j, k);
+ BKE_sim_debug_data_add_line(wloc, x2w, 0.3, 0.8, 0.3, "grid", 253, debug_i, j, k);
+ BKE_sim_debug_data_add_line(wloc, x3w, 0.8, 0.3, 0.3, "grid", 254, debug_i, j, k);
+// BKE_sim_debug_data_add_circle(x2w, len_v3v3(wloc, x2w), 0.2, 0.7, 0.2, "grid", 255, i, j, k);
}
}
#endif
@@ -439,8 +437,6 @@ void BPH_hair_volume_add_segment(HairGrid *grid,
const float x3[3], const float v3[3], const float x4[3], const float v4[3],
const float dir1[3], const float dir2[3], const float dir3[3])
{
- SimDebugData *debug_data = grid->debug_data;
-
const int res[3] = { grid->res[0], grid->res[1], grid->res[2] };
/* find the primary direction from the major axis of the direction vector */
@@ -476,8 +472,6 @@ void BPH_hair_volume_add_segment(HairGrid *grid,
int j0, k0, j0_prev, k0_prev;
int i;
- (void)debug_data;
-
for (i = imin; i <= imax; ++i) {
float shift1, shift2; /* fraction of a full cell shift [0.0, 1.0) */
int jmin, jmax, kmin, kmax;
@@ -1029,12 +1023,6 @@ void BPH_hair_volume_free_vertex_grid(HairGrid *grid)
}
}
-void BPH_hair_volume_set_debug_data(HairGrid *grid, SimDebugData *debug_data)
-{
- grid->debug_data = debug_data;
- BKE_sim_debug_data_clear_category(grid->debug_data, "grid");
-}
-
void BPH_hair_volume_set_debug_value(HairGrid *grid, float debug1, float debug2, int debug3, int debug4)
{
grid->debug1 = debug1;
diff --git a/source/blender/physics/intern/implicit.h b/source/blender/physics/intern/implicit.h
index 0e2d12ba99d..2f71485f914 100644
--- a/source/blender/physics/intern/implicit.h
+++ b/source/blender/physics/intern/implicit.h
@@ -60,7 +60,6 @@ extern "C" {
struct Implicit_Data;
struct ImplicitSolverInput;
-struct SimDebugData;
typedef struct ImplicitSolverResult {
int status;
@@ -74,8 +73,6 @@ BLI_INLINE void implicit_print_matrix_elem(float v)
printf("%-8.3f", v);
}
-void BPH_mass_spring_solver_debug_data(struct Implicit_Data *id, struct SimDebugData *debug_data);
-
void BPH_mass_spring_set_vertex_mass(struct Implicit_Data *data, int index, float mass);
void BPH_mass_spring_set_rest_transform(struct Implicit_Data *data, int index, float rot[3][3]);
@@ -142,7 +139,6 @@ struct VoxelData;
struct HairGrid *BPH_hair_volume_create_vertex_grid(float cellsize, const float gmin[3], const float gmax[3]);
void BPH_hair_volume_free_vertex_grid(struct HairGrid *grid);
void BPH_hair_volume_grid_geometry(struct HairGrid *grid, float *cellsize, int res[3], float gmin[3], float gmax[3]);
-void BPH_hair_volume_set_debug_data(struct HairGrid *grid, struct SimDebugData *debug_data);
void BPH_hair_volume_set_debug_value(struct HairGrid *grid, float debug1, float debug2, int debug3, int debug4);
void BPH_hair_volume_grid_clear(struct HairGrid *grid);
diff --git a/source/blender/physics/intern/implicit_blender.c b/source/blender/physics/intern/implicit_blender.c
index ce65703901a..56ce1129cc7 100644
--- a/source/blender/physics/intern/implicit_blender.c
+++ b/source/blender/physics/intern/implicit_blender.c
@@ -700,8 +700,6 @@ typedef struct Implicit_Data {
lfVector *z; /* target velocity in constrained directions */
fmatrix3x3 *S; /* filtering matrix for constraints */
fmatrix3x3 *P, *Pinv; /* pre-conditioning matrix */
-
- struct SimDebugData *debug_data;
} Implicit_Data;
Implicit_Data *BPH_mass_spring_solver_create(int numverts, int numsprings)
@@ -756,12 +754,6 @@ void BPH_mass_spring_solver_free(Implicit_Data *id)
MEM_freeN(id);
}
-void BPH_mass_spring_solver_debug_data(Implicit_Data *id, struct SimDebugData *debug_data)
-{
- if (id)
- id->debug_data = debug_data;
-}
-
/* ==== Transformation from/to root reference frames ==== */
BLI_INLINE void world_to_root_v3(Implicit_Data *data, int index, float r[3], const float v[3])
diff --git a/source/blender/physics/intern/implicit_eigen.cpp b/source/blender/physics/intern/implicit_eigen.cpp
index ee95e94a843..d9e4d38dd70 100644
--- a/source/blender/physics/intern/implicit_eigen.cpp
+++ b/source/blender/physics/intern/implicit_eigen.cpp
@@ -445,8 +445,6 @@ struct Implicit_Data {
lMatrixCtor iM; /* masses */
lMatrixCtor idFdX, idFdV; /* force jacobians */
lMatrixCtor iS; /* filtering matrix for constraints */
-
- struct SimDebugData *debug_data;
};
Implicit_Data *BPH_mass_spring_solver_create(int numverts, int numsprings)
@@ -469,12 +467,6 @@ int BPH_mass_spring_solver_numvert(Implicit_Data *id)
return 0;
}
-void BPH_mass_spring_solver_debug_data(Implicit_Data *id, struct SimDebugData *debug_data)
-{
- if (id)
- id->debug_data = debug_data;
-}
-
/* ==== Transformation from/to root reference frames ==== */
BLI_INLINE void world_to_root_v3(Implicit_Data *data, int index, float r[3], const float v[3])