- 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!
This commit is contained in:
Willian Padovani Germano
2004-11-30 02:27:46 +00:00
parent e4562134d2
commit 6d9c02be4c
25 changed files with 1000 additions and 1096 deletions

View File

@@ -195,7 +195,8 @@ PyObject *IpoCurve_Init( void )
/*****************************************************************************/
static PyObject *M_IpoCurve_Get( PyObject * self, PyObject * args )
{
return 0;
Py_INCREF(Py_None);
return Py_None;
}
/*****************************************************************************/

View File

@@ -57,9 +57,7 @@
/*****************************************************************************/
static PyObject *M_Object_New( PyObject * self, PyObject * args );
PyObject *M_Object_Get( PyObject * self, PyObject * args );
PyObject *M_Object_get( PyObject * self, PyObject * args );
static PyObject *M_Object_GetSelected( PyObject * self, PyObject * args );
static PyObject *M_Object_getSelected( PyObject * self, PyObject * args );
/*****************************************************************************/
/* The following string definitions are used for documentation strings. */
@@ -90,12 +88,8 @@ struct PyMethodDef M_Object_methods[] = {
M_Object_New_doc},
{"Get", ( PyCFunction ) M_Object_Get, METH_VARARGS,
M_Object_Get_doc},
{"get", ( PyCFunction ) M_Object_get, METH_VARARGS,
M_Object_Get_doc},
{"GetSelected", ( PyCFunction ) M_Object_GetSelected, METH_VARARGS,
M_Object_GetSelected_doc},
{"getSelected", ( PyCFunction ) M_Object_getSelected, METH_VARARGS,
M_Object_GetSelected_doc},
{NULL, NULL, 0, NULL}
};
@@ -516,21 +510,9 @@ PyObject *M_Object_Get( PyObject * self, PyObject * args )
}
}
/*****************************************************************************/
/* Function: M_Object_get */
/* Python equivalent: Blender.Object.get */
/*****************************************************************************/
PyObject *M_Object_get( PyObject * self, PyObject * args )
{
PyErr_Warn( PyExc_DeprecationWarning,
"The Object.get() function will be removed in Blender 2.29\n"
"Please update the script to use Object.Get" );
return ( M_Object_Get( self, args ) );
}
/*****************************************************************************/
/* Function: M_Object_GetSelected */
/* Python equivalent: Blender.Object.getSelected */
/* Python equivalent: Blender.Object.GetSelected */
/*****************************************************************************/
static PyObject *M_Object_GetSelected( PyObject * self, PyObject * args )
{
@@ -583,19 +565,6 @@ static PyObject *M_Object_GetSelected( PyObject * self, PyObject * args )
return ( list );
}
/*****************************************************************************/
/* Function: M_Object_getSelected */
/* Python equivalent: Blender.Object.getSelected */
/*****************************************************************************/
static PyObject *M_Object_getSelected( PyObject * self, PyObject * args )
{
PyErr_Warn( PyExc_DeprecationWarning,
"The Object.getSelected() function will be removed in "
"Blender 2.29\n"
"Please update the script to use Object.GetSelected" );
return ( M_Object_GetSelected( self, args ) );
}
/*****************************************************************************/
/* Function: initObject */
/*****************************************************************************/

View File

@@ -319,7 +319,7 @@ class Vector:
v = Blender.Mathutils.Vector([1,0,0])
@type list: PyList of float or int
@param list: The list of values for the Vector object.
Must be 2, 3, or 4 values.
Must be 2, 3, or 4 values. The list is mapped to the parameters as [x,y,z,w].
@rtype: Vector object.
@return: It depends wheter a parameter was passed:
- (list): Vector object initialized with the given values;
@@ -420,16 +420,16 @@ class Quaternion:
in degrees.
"""
def __init__(list = None, angle = None):
def __init__(list, angle = None):
"""
Create a new quaternion object from initialized values.
Example::
quat = Mathutils.Quaternion()
quat = Mathutils.Quaternion([1.0,0.0,0.0])
@type list: PyList of int/float
@param list: A 3d or 4d list to initialize quaternion.
4d if intializing, 3d if will be used as an axis of rotation.
4d if intializing [w,x,y,z], 3d if used as an axis of rotation.
@type angle: float (optional)
@param angle: An arbitrary rotation amount around 'list'.
List is used as an axis of rotation in this case.
@@ -527,7 +527,7 @@ class Matrix:
def determinant():
"""
Return a the determinant of a matrix.
Return the determinant of a matrix.
@rtype: int
@return: Return a the determinant of a matrix.
@@ -540,9 +540,12 @@ class Matrix:
def rotationPart():
"""
Return the 3d rotation matrix.
Return the 3d submatrix corresponding to the linear term of the
embedded affine transformation in 3d. This matrix represents rotation
and scale. Note that the (4,4) element of a matrix can be used for uniform
scaling, too.
@rtype: Matrix object.
@return: Return the 3d rotation matrix.
@return: Return the 3d matrix for rotation and scale.
"""
@@ -561,17 +564,17 @@ class Matrix:
def toEuler():
"""
Return a euler representing the rotation matrix.
Return an Euler representation of the rotation matrix.
@rtype: Euler object
@return: Return a euler representing the rotation matrix.
@return: Euler representation of the rotation matrix.
"""
def toQuat():
"""
Return a quaternion representation the rotation matrix
Return a quaternion representation of the rotation matrix
@rtype: Quaternion object
@return: Quaternion representation the rotation matrix
@return: Quaternion representation of the rotation matrix
"""

View File

@@ -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];