| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2004-09-18 18:47:03 +00:00
										 |  |  |  * $Id$ | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This program is free software; you can redistribute it and/or | 
					
						
							|  |  |  |  * modify it under the terms of the GNU General Public License | 
					
						
							|  |  |  |  * as published by the Free Software Foundation; either version 2 | 
					
						
							|  |  |  |  * of the License, or (at your option) any later version. The Blender | 
					
						
							|  |  |  |  * Foundation also sells licenses for use in proprietary software under | 
					
						
							|  |  |  |  * the Blender License.  See http://www.blender.org/BL/ for information
 | 
					
						
							|  |  |  |  * about this. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  |  * GNU General Public License for more details. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  |  * along with this program; if not, write to the Free Software Foundation, | 
					
						
							|  |  |  |  * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. | 
					
						
							|  |  |  |  * All rights reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This is a new part of Blender. | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  |  * Contributor(s): Jacques Guignot, Nathan Letwory | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * ***** END GPL/BL DUAL LICENSE BLOCK ***** | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "Ipo.h"
 | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include <BKE_main.h>
 | 
					
						
							|  |  |  | #include <BKE_global.h>
 | 
					
						
							|  |  |  | #include <BKE_object.h>
 | 
					
						
							|  |  |  | #include <BKE_library.h>
 | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | #include <BSE_editipo.h>
 | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | #include <BLI_blenlib.h>
 | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | #include <BIF_space.h>
 | 
					
						
							|  |  |  | #include <BSE_editipo.h>
 | 
					
						
							|  |  |  | #include <mydevice.h>
 | 
					
						
							| 
									
										
										
										
											2004-10-07 19:25:40 +00:00
										 |  |  | #include <DNA_curve_types.h>
 | 
					
						
							| 
									
										
										
										
											2005-04-24 19:03:39 +00:00
										 |  |  | #include <MEM_guardedalloc.h>
 | 
					
						
							| 
									
										
										
										
											2004-10-07 19:25:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "Ipocurve.h"
 | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | #include "constant.h"
 | 
					
						
							|  |  |  | #include "gen_utils.h"
 | 
					
						
							| 
									
										
										
										
											2004-10-07 19:25:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | /* Python API function prototypes for the Ipo module.                        */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *M_Ipo_New( PyObject * self, PyObject * args ); | 
					
						
							|  |  |  | static PyObject *M_Ipo_Get( PyObject * self, PyObject * args ); | 
					
						
							|  |  |  | static PyObject *M_Ipo_Recalc( PyObject * self, PyObject * args ); | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | /* The following string definitions are used for documentation strings.      */ | 
					
						
							|  |  |  | /* In Python these will be written to the console when doing a               */ | 
					
						
							|  |  |  | /* Blender.Ipo.__doc__                                                       */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | char M_Ipo_doc[] = ""; | 
					
						
							|  |  |  | char M_Ipo_New_doc[] = ""; | 
					
						
							|  |  |  | char M_Ipo_Get_doc[] = ""; | 
					
						
							| 
									
										
										
										
											2003-07-21 00:08:30 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Python method structure definition for Blender.Ipo module:             */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2003-07-21 00:08:30 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | struct PyMethodDef M_Ipo_methods[] = { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"New", ( PyCFunction ) M_Ipo_New, METH_VARARGS | METH_KEYWORDS, | 
					
						
							|  |  |  | 	 M_Ipo_New_doc}, | 
					
						
							|  |  |  | 	{"Get", M_Ipo_Get, METH_VARARGS, M_Ipo_Get_doc}, | 
					
						
							|  |  |  | 	{"get", M_Ipo_Get, METH_VARARGS, M_Ipo_Get_doc}, | 
					
						
							|  |  |  | 	{"Recalc", M_Ipo_Recalc, METH_VARARGS, M_Ipo_Get_doc}, | 
					
						
							|  |  |  | 	{NULL, NULL, 0, NULL} | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Python BPy_Ipo methods declarations:                                     */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *Ipo_getName( BPy_Ipo * self ); | 
					
						
							|  |  |  | static PyObject *Ipo_setName( BPy_Ipo * self, PyObject * args ); | 
					
						
							|  |  |  | static PyObject *Ipo_getBlocktype( BPy_Ipo * self ); | 
					
						
							|  |  |  | static PyObject *Ipo_setBlocktype( BPy_Ipo * self, PyObject * args ); | 
					
						
							|  |  |  | static PyObject *Ipo_getRctf( BPy_Ipo * self ); | 
					
						
							|  |  |  | static PyObject *Ipo_setRctf( BPy_Ipo * self, PyObject * args ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject *Ipo_getCurve( BPy_Ipo * self, PyObject * args ); | 
					
						
							|  |  |  | static PyObject *Ipo_getCurves( BPy_Ipo * self ); | 
					
						
							|  |  |  | static PyObject *Ipo_addCurve( BPy_Ipo * self, PyObject * args ); | 
					
						
							| 
									
										
										
										
											2005-04-24 19:03:39 +00:00
										 |  |  | static PyObject *Ipo_delCurve( BPy_Ipo * self, PyObject * args ); | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *Ipo_getNcurves( BPy_Ipo * self ); | 
					
						
							|  |  |  | static PyObject *Ipo_getNBezPoints( BPy_Ipo * self, PyObject * args ); | 
					
						
							|  |  |  | static PyObject *Ipo_DeleteBezPoints( BPy_Ipo * self, PyObject * args ); | 
					
						
							|  |  |  | static PyObject *Ipo_getCurveBP( BPy_Ipo * self, PyObject * args ); | 
					
						
							|  |  |  | static PyObject *Ipo_getCurvecurval( BPy_Ipo * self, PyObject * args ); | 
					
						
							|  |  |  | static PyObject *Ipo_EvaluateCurveOn( BPy_Ipo * self, PyObject * args ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject *Ipo_setCurveBeztriple( BPy_Ipo * self, PyObject * args ); | 
					
						
							|  |  |  | static PyObject *Ipo_getCurveBeztriple( BPy_Ipo * self, PyObject * args ); | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Python BPy_Ipo methods table:                                            */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | static PyMethodDef BPy_Ipo_methods[] = { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	/* name, method, flags, doc */ | 
					
						
							|  |  |  | 	{"getName", ( PyCFunction ) Ipo_getName, METH_NOARGS, | 
					
						
							|  |  |  | 	 "() - Return Ipo Data name"}, | 
					
						
							|  |  |  | 	{"setName", ( PyCFunction ) Ipo_setName, METH_VARARGS, | 
					
						
							|  |  |  | 	 "(str) - Change Ipo Data name"}, | 
					
						
							|  |  |  | 	{"getBlocktype", ( PyCFunction ) Ipo_getBlocktype, METH_NOARGS, | 
					
						
							|  |  |  | 	 "() - Return Ipo blocktype -"}, | 
					
						
							|  |  |  | 	{"setBlocktype", ( PyCFunction ) Ipo_setBlocktype, METH_VARARGS, | 
					
						
							|  |  |  | 	 "(str) - Change Ipo blocktype"}, | 
					
						
							|  |  |  | 	{"getRctf", ( PyCFunction ) Ipo_getRctf, METH_NOARGS, | 
					
						
							|  |  |  | 	 "() - Return Ipo rctf - "}, | 
					
						
							|  |  |  | 	{"setRctf", ( PyCFunction ) Ipo_setRctf, METH_VARARGS, | 
					
						
							|  |  |  | 	 "(str) - Change Ipo rctf"}, | 
					
						
							|  |  |  | 	{"addCurve", ( PyCFunction ) Ipo_addCurve, METH_VARARGS, | 
					
						
							|  |  |  | 	 "() - Return Ipo ncurves"}, | 
					
						
							| 
									
										
										
										
											2005-04-24 19:03:39 +00:00
										 |  |  | 	{"delCurve", ( PyCFunction ) Ipo_delCurve, METH_VARARGS, | 
					
						
							|  |  |  | 	 "() - Delete Ipo curves"}, | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	{"getNcurves", ( PyCFunction ) Ipo_getNcurves, METH_NOARGS, | 
					
						
							|  |  |  | 	 "() - Return Ipo ncurves"}, | 
					
						
							|  |  |  | 	{"getNBezPoints", ( PyCFunction ) Ipo_getNBezPoints, METH_VARARGS, | 
					
						
							|  |  |  | 	 "() - Return curve number of Bez points"}, | 
					
						
							|  |  |  | 	{"delBezPoint", ( PyCFunction ) Ipo_DeleteBezPoints, METH_VARARGS, | 
					
						
							|  |  |  | 	 "() - Return curve number of Bez points"}, | 
					
						
							|  |  |  | 	{"getCurveBP", ( PyCFunction ) Ipo_getCurveBP, METH_VARARGS, | 
					
						
							|  |  |  | 	 "() - Return Ipo ncurves"}, | 
					
						
							|  |  |  | 	{"EvaluateCurveOn", ( PyCFunction ) Ipo_EvaluateCurveOn, METH_VARARGS, | 
					
						
							|  |  |  | 	 "() - Return curve value at given time"}, | 
					
						
							|  |  |  | 	{"getCurveCurval", ( PyCFunction ) Ipo_getCurvecurval, METH_VARARGS, | 
					
						
							|  |  |  | 	 "() - Return curval"}, | 
					
						
							|  |  |  | 	{"getCurveBeztriple", ( PyCFunction ) Ipo_getCurveBeztriple, | 
					
						
							|  |  |  | 	 METH_VARARGS, | 
					
						
							|  |  |  | 	 "() - Return Ipo ncurves"}, | 
					
						
							|  |  |  | 	{"setCurveBeztriple", ( PyCFunction ) Ipo_setCurveBeztriple, | 
					
						
							|  |  |  | 	 METH_VARARGS, | 
					
						
							|  |  |  | 	 "() - Return curval"}, | 
					
						
							|  |  |  | 	{"getCurves", ( PyCFunction ) Ipo_getCurves, METH_NOARGS, | 
					
						
							|  |  |  | 	 "() - Return curval"}, | 
					
						
							|  |  |  | 	{"getCurve", ( PyCFunction ) Ipo_getCurve, METH_VARARGS, | 
					
						
							|  |  |  | 	 "() - Return curval"}, | 
					
						
							|  |  |  | 	{NULL, NULL, 0, NULL} | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Python Ipo_Type callback function prototypes:                          */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static void IpoDeAlloc( BPy_Ipo * self ); | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | //static int IpoPrint (BPy_Ipo *self, FILE *fp, int flags);
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static int IpoSetAttr( BPy_Ipo * self, char *name, PyObject * v ); | 
					
						
							|  |  |  | static PyObject *IpoGetAttr( BPy_Ipo * self, char *name ); | 
					
						
							|  |  |  | static PyObject *IpoRepr( BPy_Ipo * self ); | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Python Ipo_Type structure definition:                                  */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | PyTypeObject Ipo_Type = { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 	PyObject_HEAD_INIT( NULL ) /* required macro */ 0,	/* ob_size */ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	"Ipo",			/* tp_name */ | 
					
						
							|  |  |  | 	sizeof( BPy_Ipo ),	/* tp_basicsize */ | 
					
						
							|  |  |  | 	0,			/* tp_itemsize */ | 
					
						
							|  |  |  | 	/* methods */ | 
					
						
							|  |  |  | 	( destructor ) IpoDeAlloc,	/* tp_dealloc */ | 
					
						
							|  |  |  | 	0,			/* tp_print */ | 
					
						
							|  |  |  | 	( getattrfunc ) IpoGetAttr,	/* tp_getattr */ | 
					
						
							|  |  |  | 	( setattrfunc ) IpoSetAttr,	/* tp_setattr */ | 
					
						
							|  |  |  | 	0,			/* tp_compare */ | 
					
						
							|  |  |  | 	( reprfunc ) IpoRepr,	/* tp_repr */ | 
					
						
							|  |  |  | 	0,			/* tp_as_number */ | 
					
						
							|  |  |  | 	0,			/* tp_as_sequence */ | 
					
						
							|  |  |  | 	0,			/* tp_as_mapping */ | 
					
						
							|  |  |  | 	0,			/* tp_as_hash */ | 
					
						
							|  |  |  | 	0, 0, 0, 0, 0, 0, | 
					
						
							|  |  |  | 	0,			/* tp_doc */ | 
					
						
							|  |  |  | 	0, 0, 0, 0, 0, 0, | 
					
						
							|  |  |  | 	BPy_Ipo_methods,	/* tp_methods */ | 
					
						
							|  |  |  | 	0,			/* tp_members */ | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:              M_Ipo_New                                          */ | 
					
						
							|  |  |  | /* Python equivalent:     Blender.Ipo.New                                    */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *M_Ipo_New( PyObject * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	Ipo *add_ipo( char *name, int idcode ); | 
					
						
							|  |  |  | 	char *name = NULL, *code = NULL; | 
					
						
							|  |  |  | 	int idcode = -1; | 
					
						
							|  |  |  | 	BPy_Ipo *pyipo; | 
					
						
							|  |  |  | 	Ipo *blipo; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( !PyArg_ParseTuple( args, "ss", &code, &name ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, | 
					
						
							|  |  |  | 			   "expected string string arguments" ) ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( !strcmp( code, "Object" ) ) | 
					
						
							|  |  |  | 		idcode = ID_OB; | 
					
						
							|  |  |  | 	if( !strcmp( code, "Camera" ) ) | 
					
						
							|  |  |  | 		idcode = ID_CA; | 
					
						
							|  |  |  | 	if( !strcmp( code, "World" ) ) | 
					
						
							|  |  |  | 		idcode = ID_WO; | 
					
						
							|  |  |  | 	if( !strcmp( code, "Material" ) ) | 
					
						
							|  |  |  | 		idcode = ID_MA; | 
					
						
							|  |  |  | 	if( !strcmp( code, "Texture" ) ) | 
					
						
							|  |  |  | 		idcode = ID_TE; | 
					
						
							|  |  |  | 	if( !strcmp( code, "Lamp" ) ) | 
					
						
							|  |  |  | 		idcode = ID_LA; | 
					
						
							|  |  |  | 	if( !strcmp( code, "Action" ) ) | 
					
						
							|  |  |  | 		idcode = ID_AC; | 
					
						
							|  |  |  | 	if( !strcmp( code, "Constraint" ) ) | 
					
						
							|  |  |  | 		idcode = IPO_CO; | 
					
						
							|  |  |  | 	if( !strcmp( code, "Sequence" ) ) | 
					
						
							|  |  |  | 		idcode = ID_SEQ; | 
					
						
							|  |  |  | 	if( !strcmp( code, "Curve" ) ) | 
					
						
							|  |  |  | 		idcode = ID_CU; | 
					
						
							|  |  |  | 	if( !strcmp( code, "Key" ) ) | 
					
						
							|  |  |  | 		idcode = ID_KE; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( idcode == -1 ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "Bad code" ) ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	blipo = add_ipo( name, idcode ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( blipo ) { | 
					
						
							|  |  |  | 		/* return user count to zero because add_ipo() inc'd it */ | 
					
						
							|  |  |  | 		blipo->id.us = 0; | 
					
						
							|  |  |  | 		/* create python wrapper obj */ | 
					
						
							|  |  |  | 		pyipo = ( BPy_Ipo * ) PyObject_NEW( BPy_Ipo, &Ipo_Type ); | 
					
						
							|  |  |  | 	} else | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, | 
					
						
							|  |  |  | 						"couldn't create Ipo Data in Blender" ) ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( pyipo == NULL ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_MemoryError, | 
					
						
							|  |  |  | 						"couldn't create Ipo Data object" ) ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	pyipo->ipo = blipo; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return ( PyObject * ) pyipo; | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:              M_Ipo_Get                                       */ | 
					
						
							|  |  |  | /* Python equivalent:     Blender.Ipo.Get                                 */ | 
					
						
							|  |  |  | /* Description:           Receives a string and returns the ipo data obj  */ | 
					
						
							|  |  |  | /*                        whose name matches the string.  If no argument is  */ | 
					
						
							|  |  |  | /*                        passed in, a list of all ipo data names in the  */ | 
					
						
							|  |  |  | /*                        current scene is returned.                         */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *M_Ipo_Get( PyObject * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	char *name = NULL; | 
					
						
							|  |  |  | 	Ipo *ipo_iter; | 
					
						
							|  |  |  | 	PyObject *ipolist, *pyobj; | 
					
						
							|  |  |  | 	BPy_Ipo *wanted_ipo = NULL; | 
					
						
							|  |  |  | 	char error_msg[64]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( !PyArg_ParseTuple( args, "|s", &name ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError( PyExc_TypeError, | 
					
						
							|  |  |  | 						"expected string argument (or nothing)" ) ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ipo_iter = G.main->ipo.first; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( name ) {		/* (name) - Search ipo by name */ | 
					
						
							|  |  |  | 		while( ( ipo_iter ) && ( wanted_ipo == NULL ) ) { | 
					
						
							|  |  |  | 			if( strcmp( name, ipo_iter->id.name + 2 ) == 0 ) { | 
					
						
							|  |  |  | 				wanted_ipo = | 
					
						
							|  |  |  | 					( BPy_Ipo * ) PyObject_NEW( BPy_Ipo, | 
					
						
							|  |  |  | 								    &Ipo_Type ); | 
					
						
							|  |  |  | 				if( wanted_ipo ) | 
					
						
							|  |  |  | 					wanted_ipo->ipo = ipo_iter; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			ipo_iter = ipo_iter->id.next; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		if( wanted_ipo == NULL ) {	/* Requested ipo doesn't exist */ | 
					
						
							|  |  |  | 			PyOS_snprintf( error_msg, sizeof( error_msg ), | 
					
						
							|  |  |  | 				       "Ipo \"%s\" not found", name ); | 
					
						
							|  |  |  | 			return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 				 ( PyExc_NameError, error_msg ) ); | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		return ( PyObject * ) wanted_ipo; | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	else {			/* () - return a list with all ipos in the scene */ | 
					
						
							|  |  |  | 		int index = 0; | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 		ipolist = PyList_New( BLI_countlist( &( G.main->ipo ) ) ); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 		if( ipolist == NULL ) | 
					
						
							|  |  |  | 			return ( EXPP_ReturnPyObjError( PyExc_MemoryError, | 
					
						
							|  |  |  | 							"couldn't create PyList" ) ); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 		while( ipo_iter ) { | 
					
						
							|  |  |  | 			pyobj = Ipo_CreatePyObject( ipo_iter ); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 			if( !pyobj ) | 
					
						
							|  |  |  | 				return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 					 ( PyExc_MemoryError, | 
					
						
							|  |  |  | 					   "couldn't create PyString" ) ); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 			PyList_SET_ITEM( ipolist, index, pyobj ); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 			ipo_iter = ipo_iter->id.next; | 
					
						
							|  |  |  | 			index++; | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 		return ( ipolist ); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-07-19 08:32:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *M_Ipo_Recalc( PyObject * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	void testhandles_ipocurve( IpoCurve * icu ); | 
					
						
							|  |  |  | 	PyObject *a; | 
					
						
							|  |  |  | 	IpoCurve *icu; | 
					
						
							|  |  |  | 	if( !PyArg_ParseTuple( args, "O", &a ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "expected ipo argument)" ) ); | 
					
						
							|  |  |  | 	icu = IpoCurve_FromPyObject( a ); | 
					
						
							|  |  |  | 	testhandles_ipocurve( icu ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-07-19 08:32:01 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2003-06-28 07:38:21 +00:00
										 |  |  | /* Function:              Ipo_Init                                           */ | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Ipo_Init( void ) | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PyObject *submodule; | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	Ipo_Type.ob_type = &PyType_Type; | 
					
						
							| 
									
										
										
										
											2003-06-12 04:51:50 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	submodule = Py_InitModule3( "Blender.Ipo", M_Ipo_methods, M_Ipo_doc ); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	return ( submodule ); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2003-10-28 00:29:37 +00:00
										 |  |  | /* Python BPy_Ipo methods:                                                  */ | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *Ipo_getName( BPy_Ipo * self ) | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PyObject *attr = PyString_FromString( self->ipo->id.name + 2 ); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( attr ) | 
					
						
							|  |  |  | 		return attr; | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2003-07-19 08:32:01 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *Ipo_setName( BPy_Ipo * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	char *name; | 
					
						
							|  |  |  | 	char buf[21]; | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( !PyArg_ParseTuple( args, "s", &name ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "expected string argument" ) ); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PyOS_snprintf( buf, sizeof( buf ), "%s", name ); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	rename_id( &self->ipo->id, buf ); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *Ipo_getBlocktype( BPy_Ipo * self ) | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PyObject *attr = PyInt_FromLong( self->ipo->blocktype ); | 
					
						
							|  |  |  | 	if( attr ) | 
					
						
							|  |  |  | 		return attr; | 
					
						
							|  |  |  | 	return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 		 ( PyExc_RuntimeError, | 
					
						
							|  |  |  | 		   "couldn't get Ipo.blocktype attribute" ) ); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *Ipo_setBlocktype( BPy_Ipo * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	int blocktype = 0; | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( !PyArg_ParseTuple( args, "i", &blocktype ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "expected string argument" ) ); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	self->ipo->blocktype = ( short ) blocktype; | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *Ipo_getRctf( BPy_Ipo * self ) | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PyObject *l = PyList_New( 0 ); | 
					
						
							|  |  |  | 	PyList_Append( l, PyFloat_FromDouble( self->ipo->cur.xmin ) ); | 
					
						
							|  |  |  | 	PyList_Append( l, PyFloat_FromDouble( self->ipo->cur.xmax ) ); | 
					
						
							|  |  |  | 	PyList_Append( l, PyFloat_FromDouble( self->ipo->cur.ymin ) ); | 
					
						
							|  |  |  | 	PyList_Append( l, PyFloat_FromDouble( self->ipo->cur.ymax ) ); | 
					
						
							|  |  |  | 	return l; | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *Ipo_setRctf( BPy_Ipo * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	float v[4]; | 
					
						
							|  |  |  | 	if( !PyArg_ParseTuple( args, "ffff", v, v + 1, v + 2, v + 3 ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "expected 4 float argument" ) ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	self->ipo->cur.xmin = v[0]; | 
					
						
							|  |  |  | 	self->ipo->cur.xmax = v[1]; | 
					
						
							|  |  |  | 	self->ipo->cur.ymin = v[2]; | 
					
						
							|  |  |  | 	self->ipo->cur.ymax = v[3]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *Ipo_getNcurves( BPy_Ipo * self ) | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	int i = 0; | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	IpoCurve *icu; | 
					
						
							|  |  |  | 	for( icu = self->ipo->curve.first; icu; icu = icu->next ) { | 
					
						
							|  |  |  | 		i++; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	return ( PyInt_FromLong( i ) ); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | /* 
 | 
					
						
							|  |  |  |    fixme:  all these name validation routines need attention. | 
					
						
							|  |  |  |    I just hacked in lots of 'return 1;'s as a temp fix. | 
					
						
							|  |  |  |    stiv 6-jan-2004 | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-03-09 19:45:59 +00:00
										 |  |  | static int Ipo_laIcuName( char *s, int *param ) | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	int ok = 0; | 
					
						
							|  |  |  | 	if( !strcmp( s, "Energy" ) ) { | 
					
						
							|  |  |  | 		*param = LA_ENERGY; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "R" ) ) { | 
					
						
							|  |  |  | 		*param = LA_COL_R; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "G" ) ) { | 
					
						
							|  |  |  | 		*param = LA_COL_G; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "B" ) ) { | 
					
						
							|  |  |  | 		*param = LA_COL_B; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Dist" ) ) { | 
					
						
							|  |  |  | 		*param = LA_DIST; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "SpoSi" ) ) { | 
					
						
							|  |  |  | 		*param = LA_SPOTSI; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "SpoBl" ) ) { | 
					
						
							|  |  |  | 		*param = LA_SPOTBL; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Quad1" ) ) { | 
					
						
							|  |  |  | 		*param = LA_QUAD1; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Quad2" ) ) { | 
					
						
							|  |  |  | 		*param = LA_QUAD2; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "HaInt" ) ) { | 
					
						
							|  |  |  | 		*param = LA_HALOINT; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	return ok; | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-03-09 19:45:59 +00:00
										 |  |  | static int Ipo_woIcuName( char *s, int *param ) | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	int ok = 0; | 
					
						
							|  |  |  | 	if( !strcmp( s, "HorR" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = WO_HOR_R; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "HorG" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = WO_HOR_G; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "HorB" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = WO_HOR_B; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "ZenR" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = WO_ZEN_R; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "ZenG" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = WO_ZEN_G; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "ZenB" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = WO_ZEN_B; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Expos" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = WO_EXPOS; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Misi" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = WO_MISI; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "MisDi" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = WO_MISTDI; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "MisHi" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = WO_MISTHI; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "StarR" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = WO_STAR_R; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "StarB" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = WO_STAR_B; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "StarG" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = WO_STAR_G; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "ClSta" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = WO_MISTSTA; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "StarDi" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = WO_STARDIST; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "StarSi" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = WO_STARSIZE; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	return ok; | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-03-09 19:45:59 +00:00
										 |  |  | static int Ipo_maIcuName( char *s, int *param ) | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	int ok = 0; | 
					
						
							|  |  |  | 	if( !strcmp( s, "R" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_COL_R; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "G" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_COL_G; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "B" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_COL_B; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "SpecR" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_SPEC_R; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "SpecG" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_SPEC_G; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "SpecB" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_SPEC_B; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "MirR" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_MIR_R; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "MirG" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_MIR_G; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "MirB" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_MIR_B; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Ref" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_REF; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Alpha" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_ALPHA; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Emit" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_EMIT; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Amb" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_AMB; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Spec" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_SPEC; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Hard" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_HARD; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "SpTra" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_SPTR; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Ior" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_IOR; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Mode" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_MODE; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "HaSize" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_HASIZE; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Translu" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_TRANSLU; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "RayMir" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_RAYM; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "FresMir" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_FRESMIR; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "FresMirI" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_FRESMIRI; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "FresTra" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_FRESTRA; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "FresTraI" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_FRESTRAI; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "TraGlow" ) ) { | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 		*param = MA_ADD; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	return ok; | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-03-09 19:45:59 +00:00
										 |  |  | static int Ipo_keIcuName( char *s, int *param ) | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	char key[10]; | 
					
						
							|  |  |  | 	int ok = 0; | 
					
						
							|  |  |  | 	int nr = 0; | 
					
						
							|  |  |  | 	if( !strcmp( s, "Speed" ) ) { | 
					
						
							|  |  |  | 		*param = KEY_SPEED; | 
					
						
							|  |  |  | 		ok = 1; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	for( nr = 1; nr < 64; nr++ ) { | 
					
						
							|  |  |  | 		sprintf( key, "Key %d", nr ); | 
					
						
							|  |  |  | 		if( !strcmp( s, key ) ) { | 
					
						
							|  |  |  | 			*param = nr; | 
					
						
							|  |  |  | 			ok = 1; | 
					
						
							|  |  |  | 			break; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return ok; | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-03-09 19:45:59 +00:00
										 |  |  | static int Ipo_seqIcuName( char *s, int *param ) | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	int ok = 0; | 
					
						
							|  |  |  | 	if( !strcmp( s, "Fac" ) ) { | 
					
						
							|  |  |  | 		*param = SEQ_FAC1; | 
					
						
							|  |  |  | 		ok = 1; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return ok; | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-03-09 19:45:59 +00:00
										 |  |  | static int Ipo_cuIcuName( char *s, int *param ) | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	int ok = 0; | 
					
						
							|  |  |  | 	if( !strcmp( s, "Speed" ) ) { | 
					
						
							|  |  |  | 		*param = CU_SPEED; | 
					
						
							|  |  |  | 		ok = 1; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return ok; | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-03-09 19:45:59 +00:00
										 |  |  | static int Ipo_coIcuName( char *s, int *param ) | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	int ok = 0; | 
					
						
							|  |  |  | 	if( !strcmp( s, "Inf" ) ) { | 
					
						
							|  |  |  | 		*param = CO_ENFORCE; | 
					
						
							|  |  |  | 		ok = 1; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return ok; | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-03-09 19:45:59 +00:00
										 |  |  | static int Ipo_acIcuName( char *s, int *param ) | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	int ok = 0; | 
					
						
							|  |  |  | 	if( !strcmp( s, "LocX" ) ) { | 
					
						
							|  |  |  | 		*param = AC_LOC_X; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "LocY" ) ) { | 
					
						
							|  |  |  | 		*param = AC_LOC_Y; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "LocZ" ) ) { | 
					
						
							|  |  |  | 		*param = AC_LOC_Z; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "SizeX" ) ) { | 
					
						
							|  |  |  | 		*param = AC_SIZE_X; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "SizeY" ) ) { | 
					
						
							|  |  |  | 		*param = AC_SIZE_Y; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "SizeZ" ) ) { | 
					
						
							|  |  |  | 		*param = AC_SIZE_Z; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "QuatX" ) ) { | 
					
						
							|  |  |  | 		*param = AC_QUAT_X; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "QuatY" ) ) { | 
					
						
							|  |  |  | 		*param = AC_QUAT_Y; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "QuatZ" ) ) { | 
					
						
							|  |  |  | 		*param = AC_QUAT_Z; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "QuatW" ) ) { | 
					
						
							|  |  |  | 		*param = AC_QUAT_W; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	return ok; | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-03-09 19:45:59 +00:00
										 |  |  | static int Ipo_caIcuName( char *s, int *param ) | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	int ok = 0; | 
					
						
							|  |  |  | 	if( !strcmp( s, "Lens" ) ) { | 
					
						
							|  |  |  | 		*param = CAM_LENS; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "ClSta" ) ) { | 
					
						
							|  |  |  | 		*param = CAM_STA; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "ClEnd" ) ) { | 
					
						
							|  |  |  | 		*param = CAM_END; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	return ok; | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-03-09 19:45:59 +00:00
										 |  |  | static int Ipo_texIcuName( char *s, int *param ) | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	int ok = 0; | 
					
						
							|  |  |  | 	if( !strcmp( s, "NSize" ) ) { | 
					
						
							|  |  |  | 		*param = TE_NSIZE; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "NDepth" ) ) { | 
					
						
							|  |  |  | 		*param = TE_NDEPTH; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "NType" ) ) { | 
					
						
							|  |  |  | 		*param = TE_NTYPE; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Turb" ) ) { | 
					
						
							|  |  |  | 		*param = TE_TURB; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Vnw1" ) ) { | 
					
						
							|  |  |  | 		*param = TE_VNW1; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Vnw2" ) ) { | 
					
						
							|  |  |  | 		*param = TE_VNW2; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Vnw3" ) ) { | 
					
						
							|  |  |  | 		*param = TE_VNW3; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Vnw4" ) ) { | 
					
						
							|  |  |  | 		*param = TE_VNW4; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "MinkMExp" ) ) { | 
					
						
							|  |  |  | 		*param = TE_VNMEXP; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "DistM" ) ) { | 
					
						
							|  |  |  | 		*param = TE_VN_DISTM; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "ColT" ) ) { | 
					
						
							|  |  |  | 		*param = TE_VN_COLT; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "iScale" ) ) { | 
					
						
							|  |  |  | 		*param = TE_ISCA; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "DistA" ) ) { | 
					
						
							|  |  |  | 		*param = TE_DISTA; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "MgType" ) ) { | 
					
						
							|  |  |  | 		*param = TE_MG_TYP; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "MgH" ) ) { | 
					
						
							|  |  |  | 		*param = TE_MGH; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Lacu" ) ) { | 
					
						
							|  |  |  | 		*param = TE_MG_LAC; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Oct" ) ) { | 
					
						
							|  |  |  | 		*param = TE_MG_OCT; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "MgOff" ) ) { | 
					
						
							|  |  |  | 		*param = TE_MG_OFF; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "MgGain" ) ) { | 
					
						
							|  |  |  | 		*param = TE_MG_GAIN; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "NBase1" ) ) { | 
					
						
							|  |  |  | 		*param = TE_N_BAS1; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "NBase2" ) ) { | 
					
						
							|  |  |  | 		*param = TE_N_BAS2; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return ok; | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-03-09 19:45:59 +00:00
										 |  |  | static int Ipo_obIcuName( char *s, int *param ) | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	int ok = 0; | 
					
						
							|  |  |  | 	if( !strcmp( s, "LocX" ) ) { | 
					
						
							|  |  |  | 		*param = OB_LOC_X; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "LocY" ) ) { | 
					
						
							|  |  |  | 		*param = OB_LOC_Y; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "LocZ" ) ) { | 
					
						
							|  |  |  | 		*param = OB_LOC_Z; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "RotX" ) ) { | 
					
						
							|  |  |  | 		*param = OB_ROT_X; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "RotY" ) ) { | 
					
						
							|  |  |  | 		*param = OB_ROT_Y; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "RotZ" ) ) { | 
					
						
							|  |  |  | 		*param = OB_ROT_Z; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "SizeX" ) ) { | 
					
						
							|  |  |  | 		*param = OB_SIZE_X; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "SizeY" ) ) { | 
					
						
							|  |  |  | 		*param = OB_SIZE_Y; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "SizeZ" ) ) { | 
					
						
							|  |  |  | 		*param = OB_SIZE_Z; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( !strcmp( s, "dLocX" ) ) { | 
					
						
							|  |  |  | 		*param = OB_DLOC_X; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "dLocY" ) ) { | 
					
						
							|  |  |  | 		*param = OB_DLOC_Y; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "dLocZ" ) ) { | 
					
						
							|  |  |  | 		*param = OB_DLOC_Z; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "dRotX" ) ) { | 
					
						
							|  |  |  | 		*param = OB_DROT_X; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "dRotY" ) ) { | 
					
						
							|  |  |  | 		*param = OB_DROT_Y; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "dRotZ" ) ) { | 
					
						
							|  |  |  | 		*param = OB_DROT_Z; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "dSizeX" ) ) { | 
					
						
							|  |  |  | 		*param = OB_DSIZE_X; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "dSizeY" ) ) { | 
					
						
							|  |  |  | 		*param = OB_DSIZE_Y; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "dSizeZ" ) ) { | 
					
						
							|  |  |  | 		*param = OB_DSIZE_Z; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( !strcmp( s, "Layer" ) ) { | 
					
						
							|  |  |  | 		*param = OB_LAY; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Time" ) ) { | 
					
						
							|  |  |  | 		*param = OB_TIME; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( !strcmp( s, "ColR" ) ) { | 
					
						
							|  |  |  | 		*param = OB_COL_R; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "ColG" ) ) { | 
					
						
							|  |  |  | 		*param = OB_COL_G; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "ColB" ) ) { | 
					
						
							|  |  |  | 		*param = OB_COL_B; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "ColA" ) ) { | 
					
						
							|  |  |  | 		*param = OB_COL_A; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "FStreng" ) ) { | 
					
						
							|  |  |  | 		*param = OB_PD_FSTR; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "FFall" ) ) { | 
					
						
							|  |  |  | 		*param = OB_PD_FFALL; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Damping" ) ) { | 
					
						
							|  |  |  | 		*param = OB_PD_SDAMP; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "RDamp" ) ) { | 
					
						
							|  |  |  | 		*param = OB_PD_RDAMP; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if( !strcmp( s, "Perm" ) ) { | 
					
						
							|  |  |  | 		*param = OB_PD_PERM; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		return 1; | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return ok; | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* 
 | 
					
						
							|  |  |  |    Function:  Ipo_addCurve | 
					
						
							|  |  |  |    Bpy:       Blender.Ipo.addCurve( 'curname') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    add a new curve to an existing IPO. | 
					
						
							|  |  |  |    example: | 
					
						
							|  |  |  |    ipo = Blender.Ipo.New('Object','ObIpo') | 
					
						
							|  |  |  |    cu = ipo.addCurve('LocX') | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *Ipo_addCurve( BPy_Ipo * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2004-07-26 21:44:55 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 	int param = 0;		/* numeric curve name constant */ | 
					
						
							|  |  |  | 	int ok = 0; | 
					
						
							|  |  |  | 	int ipofound = 0; | 
					
						
							|  |  |  | 	char *cur_name = 0;	/* input arg: curve name */ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	Ipo *ipo = 0; | 
					
						
							|  |  |  | 	IpoCurve *icu = 0; | 
					
						
							|  |  |  | 	Link *link; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 	if( !PyArg_ParseTuple( args, "s", &cur_name ) ) | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "expected string argument" ) ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 	/* chase down the ipo list looking for ours */ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	link = G.main->ipo.first; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	while( link ) { | 
					
						
							|  |  |  | 		ipo = ( Ipo * ) link; | 
					
						
							|  |  |  | 		if( ipo == self->ipo ) { | 
					
						
							|  |  |  | 			ipofound = 1; | 
					
						
							|  |  |  | 			break; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		link = link->next; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( ipo && ipofound ) { | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 		/* ok.  continue */ | 
					
						
							|  |  |  | 	} else {		/* runtime error here:  our ipo not found */ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 			 ( PyExc_RuntimeError, "Ipo not found" ) ); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/*
 | 
					
						
							|  |  |  | 	   depending on the block type,  | 
					
						
							|  |  |  | 	   check if the input arg curve name is valid  | 
					
						
							|  |  |  | 	   and set param to numeric value. | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	switch ( ipo->blocktype ) { | 
					
						
							|  |  |  | 	case ID_OB: | 
					
						
							|  |  |  | 		ok = Ipo_obIcuName( cur_name, ¶m ); | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	case ID_CA: | 
					
						
							|  |  |  | 		ok = Ipo_caIcuName( cur_name, ¶m ); | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	case ID_LA: | 
					
						
							|  |  |  | 		ok = Ipo_laIcuName( cur_name, ¶m ); | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	case ID_TE: | 
					
						
							|  |  |  | 		ok = Ipo_texIcuName( cur_name, ¶m ); | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	case ID_WO: | 
					
						
							|  |  |  | 		ok = Ipo_woIcuName( cur_name, ¶m ); | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	case ID_MA: | 
					
						
							|  |  |  | 		ok = Ipo_maIcuName( cur_name, ¶m ); | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	case ID_AC: | 
					
						
							|  |  |  | 		ok = Ipo_acIcuName( cur_name, ¶m ); | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	case IPO_CO: | 
					
						
							|  |  |  | 		ok = Ipo_coIcuName( cur_name, ¶m ); | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	case ID_CU: | 
					
						
							|  |  |  | 		ok = Ipo_cuIcuName( cur_name, ¶m ); | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	case ID_KE: | 
					
						
							|  |  |  | 		ok = Ipo_keIcuName( cur_name, ¶m ); | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	case ID_SEQ: | 
					
						
							|  |  |  | 		ok = Ipo_seqIcuName( cur_name, ¶m ); | 
					
						
							|  |  |  | 		break; | 
					
						
							|  |  |  | 	default: | 
					
						
							|  |  |  | 		ok = 0; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( !ok )		/* curve type was invalid */ | 
					
						
							|  |  |  | 		return EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			( PyExc_NameError, "curve name was invalid" ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* ask blender to create the new ipo curve */ | 
					
						
							|  |  |  | 	icu = get_ipocurve( NULL, ipo->blocktype, param, self->ipo ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( icu == 0 )		/* could not create curve */ | 
					
						
							|  |  |  | 		return EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			( PyExc_RuntimeError, | 
					
						
							|  |  |  | 			  "blender could not create ipo curve" ); | 
					
						
							| 
									
										
										
										
											2004-01-18 23:43:23 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	allspace( REMAKEIPO, 0 ); | 
					
						
							| 
									
										
											  
											
												BPython:
- Scripts:
    fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
    cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
    small updates to help_browser.py script.
 The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place).  Updated Scripts win->Scripts menu so it won't show all available entries, only  the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees.  The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).
- Modules:
    Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
    NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).
- Bugs fixed:
    #2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
    Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text).  Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.
    #1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
    Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
    Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file.  After more testing we can make further updates.  Updated many places to not call redraws if in bg mode, now it is officially available.  Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.
- Removed a few warnings here and there and also updated docs.
											
										 
											2005-03-19 06:24:55 +00:00
										 |  |  | 	EXPP_allqueue( REDRAWIPO, 0 ); | 
					
						
							| 
									
										
										
										
											2004-01-18 23:43:23 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 	/* create a bpy wrapper for the new ipo curve */ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	return IpoCurve_CreatePyObject( icu ); | 
					
						
							| 
									
										
										
										
											2003-07-21 00:08:30 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-24 19:03:39 +00:00
										 |  |  | /* 
 | 
					
						
							|  |  |  |    Function:  Ipo_delCurve | 
					
						
							|  |  |  |    Bpy:       Blender.Ipo.delCurve(curtype) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    delete an existing curve from IPO. | 
					
						
							|  |  |  |    example: | 
					
						
							|  |  |  |        ipo = Blender.Ipo.New('Object','ObIpo') | 
					
						
							|  |  |  |        cu = ipo.delCurve('LocX') | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static PyObject *Ipo_delCurve( BPy_Ipo * self, PyObject * args ) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	IpoCurve *icu; | 
					
						
							|  |  |  | 	char *strname; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( !PyArg_ParseTuple( args, "s", &strname ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, | 
					
						
							|  |  |  | 			   "string argument" ) ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	for( icu = self->ipo->curve.first; icu; icu = icu->next ) { | 
					
						
							|  |  |  | 		char *str1 = getIpoCurveName( icu ); | 
					
						
							|  |  |  | 		if( !strcmp( str1, strname ) ) { | 
					
						
							|  |  |  | 			BLI_remlink( &(self->ipo->curve), icu); | 
					
						
							|  |  |  | 			if(icu->bezt) MEM_freeN(icu->bezt); | 
					
						
							|  |  |  | 			MEM_freeN(icu); | 
					
						
							|  |  |  | 			del_ipoCurve ( icu ); | 
					
						
							|  |  |  | 			Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 			return Py_None; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 		 ( PyExc_RuntimeError, "IpoCurve not found" ) ); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-01-18 23:43:23 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *Ipo_getCurve( BPy_Ipo * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2003-10-26 16:54:33 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	char *str, *str1; | 
					
						
							|  |  |  | 	IpoCurve *icu = 0; | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( !PyArg_ParseTuple( args, "s", &str ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "expected string argument" ) ); | 
					
						
							| 
									
										
										
										
											2005-01-07 01:38:14 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	for( icu = self->ipo->curve.first; icu; icu = icu->next ) { | 
					
						
							| 
									
										
										
										
											2005-04-24 19:03:39 +00:00
										 |  |  | 		str1 = getIpoCurveName( icu ); | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 		if( !strcmp( str1, str ) ) | 
					
						
							|  |  |  | 			return IpoCurve_CreatePyObject( icu ); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-10-26 16:54:33 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2003-07-21 00:08:30 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *Ipo_getCurves( BPy_Ipo * self ) | 
					
						
							| 
									
										
										
										
											2003-07-19 08:32:01 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PyObject *attr = PyList_New( 0 ); | 
					
						
							|  |  |  | 	IpoCurve *icu; | 
					
						
							|  |  |  | 	for( icu = self->ipo->curve.first; icu; icu = icu->next ) { | 
					
						
							|  |  |  | 		PyList_Append( attr, IpoCurve_CreatePyObject( icu ) ); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	return attr; | 
					
						
							| 
									
										
										
										
											2003-07-19 08:32:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *Ipo_getNBezPoints( BPy_Ipo * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	int num = 0, i = 0; | 
					
						
							|  |  |  | 	IpoCurve *icu = 0; | 
					
						
							|  |  |  | 	if( !PyArg_ParseTuple( args, "i", &num ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "expected int argument" ) ); | 
					
						
							|  |  |  | 	icu = self->ipo->curve.first; | 
					
						
							|  |  |  | 	if( !icu ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "No IPO curve" ) ); | 
					
						
							|  |  |  | 	for( i = 0; i < num; i++ ) { | 
					
						
							|  |  |  | 		if( !icu ) | 
					
						
							|  |  |  | 			return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 				 ( PyExc_TypeError, "Bad curve number" ) ); | 
					
						
							|  |  |  | 		icu = icu->next; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	return ( PyInt_FromLong( icu->totvert ) ); | 
					
						
							| 
									
										
										
										
											2003-07-19 08:32:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *Ipo_DeleteBezPoints( BPy_Ipo * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	int num = 0, i = 0; | 
					
						
							|  |  |  | 	IpoCurve *icu = 0; | 
					
						
							|  |  |  | 	if( !PyArg_ParseTuple( args, "i", &num ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "expected int argument" ) ); | 
					
						
							|  |  |  | 	icu = self->ipo->curve.first; | 
					
						
							|  |  |  | 	if( !icu ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "No IPO curve" ) ); | 
					
						
							|  |  |  | 	for( i = 0; i < num; i++ ) { | 
					
						
							|  |  |  | 		if( !icu ) | 
					
						
							|  |  |  | 			return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 				 ( PyExc_TypeError, "Bad curve number" ) ); | 
					
						
							|  |  |  | 		icu = icu->next; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	icu->totvert--; | 
					
						
							|  |  |  | 	return ( PyInt_FromLong( icu->totvert ) ); | 
					
						
							| 
									
										
										
										
											2003-07-19 08:32:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-12-17 17:34:51 +00:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Ipo_getCurveBP() | 
					
						
							|  |  |  |  * this method is UNSUPPORTED. | 
					
						
							|  |  |  |  * Calling this method throws a TypeError Exception. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * it looks like the original intent was to return the first point | 
					
						
							|  |  |  |  * of a BPoint Ipo curve.  However, BPoint ipos are not currently | 
					
						
							|  |  |  |  * implemented. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *Ipo_getCurveBP( BPy_Ipo * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-12-17 17:34:51 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* unsupported method */ | 
					
						
							|  |  |  | 	return EXPP_ReturnPyObjError( PyExc_NotImplementedError, | 
					
						
							| 
									
										
										
										
											2004-12-21 01:15:42 +00:00
										 |  |  | 				      "bpoint ipos are not supported" ); | 
					
						
							| 
									
										
										
										
											2004-12-17 17:34:51 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #if 0
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	struct BPoint *ptrbpoint; | 
					
						
							|  |  |  | 	int num = 0, i; | 
					
						
							|  |  |  | 	IpoCurve *icu; | 
					
						
							|  |  |  | 	PyObject *l; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( !PyArg_ParseTuple( args, "i", &num ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "expected int argument" ) ); | 
					
						
							|  |  |  | 	icu = self->ipo->curve.first; | 
					
						
							|  |  |  | 	if( !icu ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "No IPO curve" ) ); | 
					
						
							|  |  |  | 	for( i = 0; i < num; i++ ) { | 
					
						
							|  |  |  | 		if( !icu ) | 
					
						
							|  |  |  | 			return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 				 ( PyExc_TypeError, "Bad curve number" ) ); | 
					
						
							|  |  |  | 		icu = icu->next; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	ptrbpoint = icu->bp; | 
					
						
							|  |  |  | 	if( !ptrbpoint ) | 
					
						
							|  |  |  | 		return EXPP_ReturnPyObjError( PyExc_TypeError, | 
					
						
							|  |  |  | 					      "No base point" ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	l = PyList_New( 0 ); | 
					
						
							|  |  |  | 	for( i = 0; i < 4; i++ ) | 
					
						
							|  |  |  | 		PyList_Append( l, PyFloat_FromDouble( ptrbpoint->vec[i] ) ); | 
					
						
							|  |  |  | 	return l; | 
					
						
							| 
									
										
										
										
											2004-12-17 17:34:51 +00:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *Ipo_getCurveBeztriple( BPy_Ipo * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	struct BezTriple *ptrbt; | 
					
						
							|  |  |  | 	int num = 0, pos, i, j; | 
					
						
							|  |  |  | 	IpoCurve *icu; | 
					
						
							|  |  |  | 	PyObject *l = PyList_New( 0 ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( !PyArg_ParseTuple( args, "ii", &num, &pos ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "expected int argument" ) ); | 
					
						
							|  |  |  | 	icu = self->ipo->curve.first; | 
					
						
							|  |  |  | 	if( !icu ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "No IPO curve" ) ); | 
					
						
							|  |  |  | 	for( i = 0; i < num; i++ ) { | 
					
						
							|  |  |  | 		if( !icu ) | 
					
						
							|  |  |  | 			return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 				 ( PyExc_TypeError, "Bad ipo number" ) ); | 
					
						
							|  |  |  | 		icu = icu->next; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	if( pos >= icu->totvert ) | 
					
						
							|  |  |  | 		return EXPP_ReturnPyObjError( PyExc_TypeError, | 
					
						
							|  |  |  | 					      "Bad bezt number" ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ptrbt = icu->bezt + pos; | 
					
						
							|  |  |  | 	if( !ptrbt ) | 
					
						
							|  |  |  | 		return EXPP_ReturnPyObjError( PyExc_TypeError, | 
					
						
							|  |  |  | 					      "No bez triple" ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	for( i = 0; i < 3; i++ ) | 
					
						
							|  |  |  | 		for( j = 0; j < 3; j++ ) | 
					
						
							|  |  |  | 			PyList_Append( l, | 
					
						
							|  |  |  | 				       PyFloat_FromDouble( ptrbt-> | 
					
						
							|  |  |  | 							   vec[i][j] ) ); | 
					
						
							|  |  |  | 	return l; | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *Ipo_setCurveBeztriple( BPy_Ipo * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	struct BezTriple *ptrbt; | 
					
						
							|  |  |  | 	int num = 0, pos, i; | 
					
						
							|  |  |  | 	IpoCurve *icu; | 
					
						
							|  |  |  | 	PyObject *listargs = 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( !PyArg_ParseTuple( args, "iiO", &num, &pos, &listargs ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, | 
					
						
							|  |  |  | 			   "expected int int object argument" ) ); | 
					
						
							|  |  |  | 	if( !PyTuple_Check( listargs ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "3rd arg should be a tuple" ) ); | 
					
						
							|  |  |  | 	icu = self->ipo->curve.first; | 
					
						
							|  |  |  | 	if( !icu ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "No IPO curve" ) ); | 
					
						
							|  |  |  | 	for( i = 0; i < num; i++ ) { | 
					
						
							|  |  |  | 		if( !icu ) | 
					
						
							|  |  |  | 			return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 				 ( PyExc_TypeError, "Bad ipo number" ) ); | 
					
						
							|  |  |  | 		icu = icu->next; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	if( pos >= icu->totvert ) | 
					
						
							|  |  |  | 		return EXPP_ReturnPyObjError( PyExc_TypeError, | 
					
						
							|  |  |  | 					      "Bad bezt number" ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ptrbt = icu->bezt + pos; | 
					
						
							|  |  |  | 	if( !ptrbt ) | 
					
						
							|  |  |  | 		return EXPP_ReturnPyObjError( PyExc_TypeError, | 
					
						
							|  |  |  | 					      "No bez triple" ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	for( i = 0; i < 9; i++ ) { | 
					
						
							|  |  |  | 		PyObject *xx = PyTuple_GetItem( listargs, i ); | 
					
						
							|  |  |  | 		ptrbt->vec[i / 3][i % 3] = PyFloat_AsDouble( xx ); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *Ipo_EvaluateCurveOn( BPy_Ipo * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	float eval_icu( IpoCurve * icu, float ipotime ); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	int num = 0, i; | 
					
						
							|  |  |  | 	IpoCurve *icu; | 
					
						
							|  |  |  | 	float time = 0; | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( !PyArg_ParseTuple( args, "if", &num, &time ) ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "expected int argument" ) ); | 
					
						
							| 
									
										
										
										
											2004-04-26 17:21:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	icu = self->ipo->curve.first; | 
					
						
							|  |  |  | 	if( !icu ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "No IPO curve" ) ); | 
					
						
							| 
									
										
										
										
											2004-04-26 17:21:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	for( i = 0; i < num; i++ ) { | 
					
						
							|  |  |  | 		if( !icu ) | 
					
						
							|  |  |  | 			return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 				 ( PyExc_TypeError, "Bad ipo number" ) ); | 
					
						
							|  |  |  | 		icu = icu->next; | 
					
						
							| 
									
										
										
										
											2003-08-01 19:47:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	return PyFloat_FromDouble( eval_icu( icu, time ) ); | 
					
						
							| 
									
										
										
										
											2003-08-01 19:47:01 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *Ipo_getCurvecurval( BPy_Ipo * self, PyObject * args ) | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	int numcurve = 0, i; | 
					
						
							|  |  |  | 	IpoCurve *icu; | 
					
						
							|  |  |  | 	char *stringname = 0, *str1 = 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	icu = self->ipo->curve.first; | 
					
						
							|  |  |  | 	if( !icu ) | 
					
						
							|  |  |  | 		return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 			 ( PyExc_TypeError, "No IPO curve" ) ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( PyNumber_Check( PySequence_GetItem( args, 0 ) ) )	// args is an integer
 | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 		if( !PyArg_ParseTuple( args, "i", &numcurve ) ) | 
					
						
							|  |  |  | 			return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 				 ( PyExc_TypeError, | 
					
						
							|  |  |  | 				   "expected int or string argument" ) ); | 
					
						
							|  |  |  | 		for( i = 0; i < numcurve; i++ ) { | 
					
						
							|  |  |  | 			if( !icu ) | 
					
						
							|  |  |  | 				return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 					 ( PyExc_TypeError, | 
					
						
							|  |  |  | 					   "Bad ipo number" ) ); | 
					
						
							|  |  |  | 			icu = icu->next; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	else			// args is a string
 | 
					
						
							| 
									
										
										
										
											2004-03-29 08:16:18 +00:00
										 |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 		if( !PyArg_ParseTuple( args, "s", &stringname ) ) | 
					
						
							|  |  |  | 			return ( EXPP_ReturnPyObjError | 
					
						
							|  |  |  | 				 ( PyExc_TypeError, | 
					
						
							|  |  |  | 				   "expected int or string argument" ) ); | 
					
						
							|  |  |  | 		while( icu ) { | 
					
						
							| 
									
										
										
										
											2005-04-24 19:03:39 +00:00
										 |  |  | 			str1 = getIpoCurveName( icu ); | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 			if( !strcmp( str1, stringname ) ) | 
					
						
							|  |  |  | 				break; | 
					
						
							|  |  |  | 			icu = icu->next; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if( icu ) | 
					
						
							|  |  |  | 		return PyFloat_FromDouble( icu->curval ); | 
					
						
							|  |  |  | 	Py_INCREF( Py_None ); | 
					
						
							|  |  |  | 	return Py_None; | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:    IpoDeAlloc                                                   */ | 
					
						
							| 
									
										
										
										
											2003-10-28 00:29:37 +00:00
										 |  |  | /* Description: This is a callback function for the BPy_Ipo type. It is        */ | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | /*              the destructor function.                                     */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static void IpoDeAlloc( BPy_Ipo * self ) | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	PyObject_DEL( self ); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:    IpoGetAttr                                                   */ | 
					
						
							| 
									
										
										
										
											2003-10-28 00:29:37 +00:00
										 |  |  | /* Description: This is a callback function for the BPy_Ipo type. It is        */ | 
					
						
							|  |  |  | /*              the function that accesses BPy_Ipo "member variables" and      */ | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | /*              methods.                                                     */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *IpoGetAttr( BPy_Ipo * self, char *name ) | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	if( strcmp( name, "curves" ) == 0 ) | 
					
						
							|  |  |  | 		return Ipo_getCurves( self ); | 
					
						
							|  |  |  | 	return Py_FindMethod( BPy_Ipo_methods, ( PyObject * ) self, name ); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:    IpoSetAttr                                                */ | 
					
						
							| 
									
										
										
										
											2003-10-28 00:29:37 +00:00
										 |  |  | /* Description: This is a callback function for the BPy_Ipo type. It is the */ | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | /*              function that sets Ipo Data attributes (member variables).*/ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static int IpoSetAttr( BPy_Ipo * self, char *name, PyObject * value ) | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	return 0;		/* normal exit */ | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2003-06-12 04:51:50 +00:00
										 |  |  | /* Function:    IpoRepr                                                      */ | 
					
						
							| 
									
										
										
										
											2003-10-28 00:29:37 +00:00
										 |  |  | /* Description: This is a callback function for the BPy_Ipo type. It           */ | 
					
						
							| 
									
										
										
										
											2003-06-12 04:51:50 +00:00
										 |  |  | /*              builds a meaninful string to represent ipo objects.          */ | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | static PyObject *IpoRepr( BPy_Ipo * self ) | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	return PyString_FromFormat( "[Ipo \"%s\" %d]", self->ipo->id.name + 2, | 
					
						
							|  |  |  | 				    self->ipo->blocktype ); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-06-12 04:51:50 +00:00
										 |  |  | /* Three Python Ipo_Type helper functions needed by the Object module: */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:    Ipo_CreatePyObject                                           */ | 
					
						
							| 
									
										
										
										
											2003-10-28 00:29:37 +00:00
										 |  |  | /* Description: This function will create a new BPy_Ipo from an existing       */ | 
					
						
							| 
									
										
										
										
											2003-06-12 04:51:50 +00:00
										 |  |  | /*              Blender ipo structure.                                       */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | PyObject *Ipo_CreatePyObject( Ipo * ipo ) | 
					
						
							| 
									
										
										
										
											2003-06-12 04:51:50 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	BPy_Ipo *pyipo; | 
					
						
							|  |  |  | 	pyipo = ( BPy_Ipo * ) PyObject_NEW( BPy_Ipo, &Ipo_Type ); | 
					
						
							|  |  |  | 	if( !pyipo ) | 
					
						
							|  |  |  | 		return EXPP_ReturnPyObjError( PyExc_MemoryError, | 
					
						
							|  |  |  | 					      "couldn't create BPy_Ipo object" ); | 
					
						
							|  |  |  | 	pyipo->ipo = ipo; | 
					
						
							|  |  |  | 	return ( PyObject * ) pyipo; | 
					
						
							| 
									
										
										
										
											2003-06-12 04:51:50 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:    Ipo_CheckPyObject                                            */ | 
					
						
							|  |  |  | /* Description: This function returns true when the given PyObject is of the */ | 
					
						
							|  |  |  | /*              type Ipo. Otherwise it will return false.                    */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | int Ipo_CheckPyObject( PyObject * pyobj ) | 
					
						
							| 
									
										
										
										
											2003-06-12 04:51:50 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	return ( pyobj->ob_type == &Ipo_Type ); | 
					
						
							| 
									
										
										
										
											2003-06-12 04:51:50 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Function:    Ipo_FromPyObject                                             */ | 
					
						
							|  |  |  | /* Description: This function returns the Blender ipo from the given         */ | 
					
						
							|  |  |  | /*              PyObject.                                                    */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | Ipo *Ipo_FromPyObject( PyObject * pyobj ) | 
					
						
							| 
									
										
										
										
											2003-06-12 04:51:50 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-25 20:30:40 +00:00
										 |  |  | 	return ( ( BPy_Ipo * ) pyobj )->ipo; | 
					
						
							| 
									
										
										
										
											2003-06-12 04:51:50 +00:00
										 |  |  | } |