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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2007-11-30 17:10:36 +0300
committerCampbell Barton <ideasman42@gmail.com>2007-11-30 17:10:36 +0300
commit6b88141fdac6c052448060f25fa2a9b0a6e8f9c4 (patch)
treecf62ad365849c72d6d23ed4cf71c60df7cd5df61 /source
parent0bcc5e8b8d4b4d9608be10c13001a6457020af0e (diff)
dupliFaceScale wasnt being initialized for new objects, added Python api access
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/object.c1
-rw-r--r--source/blender/python/api2_2x/Object.c16
-rw-r--r--source/blender/python/api2_2x/doc/Object.py2
3 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index d9b2ce84fa5..30b5a2a43ca 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -913,6 +913,7 @@ Object *add_only_object(int type, char *name)
ob->ipowin= ID_OB; /* the ipowin shown */
ob->dupon= 1; ob->dupoff= 0;
ob->dupsta= 1; ob->dupend= 100;
+ ob->dupfacesca = 1.0;
/* Game engine defaults*/
ob->mass= ob->inertia= 1.0f;
diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c
index 6b3735a6cfd..f873c4321b3 100644
--- a/source/blender/python/api2_2x/Object.c
+++ b/source/blender/python/api2_2x/Object.c
@@ -172,6 +172,7 @@ enum obj_consts {
EXPP_OBJ_ATTR_DUPOFF,
EXPP_OBJ_ATTR_DUPSTA,
EXPP_OBJ_ATTR_DUPEND,
+ EXPP_OBJ_ATTR_DUPFACESCALEFAC,
EXPP_OBJ_ATTR_TIMEOFFSET,
EXPP_OBJ_ATTR_DRAWSIZE,
EXPP_OBJ_ATTR_PARENT_TYPE,
@@ -276,6 +277,8 @@ enum obj_consts {
#define EXPP_OBJECT_SBINSPRINGMAX 0.999f
#define EXPP_OBJECT_SBINFRICTMIN 0.0f
#define EXPP_OBJECT_SBINFRICTMAX 10.0f
+#define EXPP_OBJECT_DUPFACESCALEFACMIN 0.001f
+#define EXPP_OBJECT_DUPFACESCALEFACMAX 10000.0f
/*****************************************************************************/
/* Python API function prototypes for the Blender module. */
@@ -3843,6 +3846,9 @@ static PyObject *getFloatAttr( BPy_Object *self, void *type )
case EXPP_OBJ_ATTR_SB_INFRICT:
param = object->soft->infrict;
break;
+ case EXPP_OBJ_ATTR_DUPFACESCALEFAC:
+ param = object->dupfacesca;
+ break;
default:
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
"undefined type in getFloatAttr" );
@@ -3990,6 +3996,12 @@ static int setFloatAttrClamp( BPy_Object *self, PyObject *value, void *type )
max = EXPP_OBJECT_SBINFRICTMAX;
param = &self->object->soft->infrict;
break;
+ case EXPP_OBJ_ATTR_DUPFACESCALEFAC:
+ min = EXPP_OBJECT_DUPFACESCALEFACMIN;
+ max = EXPP_OBJECT_DUPFACESCALEFACMAX;
+ param = &self->object->dupfacesca;
+ break;
+
default:
return EXPP_ReturnIntError( PyExc_RuntimeError,
"undefined type in setFloatAttrClamp" );
@@ -4984,6 +4996,10 @@ static PyGetSetDef BPy_Object_getseters[] = {
(getter)Object_getTransflagBits, (setter)Object_setTransflagBits,
"Use face scale to scale all dupliFaces",
(void *)OB_DUPLIFACES_SCALE},
+ {"dupFacesScaleFac",
+ (getter)getFloatAttr, (setter)setFloatAttr,
+ "Use face scale to scale all dupliFaces",
+ (void *)EXPP_OBJ_ATTR_DUPFACESCALEFAC},
{"enableDupFrames",
(getter)Object_getTransflagBits, (setter)Object_setTransflagBits,
"Make copy of object for every frame",
diff --git a/source/blender/python/api2_2x/doc/Object.py b/source/blender/python/api2_2x/doc/Object.py
index 34cdd4b7821..08ad7c68dca 100644
--- a/source/blender/python/api2_2x/doc/Object.py
+++ b/source/blender/python/api2_2x/doc/Object.py
@@ -428,6 +428,8 @@ class Object:
@type enableDupFaces: boolean
@ivar enableDupFacesScale: The DupliFacesScale status of the object.
@type enableDupFacesScale: boolean
+ @ivar dupFacesScaleFac: Scale factor for dupliface instance, 1.0 by default.
+ @type dupFacesScaleFac: float
@ivar enableDupFrames: The DupliFrames status of the object.
Does not indicate that this object has any dupliFrames,
(as returned by L{DupObjects}) just that dupliFrames are enabled.