diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2004-11-30 05:27:46 +0300 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2004-11-30 05:27:46 +0300 |
commit | 6d9c02be4cfd61b985af789e167f7fa78dbc0868 (patch) | |
tree | 1bb8758f454cb90e0659e6122f11ec13b02a7b3f /source/blender/python/api2_2x/quat.c | |
parent | e4562134d28af07b6115436fdfaa4523020ea733 (diff) |
Scripts:
- Fixes by Jean-Michel Soler: mod_ai2obj.py, mod_svg2obj.py;
- Fixes by Campbell Barton: obj_import.py;
- Small fix to mod_meshtools.py (fixes bug #1605: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1605&group_id=9);
- Updates by Jean-Baptiste (Jiba) to his blender2cal3d.py;
- Updates to all his import / export scripts (added doc data) by Anthony D'Agostino;
- Update to off_import: support for uv data, by Arne Schmitz.
BPython:
- Removed Object.get and .getSelected (deprecated long ago, we use .Get and .GetSelected) -- fixes #1861: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1861&group_id=9
- Applied patch by Michael Reimpell: quat.c - fix for wrong initialization with newQuaternionObject; Mathutils documentation improvements.
- Stani reported a wrong return msg in IpoCurve.Get (that is unimplemented).
Thanks to all coders mentioned above!
Diffstat (limited to 'source/blender/python/api2_2x/quat.c')
-rw-r--r-- | source/blender/python/api2_2x/quat.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/python/api2_2x/quat.c b/source/blender/python/api2_2x/quat.c index a6974ef5086..e87050b29ea 100644 --- a/source/blender/python/api2_2x/quat.c +++ b/source/blender/python/api2_2x/quat.c @@ -531,13 +531,17 @@ PyTypeObject quaternion_Type = { &Quaternion_SeqMethods, /*tp_as_sequence */ }; -/* - newQuaternionObject - - if the quat arg is not null, this method allocates memory and copies *quat into it. - we will free the memory in the dealloc routine. -*/ - +/** Creates a new quaternion object. + * + * Memory for a new quaternion is allocated. The quaternion copies the given + * list of parameters or initializes to the identity, if a <code>NULL</code> + * pointer is given as parameter. The memory will be freed in the dealloc + * routine. + * + * @param quat Pointer to a list of floats for the quanternion parameters w, x, y, z. + * @return Quaternion Python object. + * @see Quaternion_Identity + */ PyObject *newQuaternionObject( float *quat ) { QuaternionObject *self; @@ -550,10 +554,7 @@ PyObject *newQuaternionObject( float *quat ) self->quat = PyMem_Malloc( 4 * sizeof( float ) ); if( !quat ) { - for( x = 0; x < 4; x++ ) { - self->quat[x] = 0.0f; - } - self->quat[3] = 1.0f; + Quaternion_Identity(self); } else { for( x = 0; x < 4; x++ ) { self->quat[x] = quat[x]; |