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>2006-09-17 06:31:16 +0400
committerCampbell Barton <ideasman42@gmail.com>2006-09-17 06:31:16 +0400
commite472a3d8521f5c9b90498dcff8784ddeb678bae0 (patch)
treeb96eb16b5e67d3a94860c94e5dd60ffd244fa08f /source/blender/python/api2_2x/gen_utils.c
parenteaad4e4129ed3f2b8d1c518da20a0996c1e60fbb (diff)
renamed Blender.Image.SetCurrent(img) to img.makeCurrent() to be consistant with scene.
applied patch #4998 (array count), as well as adding other array settings, updated documentation as well. added EXPP_setVec3Clamped() as a way to set a vector from getset attrs (used with array offset and scale)
Diffstat (limited to 'source/blender/python/api2_2x/gen_utils.c')
-rw-r--r--source/blender/python/api2_2x/gen_utils.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/gen_utils.c b/source/blender/python/api2_2x/gen_utils.c
index 7748dc91618..afd3f001917 100644
--- a/source/blender/python/api2_2x/gen_utils.c
+++ b/source/blender/python/api2_2x/gen_utils.c
@@ -39,6 +39,8 @@
#include "BKE_global.h"
#include "BKE_main.h"
+#include "Mathutils.h"
+
#include "constant.h"
//---------------------- EXPP_FloatsAreEqual -------------------------
@@ -683,6 +685,26 @@ int EXPP_setIValueClamped( PyObject *value, void *param,
}
}
+int EXPP_setVec3Clamped( PyObject *value, float *param[3],
+ float min, float max )
+{
+ if( VectorObject_Check( value ) ) {
+ VectorObject *vect = (VectorObject *)value;
+ if( vect->size == 3 ) {
+ *param[0] = EXPP_ClampFloat( vect->vec[0], min, max );
+ *param[1] = EXPP_ClampFloat( vect->vec[1], min, max );
+ *param[2] = EXPP_ClampFloat( vect->vec[2], min, max );
+ return 0;
+ }
+ }
+
+ if (1) {
+ char errstr[128];
+ sprintf ( errstr, "expected vector argument in [%f,%f]", min, max );
+ return EXPP_ReturnIntError( PyExc_TypeError, errstr );
+ }
+}
+
/*
* Utility routines to range-check and store various datatypes. The object