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:
authorHabib Gahbiche <zazizizou>2020-03-24 11:41:46 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-03-24 11:41:46 +0300
commit6e4eb2be283606a8cea45904ab57584dc07d1e05 (patch)
treefdb87264eacd5b167070168859dc6d327a9896f2 /source/blender/makesrna
parentcd0249547926ee975fc3ba7046f59bf9ca004547 (diff)
RNA: expose comparison tolerance for Mesh.unit_test_compare
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_mesh_api.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c
index cc0b2eacd13..d162917ea0c 100644
--- a/source/blender/makesrna/intern/rna_mesh_api.c
+++ b/source/blender/makesrna/intern/rna_mesh_api.c
@@ -44,9 +44,11 @@
# include "BKE_mesh_tangent.h"
# include "ED_mesh.h"
-static const char *rna_Mesh_unit_test_compare(struct Mesh *mesh, struct Mesh *mesh2)
+static const char *rna_Mesh_unit_test_compare(struct Mesh *mesh,
+ struct Mesh *mesh2,
+ float threshold)
{
- const char *ret = BKE_mesh_cmp(mesh, mesh2, FLT_EPSILON * 60);
+ const char *ret = BKE_mesh_cmp(mesh, mesh2, threshold);
if (!ret) {
ret = "Same";
@@ -317,6 +319,15 @@ void RNA_api_mesh(StructRNA *srna)
func = RNA_def_function(srna, "unit_test_compare", "rna_Mesh_unit_test_compare");
RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to compare to");
+ RNA_def_float_factor(func,
+ "threshold",
+ FLT_EPSILON * 60,
+ 0.0f,
+ FLT_MAX,
+ "Threshold",
+ "Comparison tolerance threshold",
+ 0.0f,
+ FLT_MAX);
/* return value */
parm = RNA_def_string(
func, "result", "nothing", 64, "Return value", "String description of result of comparison");