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
path: root/source
diff options
context:
space:
mode:
authorWillian Padovani Germano <wpgermano@gmail.com>2004-01-03 06:50:58 +0300
committerWillian Padovani Germano <wpgermano@gmail.com>2004-01-03 06:50:58 +0300
commitde21846e690dd5a4606a42b776d55f119e5620d7 (patch)
treedad33441376915f0fd45e14bd68ad9c2ff9df675 /source
parentdc343a17e52560d1a4528447b05293aa7a99e8b4 (diff)
BPython:
- 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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/python/api2_2x/Ipocurve.c4
-rw-r--r--source/blender/python/api2_2x/Types.c2
-rw-r--r--source/blender/python/api2_2x/Types.h2
-rw-r--r--source/blender/python/api2_2x/doc/Object.py2
4 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/Ipocurve.c b/source/blender/python/api2_2x/Ipocurve.c
index 9ba3b3c3e87..56bb5f75226 100644
--- a/source/blender/python/api2_2x/Ipocurve.c
+++ b/source/blender/python/api2_2x/Ipocurve.c
@@ -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");
diff --git a/source/blender/python/api2_2x/Types.c b/source/blender/python/api2_2x/Types.c
index dbda9e936e2..0a45ceb89df 100644
--- a/source/blender/python/api2_2x/Types.c
+++ b/source/blender/python/api2_2x/Types.c
@@ -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;
}
diff --git a/source/blender/python/api2_2x/Types.h b/source/blender/python/api2_2x/Types.h
index 838b45c9d79..ea098cfb3eb 100644
--- a/source/blender/python/api2_2x/Types.h
+++ b/source/blender/python/api2_2x/Types.h
@@ -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\
diff --git a/source/blender/python/api2_2x/doc/Object.py b/source/blender/python/api2_2x/doc/Object.py
index bd0e9be32f9..ddbba307169 100644
--- a/source/blender/python/api2_2x/doc/Object.py
+++ b/source/blender/python/api2_2x/doc/Object.py
@@ -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