| 
									
										
										
										
											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. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Contributor(s): Jacques Guignot | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * ***** END GPL/BL DUAL LICENSE BLOCK ***** | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #ifndef EXPP_METABALL_H
 | 
					
						
							|  |  |  | #define EXPP_METABALL_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <Python.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <BKE_main.h>
 | 
					
						
							|  |  |  | #include <BKE_global.h>
 | 
					
						
							|  |  |  | #include <BKE_mball.h>
 | 
					
						
							|  |  |  | #include <BKE_object.h>
 | 
					
						
							|  |  |  | #include <BKE_library.h>
 | 
					
						
							|  |  |  | #include <BLI_blenlib.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "constant.h"
 | 
					
						
							|  |  |  | #include "gen_utils.h"
 | 
					
						
							|  |  |  | #include "modules.h"
 | 
					
						
							| 
									
										
										
										
											2003-06-27 07:46:29 +00:00
										 |  |  | #include "bpy_types.h"
 | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Python API function prototypes for the Metaball module.                     */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | static PyObject *M_Metaball_New (PyObject *self, PyObject *args); | 
					
						
							|  |  |  | static PyObject *M_Metaball_Get (PyObject *self, PyObject *args); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* The following string definitions are used for documentation strings.      */ | 
					
						
							|  |  |  | /* In Python these will be written to the console when doing a               */ | 
					
						
							|  |  |  | /* Blender.Metaball.__doc__                                                    */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2003-06-27 07:46:29 +00:00
										 |  |  | static char M_Metaball_doc[] = | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | "The Blender Metaball module\n\n\nMetaballs are spheres\
 | 
					
						
							|  |  |  |  that can join each other to create smooth,\ | 
					
						
							|  |  |  |  organic volumes\n. The spheres themseves are called\ | 
					
						
							|  |  |  |  'Metaelements' and can be accessed from the Metaball module."; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-06-27 07:46:29 +00:00
										 |  |  | static char M_Metaball_New_doc[] ="Creates a new metaball"; | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-06-27 07:46:29 +00:00
										 |  |  | static char M_Metaball_Get_doc[] ="Retreives an existing metaball"; | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Python method structure definition for Blender.Metaball module:             */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | struct PyMethodDef M_Metaball_methods[] = { | 
					
						
							|  |  |  |   {"New",M_Metaball_New, METH_VARARGS,M_Metaball_New_doc}, | 
					
						
							|  |  |  |   {"Get",         M_Metaball_Get,         METH_VARARGS, M_Metaball_Get_doc}, | 
					
						
							|  |  |  |   {"get",         M_Metaball_Get,         METH_VARARGS, M_Metaball_Get_doc}, | 
					
						
							|  |  |  |   {NULL, NULL, 0, NULL} | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2003-06-27 07:46:29 +00:00
										 |  |  | /* Python BPy_Metaball methods declarations:                                     */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | static PyObject *Metaball_getBbox(BPy_Metaball *self); | 
					
						
							|  |  |  | static PyObject *Metaball_getName(BPy_Metaball *self); | 
					
						
							|  |  |  | static PyObject *Metaball_setName(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_getWiresize(BPy_Metaball *self); | 
					
						
							|  |  |  | static PyObject *Metaball_setWiresize(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_getRendersize(BPy_Metaball *self); | 
					
						
							|  |  |  | static PyObject *Metaball_setRendersize(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_getThresh(BPy_Metaball *self); | 
					
						
							|  |  |  | static PyObject *Metaball_setThresh(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_getNMetaElems(BPy_Metaball *self); | 
					
						
							|  |  |  | static PyObject *Metaball_getMetatype(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_setMetatype(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_getMetadata(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_setMetadata(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_getMetax(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_setMetax(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_getMetay(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_setMetay(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_getMetaz(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_setMetaz(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_getMetas(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_setMetas(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_getMetalen(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_setMetalen(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_getloc(BPy_Metaball *self); | 
					
						
							|  |  |  | static PyObject *Metaball_setloc(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_getrot(BPy_Metaball *self); | 
					
						
							|  |  |  | static PyObject *Metaball_setrot(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | static PyObject *Metaball_getsize(BPy_Metaball *self); | 
					
						
							|  |  |  | static PyObject *Metaball_setsize(BPy_Metaball *self,PyObject*args); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Python BPy_Metaball methods table:                                            */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | static PyMethodDef BPy_Metaball_methods[] = { | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	/* name, method, flags, doc */ | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"getName", (PyCFunction)Metaball_getName,\ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  |    METH_NOARGS, "() - Return Metaball  name"}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"setName", (PyCFunction)Metaball_setName,\ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "() - Sets Metaball  name"}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"getWiresize", (PyCFunction)Metaball_getWiresize,\ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  |    METH_NOARGS, "() - Return Metaball  wire size"}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"setWiresize", (PyCFunction)Metaball_setWiresize,\ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "() - Sets Metaball  wire size"}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"getRendersize", (PyCFunction)Metaball_getRendersize,\ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  |    METH_NOARGS, "() - Return Metaball  render size"}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"setRendersize", (PyCFunction)Metaball_setRendersize,\ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "() - Sets Metaball  render size"}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"getThresh", (PyCFunction)Metaball_getThresh,\ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  |    METH_NOARGS, "() - Return Metaball  threshold"}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"setThresh", (PyCFunction)Metaball_setThresh,\ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "() - Sets Metaball  threshold"},  | 
					
						
							|  |  |  | 	{"getBbox", (PyCFunction)Metaball_getBbox,\ | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |    METH_NOARGS, "() - Return Metaball bounding box"}, | 
					
						
							|  |  |  |   {"getNMetaElems",(PyCFunction)Metaball_getNMetaElems,\ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_NOARGS, "() Returns the number of Spheres "}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"getMetatype", (PyCFunction)Metaball_getMetatype , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "() - "}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"setMetatype", (PyCFunction)Metaball_setMetatype , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "() - "}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"getMetadata", (PyCFunction)Metaball_getMetadata , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "() - Gets Metaball MetaData "}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"setMetadata", (PyCFunction)Metaball_setMetadata , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "() - "}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"getMetax", (PyCFunction)Metaball_getMetax , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "() - gets the x coordinate of the metaelement "}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"setMetax", (PyCFunction)Metaball_setMetax , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "() -sets the x coordinate of the metaelement "}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"getMetay", (PyCFunction)Metaball_getMetay , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "() - gets the y coordinate of the metaelement"}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"setMetay", (PyCFunction)Metaball_setMetay , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "() - sets the y coordinate of the metaelement"}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"getMetaz", (PyCFunction)Metaball_getMetaz , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "() - gets the z coordinate of the metaelement"}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"setMetaz", (PyCFunction)Metaball_setMetaz , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "() - sets the z coordinate of the metaelement"},  | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"getMetas", (PyCFunction)Metaball_getMetas , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "() - gets the s coordinate of the metaelement"}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"setMetas", (PyCFunction)Metaball_setMetas , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "() - sets the s coordinate of the metaelement"}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"getMetalen", (PyCFunction)Metaball_getMetalen , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "() -  gets the length of the metaelement."}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"setMetalen", (PyCFunction)Metaball_setMetalen , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "() -  sets the length of the metaelement."}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"getloc", (PyCFunction)Metaball_getloc , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_NOARGS, "() - Gets Metaball loc values"}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"setloc", (PyCFunction)Metaball_setloc , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "(f f f) - Sets Metaball loc values"}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"getrot", (PyCFunction)Metaball_getrot , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_NOARGS, "() - Gets Metaball rot values"}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"setrot", (PyCFunction)Metaball_setrot , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "(f f f) - Sets Metaball rot values"}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"getsize", (PyCFunction)Metaball_getsize , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_NOARGS, "() - Gets Metaball size values"}, | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  |   {"setsize", (PyCFunction)Metaball_setsize , \ | 
					
						
							| 
									
										
										
										
											2003-06-21 20:44:44 +00:00
										 |  |  | 	 METH_VARARGS, "(f f f) - Sets Metaball size values"}, | 
					
						
							|  |  |  | 	/*end of MetaElem data*/ | 
					
						
							|  |  |  | 	{0} | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							|  |  |  | /* Python Metaball_Type callback function prototypes:                          */ | 
					
						
							|  |  |  | /*****************************************************************************/ | 
					
						
							| 
									
										
										
										
											2003-06-27 07:46:29 +00:00
										 |  |  | static void MetaballDeAlloc (BPy_Metaball *self); | 
					
						
							| 
									
										
										
										
											2003-07-04 16:06:39 +00:00
										 |  |  | //static int MetaballPrint (BPy_Metaball *self, FILE *fp, int flags);
 | 
					
						
							| 
									
										
										
										
											2003-06-27 07:46:29 +00:00
										 |  |  | static int MetaballSetAttr (BPy_Metaball *self, char *name, PyObject *v); | 
					
						
							|  |  |  | static PyObject *MetaballGetAttr (BPy_Metaball *self, char *name); | 
					
						
							|  |  |  | static PyObject *MetaballRepr (BPy_Metaball *self); | 
					
						
							| 
									
										
										
										
											2003-06-05 18:03:46 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif /* EXPP_METABALL_H */
 |