diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2005-05-22 11:22:34 +0400 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2005-05-22 11:22:34 +0400 |
commit | 2f3dbcc5b75922bdb0847fce5ce8a15d35443314 (patch) | |
tree | 189bc4fcd2a90f7c3085c68dd1f10051ce4cd797 /source/blender/python/api2_2x/Object.c | |
parent | ae2acbf49bf4370c07f165f30ea38f4a9c825fe4 (diff) |
BPython bug fixes:
- bug #2033 reported by Ken Hughes: Vertices of mesh parented to lattice is scaled incorrectly:
https://projects.blender.org/tracker/?func=detail&aid=2033&group_id=9&atid=125
- bug #2211 reported by German Alonso Tamayo (servivo): Add a vertex to a mesh with groups using a script and then edit that mesh hangs blender:
https://projects.blender.org/tracker/index.php?func=detail&aid=2211&group_id=9&atid=125
(#2211's hang was already fixed with previous commit, but this way should work better)
- doc updates (Ken reported missing info about Render slinks, thanks).
Diffstat (limited to 'source/blender/python/api2_2x/Object.c')
-rw-r--r-- | source/blender/python/api2_2x/Object.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index 78b66b683bc..2f92aef0505 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -1553,6 +1553,12 @@ static PyObject *Object_makeParent( BPy_Object * self, PyObject * args ) "expected a list of objects" ) ); } + parent = ( Object * ) self->object; + + if (parent->id.us == 0) + return EXPP_ReturnPyObjError (PyExc_RuntimeError, + "object must be linked to a scene before it can become a parent"); + /* Check if the PyObject passed in list is a Blender object. */ for( i = 0; i < PySequence_Length( list ); i++ ) { child = NULL; @@ -1561,12 +1567,13 @@ static PyObject *Object_makeParent( BPy_Object * self, PyObject * args ) child = ( Object * ) Object_FromPyObject( py_child ); if( child == NULL ) { + Py_DECREF (py_child); return ( EXPP_ReturnPyObjError( PyExc_TypeError, "Object Type expected" ) ); } - parent = ( Object * ) self->object; if( test_parent_loop( parent, child ) ) { + Py_DECREF (py_child); return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "parenting loop detected - parenting failed" ) ); } @@ -1587,7 +1594,7 @@ static PyObject *Object_makeParent( BPy_Object * self, PyObject * args ) sort_baselist( G.scene ); } // We don't need the child object anymore. - //Py_DECREF ((PyObject *) child); + Py_DECREF (py_child); } return EXPP_incr_ret( Py_None ); } |