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:
authorKen Hughes <khughes@pacific.edu>2006-05-04 17:42:12 +0400
committerKen Hughes <khughes@pacific.edu>2006-05-04 17:42:12 +0400
commit18a23ab8c91cecbbdfd2389453e1f8233c095075 (patch)
tree1d6281767b296b488171eefbe953b1d0a6b05c62 /source/blender/python/api2_2x/NLA.c
parent4646ee2aaa52205f85c30778046080f29642a6a4 (diff)
===Python API===
Bufgix #4171: Action_setName() didn't call rename_id(), messing up the internal database. Patch provided by Roland Hess (thanks).
Diffstat (limited to 'source/blender/python/api2_2x/NLA.c')
-rw-r--r--source/blender/python/api2_2x/NLA.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/NLA.c b/source/blender/python/api2_2x/NLA.c
index ce69f42275f..36a7ab2a422 100644
--- a/source/blender/python/api2_2x/NLA.c
+++ b/source/blender/python/api2_2x/NLA.c
@@ -260,6 +260,7 @@ static PyObject *Action_getName( BPy_Action * self )
static PyObject *Action_setName( BPy_Action * self, PyObject * args )
{
char *name;
+ char buf[21];
if( !self->action )
( EXPP_ReturnPyObjError( PyExc_RuntimeError,
@@ -270,10 +271,10 @@ static PyObject *Action_setName( BPy_Action * self, PyObject * args )
"expected string argument" ) );
//change name
- strcpy( self->action->id.name + 2, name );
+ PyOS_snprintf( buf, sizeof( buf ), "%s", name );
+ rename_id( &self->action->id, buf);
- Py_INCREF( Py_None );
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *Action_setActive( BPy_Action * self, PyObject * args )