Page Menu
Home
Search
Configure Global Search
Log In
Files
F3199
Object.c.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
jean-michel soler (jms)
Nov 13 2013, 1:08 PM
Size
7 KB
Subscribers
None
Object.c.patch
View Options
Index: source/blender/python/api2_2x/Object.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/Object.c,v
retrieving revision 1.169
diff -u -r1.169 Object.c
--- source/blender/python/api2_2x/Object.c 16 Feb 2006 20:09:32 -0000 1.169
+++ source/blender/python/api2_2x/Object.c 20 Feb 2006 19:03:23 -0000
@@ -47,6 +47,7 @@
#include "DNA_oops_types.h"
#include "BKE_action.h"
+#include "BKE_anim.h"
#include "BKE_depsgraph.h"
#include "BKE_effect.h"
#include "BKE_font.h"
@@ -218,6 +219,10 @@
static PyObject *Object_makeParentVertex( BPy_Object * self, PyObject * args );
static PyObject *Object_materialUsage( void );
static PyObject *Object_getDupliVerts ( BPy_Object * self );
+static PyObject *Object_getDupliFrames ( BPy_Object * self );
+static PyObject *Object_getDupliGroup ( BPy_Object * self );
+static PyObject *Object_getDupliRot ( BPy_Object * self );
+static PyObject *Object_getDupliNoSpeed ( BPy_Object * self );
static PyObject *Object_getEffects( BPy_Object * self );
static PyObject *Object_setDeltaLocation( BPy_Object * self, PyObject * args );
static PyObject *Object_setDrawMode( BPy_Object * self, PyObject * args );
@@ -250,6 +255,10 @@
static PyObject *Object_addScriptLink( BPy_Object * self, PyObject * args );
static PyObject *Object_clearScriptLinks( BPy_Object * self, PyObject *args );
static PyObject *Object_setDupliVerts ( BPy_Object * self, PyObject * args );
+static PyObject *Object_setDupliFrames ( BPy_Object * self, PyObject * args );
+static PyObject *Object_setDupliGroup ( BPy_Object * self, PyObject * args );
+static PyObject *Object_setDupliRot ( BPy_Object * self , PyObject * args);
+static PyObject *Object_setDupliNoSpeed ( BPy_Object * self , PyObject * args);
static PyObject *Object_getPIStrength( BPy_Object * self );
static PyObject *Object_setPIStrength( BPy_Object * self, PyObject * args );
static PyObject *Object_getPIFalloff( BPy_Object * self );
@@ -474,7 +483,15 @@
{"getBoundBox", ( PyCFunction ) Object_getBoundBox, METH_NOARGS,
"Returns the object's bounding box"},
{"getDupliVerts", ( PyCFunction ) Object_getDupliVerts,
- METH_NOARGS, "Returns state of duplicates propertie"},
+ METH_VARARGS, "Returns state of duplicates propertie"},
+ {"getDupliFrames", ( PyCFunction ) Object_getDupliFrames,
+ METH_NOARGS, "Returns state of Frames duplicates propertie"},
+ {"getDupliGroup", ( PyCFunction ) Object_getDupliGroup,
+ METH_NOARGS, "Returns state of Group duplicates propertie"},
+ {"getDupliRot", ( PyCFunction ) Object_getDupliRot,
+ METH_NOARGS, "Returns state of Rot duplicates propertie"},
+ {"getDupliNoSpeed", ( PyCFunction ) Object_getDupliNoSpeed,
+ METH_NOARGS, "Returns state of Nospeed duplicates propertie"},
{"makeDisplayList", ( PyCFunction ) Object_makeDisplayList,
METH_NOARGS,
"Update this object's Display List. Some changes like turning \n\
@@ -600,7 +617,16 @@
"() - Delete all scriptlinks from this object.\n"
"([s1<,s2,s3...>]) - Delete specified scriptlinks from this object."},
{"setDupliVerts", ( PyCFunction ) Object_setDupliVerts,
- METH_VARARGS, "() - set or reset duplicate child objects on all vertices"},
+ METH_VARARGS, "() - set or reset duplicate child objects on all vertices"},
+ {"setDupliFrames", ( PyCFunction ) Object_setDupliFrames,
+ METH_VARARGS, "- set or reset state of Frames duplicates propertie"},
+ {"setDupliGroup", ( PyCFunction ) Object_setDupliGroup,
+ METH_VARARGS, "- set or reset state of Group duplicates propertie"},
+ {"setDupliRot", ( PyCFunction ) Object_setDupliRot,
+ METH_VARARGS, "- set or reset state of Rot duplicates propertie"},
+ {"setDupliNoSpeed", ( PyCFunction ) Object_setDupliNoSpeed,
+ METH_VARARGS, "- set or reset state of Nospeed duplicates propertie"},
+
{"insertShapeKey", ( PyCFunction ) Object_insertShapeKey,
METH_NOARGS, "() - Insert a Shape Key in the current object"},
{NULL, NULL, 0, NULL}
@@ -3064,7 +3090,7 @@
int setting= 0;
if( !PyArg_ParseTuple( args, "i", &setting ) ) {
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
- "expected a string") );
+ "expected an integer") );
}
if (self && self->object) {
if (setting)
@@ -3075,6 +3101,94 @@
return Py_None;
}
+static PyObject *Object_getDupliFrames ( BPy_Object * self ) {
+ if (self->object->transflag & OB_DUPLIFRAMES)
+ return EXPP_incr_ret_True ();
+ else
+ return EXPP_incr_ret_False();
+}
+
+static PyObject *Object_setDupliFrames ( BPy_Object * self, PyObject * args ) {
+ int setting= 0;
+ if( !PyArg_ParseTuple( args, "i", &setting ) ) {
+ return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
+ "expected an integer") );
+ }
+ if (self && self->object) {
+ if (setting)
+ self->object->transflag |= OB_DUPLIFRAMES;
+ else
+ self->object->transflag &= ~OB_DUPLIFRAMES;
+ }
+ return Py_None;
+}
+
+static PyObject *Object_getDupliGroup ( BPy_Object * self ) {
+ if (self->object->transflag & OB_DUPLIGROUP)
+ return EXPP_incr_ret_True ();
+ else
+ return EXPP_incr_ret_False();
+}
+
+static PyObject *Object_setDupliGroup ( BPy_Object * self, PyObject * args ) {
+ int setting= 0;
+ if( !PyArg_ParseTuple( args, "i", &setting ) ) {
+ return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
+ "expected an integer") );
+ }
+ if (self && self->object) {
+ if (setting)
+ self->object->transflag |= OB_DUPLIGROUP;
+ else
+ self->object->transflag &= ~OB_DUPLIGROUP;
+ }
+ return Py_None;
+}
+
+static PyObject *Object_getDupliRot ( BPy_Object * self ) {
+ if (self->object->transflag & OB_DUPLIROT)
+ return EXPP_incr_ret_True ();
+ else
+ return EXPP_incr_ret_False();
+}
+
+static PyObject *Object_setDupliRot ( BPy_Object * self, PyObject * args ) {
+ int setting= 0;
+ if( !PyArg_ParseTuple( args, "i", &setting ) ) {
+ return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
+ "expected an integer") );
+ }
+ if (self && self->object) {
+ if (setting)
+ self->object->transflag |= OB_DUPLIROT;
+ else
+ self->object->transflag &= ~OB_DUPLIROT;
+ }
+ return Py_None;
+}
+
+static PyObject *Object_getDupliNoSpeed ( BPy_Object * self ) {
+ if (self->object->transflag & OB_DUPLINOSPEED)
+ return EXPP_incr_ret_True ();
+ else
+ return EXPP_incr_ret_False();
+}
+
+static PyObject *Object_setDupliNoSpeed ( BPy_Object * self, PyObject * args ) {
+ int setting= 0;
+ if( !PyArg_ParseTuple( args, "i", &setting ) ) {
+ return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
+ "expected an integer") );
+ }
+ if (self && self->object) {
+ if (setting)
+ self->object->transflag |= OB_DUPLINOSPEED;
+ else
+ self->object->transflag &= ~OB_DUPLINOSPEED;
+ }
+ return Py_None;
+}
+
static PyObject *Object_getEffects( BPy_Object * self )
{
PyObject *effect_list;
@@ -3473,18 +3587,6 @@
if( StringEqual( name, "DupOff" ) )
return ( !PyArg_Parse( value, "h", &( object->dupoff ) ) );
- if( StringEqual( name, "Dupliframes" ) ) {
- short dupli;
- if ( !PyArg_Parse( value, "h", &dupli ) )
- return -1;
-
- if (dupli)
- obj->object->transflag |= OB_DUPLIFRAMES;
- else
- obj->object->transflag &= ~OB_DUPLIFRAMES;
-
- return 0;
- }
if( StringEqual( name, "colbits" ) )
return ( !PyArg_Parse( value, "h", &( object->colbits ) ) );
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
32/c8/51a91c9e408541faecd50a21caad
Event Timeline
Log In to Comment