- Fixed small typo in doc file Object.py, reported by user Bill.
- Fixed bug #803:

Bug #803's Summary: print, type() or BezTriple broken

Trying to print type(BezTriple) was crashing Blender because
that type wasn't being initialized to PyType_Type. The other
problem is that the getName method for ipocurves only works for
object ipos.  A warning was added for when users try to use it
with other blocktypes,  we'll later update ipo related stuff in
bpython to work for all types.
This commit is contained in:
Willian Padovani Germano
2004-01-03 03:50:58 +00:00
parent dc343a17e5
commit de21846e69
4 changed files with 8 additions and 2 deletions

View File

@@ -193,6 +193,10 @@ static PyObject* IpoCurve_getName (C_IpoCurve *self)
{
char * nametab[24] = {"LocX","LocY","LocZ","dLocX","dLocY","dLocZ","RotX","RotY","RotZ","dRotX","dRotY","dRotZ","SizeX","SizeY","SizeZ","dSizeX","dSizeY","dSizeZ","Layer","Time","ColR","ColG","ColB","ColA"};
if (self->ipocurve->blocktype != ID_OB)
return EXPP_ReturnPyObjError (PyExc_TypeError,
"This function doesn't support this ipocurve type yet");
// printf("IpoCurve_getName %d\n",self->ipocurve->vartype);
if (self->ipocurve->adrcode <=0 )
return PyString_FromString("Index too small");

View File

@@ -49,6 +49,7 @@ PyObject *Types_Init (void)
constant_Type.ob_type = &PyType_Type;
buffer_Type.ob_type = &PyType_Type;
Button_Type.ob_type = &PyType_Type;
BezTriple_Type.ob_type = &PyType_Type;
/* Another one that needs to be here: */
Text_Type.ob_type = &PyType_Type;
@@ -99,6 +100,7 @@ PyObject *Types_Init (void)
PyDict_SetItemString(dict, "bufferType", (PyObject *)&buffer_Type);
PyDict_SetItemString(dict, "constantType", (PyObject *)&constant_Type);
PyDict_SetItemString(dict, "rgbTupleType", (PyObject *)&rgbTuple_Type);
PyDict_SetItemString(dict, "BezTripleType", (PyObject *)&BezTriple_Type);
return submodule;
}

View File

@@ -47,7 +47,7 @@ extern PyTypeObject Curve_Type, Ipo_Type, Metaball_Type;
extern PyTypeObject Lattice_Type;
extern PyTypeObject vector_Type, buffer_Type, rgbTuple_Type,
constant_Type;
constant_Type, BezTriple_Type;
static char M_Types_doc[] =
"The Blender Types module\n\n\

View File

@@ -8,7 +8,7 @@ This module provides access to the B{Object Data} in Blender.
Example::
import Blender
scene = Blencer.Scene.getCurrent () # get the current scene
scene = Blender.Scene.getCurrent () # get the current scene
ob = Blender.Object.New ('Camera') # make camera object
cam = Blender.Camera.New ('ortho') # make ortho camera data object
ob.link (cam) # link camera data with the object