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:
authorCampbell Barton <ideasman42@gmail.com>2018-05-04 08:26:42 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-05-04 08:29:05 +0300
commitf3c5b0394f095bb017c19c5a945c8e7714205bf2 (patch)
tree7d137f466a762e013216381ccf747951ded466c2 /source/blender/blenkernel/intern/idprop.c
parent16253285ff66039b2e861422e96a102e3118205a (diff)
IDProp API: expose repr utility function
Useful for logging properties passed to operators.
Diffstat (limited to 'source/blender/blenkernel/intern/idprop.c')
-rw-r--r--source/blender/blenkernel/intern/idprop.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 5c13ba7907d..a224ef1e212 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -832,9 +832,9 @@ bool IDP_EqualsProperties_ex(IDProperty *prop1, IDProperty *prop2, const bool is
if ((p1 != p2) && ((fabsf(p1 - p2) / max_ff(p1, p2)) < 0.001f)) {
printf("WARNING: Comparing two float properties that have nearly the same value (%f vs. %f)\n", p1, p2);
printf(" p1: ");
- IDP_spit(prop1);
+ IDP_print(prop1);
printf(" p2: ");
- IDP_spit(prop2);
+ IDP_print(prop2);
}
}
#endif
@@ -1069,3 +1069,18 @@ void IDP_ClearProperty(IDProperty *prop)
}
/** \} */
+
+/* We could write a C version, see: idprop_py_api.c */
+#ifndef WITH_PYTHON
+char *IDP_reprN(IDProperty *UNUSED(prop))
+{
+ return BLI_strdup("<unsupported>");
+}
+
+void IDP_print(IDProperty *prop)
+{
+ char *repr = IDP_reprN(prop);
+ printf("IDProperty(%p): %s\n", prop, repr);
+ MEM_freeN(repr);
+}
+#endif /* WITH_PYTHON */