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-03-31 13:50:39 +0400
committerCampbell Barton <ideasman42@gmail.com>2006-03-31 13:50:39 +0400
commit9d30a3a5ec7aa507bfdb0652d8de4efa52e61035 (patch)
tree765b745753163153345366fa0c0f035c3e4d9c37
parent58c6550a7c5e0d7b1da525a1afb1ba0fecf2c048 (diff)
Added matt's empty drawsize property to python.
-rw-r--r--source/blender/python/api2_2x/Object.c6
-rw-r--r--source/blender/python/api2_2x/doc/Object.py2
2 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c
index f665be08550..6861d2198f9 100644
--- a/source/blender/python/api2_2x/Object.c
+++ b/source/blender/python/api2_2x/Object.c
@@ -3516,7 +3516,9 @@ static PyObject *Object_getAttr( BPy_Object * obj, char *name )
if( StringEqual( name, "enableDupRot" ) )
return Object_getDupliRot( obj );
if( StringEqual( name, "enableDupNoSpeed" ) )
- return Object_getDupliNoSpeed( obj );
+ return Object_getDupliNoSpeed( obj );
+ if( StringEqual( name, "drawSize" ) )
+ return ( PyFloat_FromDouble( object->empty_drawsize ) );
/* not an attribute, search the methods table */
return Py_FindMethod( BPy_Object_methods, ( PyObject * ) obj, name );
@@ -3799,6 +3801,8 @@ static int Object_setAttr( BPy_Object * obj, char *name, PyObject * value )
else if( StringEqual( name, "DupObjects" ) )
return EXPP_ReturnIntError( PyExc_AttributeError,
"DupObjects is not writable" );
+ else if( StringEqual( name, "drawSize" ) )
+ return ( !PyArg_Parse( value, "f", &( object->empty_drawsize ) ) );
else { /* if it turns out here, it's not an attribute*/
Py_DECREF(valtuple);
return EXPP_ReturnIntError( PyExc_KeyError, "attribute not found" );
diff --git a/source/blender/python/api2_2x/doc/Object.py b/source/blender/python/api2_2x/doc/Object.py
index 971cd38bd3a..270c1f2873f 100644
--- a/source/blender/python/api2_2x/doc/Object.py
+++ b/source/blender/python/api2_2x/doc/Object.py
@@ -316,6 +316,8 @@ class Object:
@type DupOn: int
@ivar DupOff: The DupliFrame removal of every Nth frame for this object. (Use with L{enableDupFrames<enableDupFrames>})
@type DupOff: int
+ @ivar drawSize: The drawsize for empty objects. 1.0. is default.
+ @type drawSize: float
"""
def buildParts():