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:
authorRoland Hess <me@harkyman.com>2006-08-31 20:30:14 +0400
committerRoland Hess <me@harkyman.com>2006-08-31 20:30:14 +0400
commit82b40b1fc48e0c877b5c2b41cb1efaa38cf1c453 (patch)
tree68cf949e45d2c2af396cb746c2d605021fbdee39 /source/blender/python/api2_2x/NLA.c
parent32c51f3338d2ddd7cec84c24aafb1cf7df410f5a (diff)
Adds groupTarget get/setters to the NLA API. Takes an object and returns an
object. groupTarget tells the animation system which object within a dupligroup should be used for NLA. Equivalent to filling in the "target" field in the NLA N-key panel. Set groupTarget to None to remove the target. Also, cleaned up some bad copy and pastes in existing NLA docs. Also, cleaned up some bad copy and pastes in existing NLA docs.
Diffstat (limited to 'source/blender/python/api2_2x/NLA.c')
-rw-r--r--source/blender/python/api2_2x/NLA.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/NLA.c b/source/blender/python/api2_2x/NLA.c
index dadfe239f26..e7503ce9912 100644
--- a/source/blender/python/api2_2x/NLA.c
+++ b/source/blender/python/api2_2x/NLA.c
@@ -907,6 +907,19 @@ static PyObject *ActionStrip_getStrideBone( BPy_ActionStrip * self )
return PyString_FromString( self->strip->stridechannel );
}
+static PyObject *ActionStrip_getGroupTarget( BPy_ActionStrip * self )
+{
+ if( !self->strip )
+ return EXPP_ReturnPyObjError( PyExc_RuntimeError,
+ "This strip has been removed!" );
+
+ if (self->strip->object) {
+ return Object_CreatePyObject( self->strip->object );
+ } else {
+ Py_RETURN_NONE;
+ }
+}
+
/*
* set the stride bone name
*/
@@ -926,6 +939,22 @@ static int ActionStrip_setStrideBone( BPy_ActionStrip * self, PyObject * attr )
return 0;
}
+static int ActionStrip_setGroupTarget( BPy_ActionStrip * self, PyObject * args )
+{
+ if( !self->strip )
+ return EXPP_ReturnIntError( PyExc_RuntimeError,
+ "This strip has been removed!" );
+
+ if( (PyObject *)args == Py_None )
+ self->strip->object = NULL;
+ else if( BPy_Object_Check( args ) )
+ self->strip->object = ((BPy_Object *)args)->object;
+ else
+ return EXPP_ReturnIntError( PyExc_TypeError,
+ "expected an object or None" );
+ return 0;
+}
+
/*****************************************************************************/
/* Python BPy_Constraint attributes get/set structure: */
/*****************************************************************************/
@@ -969,6 +998,9 @@ static PyGetSetDef BPy_ActionStrip_getseters[] = {
{"strideBone",
(getter)ActionStrip_getStrideBone, (setter)ActionStrip_setStrideBone,
"Name of Bone used for stride", NULL},
+ {"groupTarget",
+ (getter)ActionStrip_getGroupTarget, (setter)ActionStrip_setGroupTarget,
+ "Name of target armature within group", NULL},
{NULL,NULL,NULL,NULL,NULL} /* Sentinel */
};