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>2014-08-30 19:54:36 +0400
committerLukas Tönne <lukas.toenne@gmail.com>2015-01-20 11:29:56 +0300
commitd8cf12fe5a18309e968ffc3b326d70554013b5a7 (patch)
treec9ec99742901601a9cd5cccf62b4c8d2291813ed /source/blender/makesrna
parent5a43e8493e3851d076365dc106e0fa18ab21eebe (diff)
Debug drawing for simulations, to aid in visualizing abstract data such
as forces, velocities, contact points etc. This uses a hash table to store debug elements (dots, lines, vectors at this point). The hash table allows continuous display of elements that are generated only in certain time steps, e.g. contact points, while avoiding massive memory allocation. In any case, this system is really a development feature, but very helpful in finding issues with the internal solver data.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index c412fd460b3..1ba00056ea5 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -46,6 +46,7 @@
#include "BKE_data_transfer.h"
#include "BKE_DerivedMesh.h"
#include "BKE_dynamicpaint.h"
+#include "BKE_effect.h"
#include "BKE_mesh_mapping.h"
#include "BKE_mesh_remap.h"
#include "BKE_multires.h"
@@ -719,6 +720,28 @@ 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.
@@ -2468,6 +2491,11 @@ 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");
}
static void rna_def_modifier_smoke(BlenderRNA *brna)