2003-02-26 19:22:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								/* 
  
						 
					
						
							
								
									
										
										
										
											2004-09-18 18:47:03 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  $ Id $ 
							 
						 
					
						
							
								
									
										
										
										
											2003-02-26 19:22:24 +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 , 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  Inc . ,  59  Temple  Place  -  Suite  330 ,  Boston ,  MA   02111 - 1307 ,  USA . 
							 
						 
					
						
							
								
									
										
										
										
											2003-02-26 19:22:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  The  Original  Code  is  Copyright  ( C )  2001 - 2002  by  NaN  Holding  BV . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  All  rights  reserved . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-05 11:17:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  The  Object  module  provides  generic  access  to  Objects  of  various  types  via 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  the  Python  interface . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
									
										
										
										
											2003-02-26 19:22:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
									
										
										
										
											2004-01-16 23:40:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  Contributor ( s ) :  Michel  Selten ,  Willian  Germano ,  Jacques  Guignot , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-21 19:44:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  Joseph  Gilbert ,  Stephen  Swaney ,  Bala  Gi ,  Campbell  Barton ,  Johnny  Matthews , 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-06 22:29:49 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  Ken  Hughes ,  Alex  Mole ,  Jean - Michel  Soler 
							 
						 
					
						
							
								
									
										
										
										
											2003-02-26 19:22:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  * * * * *  END  GPL / BL  DUAL  LICENSE  BLOCK  * * * * * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								*/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								struct  SpaceIpo ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								struct  rctf ;  
						 
					
						
							
								
									
										
										
										
											2005-05-02 13:28:13 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "Object.h" /*This must come first */ 
  
						 
					
						
							
								
									
										
										
										
											2005-05-02 13:28:13 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-09-27 20:56:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "DNA_object_types.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "DNA_view3d_types.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "DNA_object_force.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "DNA_userdef_types.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-12-19 18:56:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "DNA_oops_types.h"  
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BKE_action.h" 
  
						 
					
						
							
								
									
										
										
										
											2006-02-27 04:05:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BKE_anim.h" /* used for dupli-objects */ 
  
						 
					
						
							
								
									
										
											 
										
											
												Mathutils update
- also included is some fixes for preprocessor inclues and some clean up of the previous commit
-rewrite and bugfixes
  ----------------------------------
  Here's my changelog:
  -fixed Rand() so that it doesn't seed everytime and should generate better random numbers
  - changed a few error return types to something more appropriate
  - clean up of uninitialized variables & removal of unneccessary objects
  - NMesh returns wrapped vectors now
  - World returns wrapped matrices now
  - Object.getEuler() and Object.getBoundingBox() return Wrapped data when data is present
  - Object.getMatrix() returns wrapped data if it's worldspace, 'localspace' returns a new matrix
  - Vector, Euler, Mat, Quat, call all now internally wrap object without destroying internal datablocks
  - Removed memory allocation (unneeded) from all methods
  - Vector's resize methods are only applicable to new vectors not wrapped data.
  - Matrix(), Quat(), Euler(), Vector() now accepts ANY sequence list, including tuples, list, or a self object to copy - matrices accept multiple sequences
  - Fixed Slerp() so that it now works correctly values are clamped between 0 and 1
  - Euler.rotate does internal rotation now
  - Slice assignment now works better for all types
  - Vector * Vector and Quat * Quat are defined and return the DOT product
  - Mat * Vec and Vec * Mat are defined now
  - Moved #includes to .c file from headers. Also fixed prototypes in mathutils
  - Added new helper functions for incref'ing to genutils
  - Major cleanup of header files includes - include Mathutils.h for access to math types
  - matrix.toQuat() and .toEuler() now fixed take appropriate matrix sizes
  - Matrix() with no parameters now returns an identity matrix by default not a zero matrix
  - printf() now prints with 6 digits instead of 4
  - printf() now prints output with object descriptor
  - Matrices now support [x][y] assignment (e.g. matrix[x][y] = 5.4)
  - Matrix[index] = value now expectes a sequence not an integer. This will now set a ROW of the matrix through a sequence.  index cannot go above the row size of the matrix.
  - slice operations on matrices work with sequences now (rows of the matrix) example:  mymatrix[0:2] returns a list of 2 wrapped vectors with access to the matrix data.
  - slice assignment will no longer modify the data if the assignment operation fails
  - fixed error in matrix * scalar multiplication
  - euler.toMatrix(), toQuat() no longer causes "creep" from repeated use
  - Wrapped data will generate wrapped objects when toEuler(), toQuat(), toMatrix() is used
  - Quats can be created with angle/axis, axis/angle
  - 4x4 matrices can be multiplied by 3D vectors (by popular demand :))
  - vec *quat / quat * vec is now defined
  - vec.magnitude alias for vec.length
  - all self, internal methods return a pointer to self now so you can do print vector.internalmethod() or vector.internalmethod().nextmethod() (no more print matrix.inverse() returning 'none')
  - these methods have been deprecated (still functioning but suggested to use the corrected functionality):
    * CopyVec() - replaced by Vector() functionality
    * CopyMat() - replaced by Matrix() functionality
    * CopyQuat() - replace by Quaternion() functionality
    * CopyEuler() - replaced by Euler() functionality
    * RotateEuler() - replaced by Euler.rotate() funtionality
    * MatMultVec() - replaced by matrix * vector
    * VecMultMat() - replaced by vector * matrix
  -  New struct containers references to python object data or internally allocated blender data for wrapping
  * Explaination here:  math structs now function as a 'simple wrapper' or a 'py_object' - data that is created on the fly will now be a 'py_object' with its memory managed by python
  *    otherwise if the data is returned by blender's G.main then the math object is a 'simple wrapper' and data can be accessed directly from the struct just like other python objects.
											 
										 
										
											2005-07-14 03:34:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BKE_depsgraph.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BKE_effect.h" 
  
						 
					
						
							
								
									
										
											 
										
											
												Mathutils update
- also included is some fixes for preprocessor inclues and some clean up of the previous commit
-rewrite and bugfixes
  ----------------------------------
  Here's my changelog:
  -fixed Rand() so that it doesn't seed everytime and should generate better random numbers
  - changed a few error return types to something more appropriate
  - clean up of uninitialized variables & removal of unneccessary objects
  - NMesh returns wrapped vectors now
  - World returns wrapped matrices now
  - Object.getEuler() and Object.getBoundingBox() return Wrapped data when data is present
  - Object.getMatrix() returns wrapped data if it's worldspace, 'localspace' returns a new matrix
  - Vector, Euler, Mat, Quat, call all now internally wrap object without destroying internal datablocks
  - Removed memory allocation (unneeded) from all methods
  - Vector's resize methods are only applicable to new vectors not wrapped data.
  - Matrix(), Quat(), Euler(), Vector() now accepts ANY sequence list, including tuples, list, or a self object to copy - matrices accept multiple sequences
  - Fixed Slerp() so that it now works correctly values are clamped between 0 and 1
  - Euler.rotate does internal rotation now
  - Slice assignment now works better for all types
  - Vector * Vector and Quat * Quat are defined and return the DOT product
  - Mat * Vec and Vec * Mat are defined now
  - Moved #includes to .c file from headers. Also fixed prototypes in mathutils
  - Added new helper functions for incref'ing to genutils
  - Major cleanup of header files includes - include Mathutils.h for access to math types
  - matrix.toQuat() and .toEuler() now fixed take appropriate matrix sizes
  - Matrix() with no parameters now returns an identity matrix by default not a zero matrix
  - printf() now prints with 6 digits instead of 4
  - printf() now prints output with object descriptor
  - Matrices now support [x][y] assignment (e.g. matrix[x][y] = 5.4)
  - Matrix[index] = value now expectes a sequence not an integer. This will now set a ROW of the matrix through a sequence.  index cannot go above the row size of the matrix.
  - slice operations on matrices work with sequences now (rows of the matrix) example:  mymatrix[0:2] returns a list of 2 wrapped vectors with access to the matrix data.
  - slice assignment will no longer modify the data if the assignment operation fails
  - fixed error in matrix * scalar multiplication
  - euler.toMatrix(), toQuat() no longer causes "creep" from repeated use
  - Wrapped data will generate wrapped objects when toEuler(), toQuat(), toMatrix() is used
  - Quats can be created with angle/axis, axis/angle
  - 4x4 matrices can be multiplied by 3D vectors (by popular demand :))
  - vec *quat / quat * vec is now defined
  - vec.magnitude alias for vec.length
  - all self, internal methods return a pointer to self now so you can do print vector.internalmethod() or vector.internalmethod().nextmethod() (no more print matrix.inverse() returning 'none')
  - these methods have been deprecated (still functioning but suggested to use the corrected functionality):
    * CopyVec() - replaced by Vector() functionality
    * CopyMat() - replaced by Matrix() functionality
    * CopyQuat() - replace by Quaternion() functionality
    * CopyEuler() - replaced by Euler() functionality
    * RotateEuler() - replaced by Euler.rotate() funtionality
    * MatMultVec() - replaced by matrix * vector
    * VecMultMat() - replaced by vector * matrix
  -  New struct containers references to python object data or internally allocated blender data for wrapping
  * Explaination here:  math structs now function as a 'simple wrapper' or a 'py_object' - data that is created on the fly will now be a 'py_object' with its memory managed by python
  *    otherwise if the data is returned by blender's G.main then the math object is a 'simple wrapper' and data can be accessed directly from the struct just like other python objects.
											 
										 
										
											2005-07-14 03:34:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BKE_font.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BKE_property.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BKE_mball.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BKE_softbody.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-07-15 05:30:58 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BKE_utildefines.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BKE_armature.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BKE_lattice.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BKE_mesh.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BKE_library.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BKE_object.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BKE_curve.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BKE_global.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BKE_main.h" 
  
						 
					
						
							
								
									
										
										
										
											2006-01-03 16:27:34 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BKE_scene.h" 
  
						 
					
						
							
								
									
										
										
										
											2006-02-08 16:58:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BKE_nla.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-12-19 18:56:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												Mathutils update
- also included is some fixes for preprocessor inclues and some clean up of the previous commit
-rewrite and bugfixes
  ----------------------------------
  Here's my changelog:
  -fixed Rand() so that it doesn't seed everytime and should generate better random numbers
  - changed a few error return types to something more appropriate
  - clean up of uninitialized variables & removal of unneccessary objects
  - NMesh returns wrapped vectors now
  - World returns wrapped matrices now
  - Object.getEuler() and Object.getBoundingBox() return Wrapped data when data is present
  - Object.getMatrix() returns wrapped data if it's worldspace, 'localspace' returns a new matrix
  - Vector, Euler, Mat, Quat, call all now internally wrap object without destroying internal datablocks
  - Removed memory allocation (unneeded) from all methods
  - Vector's resize methods are only applicable to new vectors not wrapped data.
  - Matrix(), Quat(), Euler(), Vector() now accepts ANY sequence list, including tuples, list, or a self object to copy - matrices accept multiple sequences
  - Fixed Slerp() so that it now works correctly values are clamped between 0 and 1
  - Euler.rotate does internal rotation now
  - Slice assignment now works better for all types
  - Vector * Vector and Quat * Quat are defined and return the DOT product
  - Mat * Vec and Vec * Mat are defined now
  - Moved #includes to .c file from headers. Also fixed prototypes in mathutils
  - Added new helper functions for incref'ing to genutils
  - Major cleanup of header files includes - include Mathutils.h for access to math types
  - matrix.toQuat() and .toEuler() now fixed take appropriate matrix sizes
  - Matrix() with no parameters now returns an identity matrix by default not a zero matrix
  - printf() now prints with 6 digits instead of 4
  - printf() now prints output with object descriptor
  - Matrices now support [x][y] assignment (e.g. matrix[x][y] = 5.4)
  - Matrix[index] = value now expectes a sequence not an integer. This will now set a ROW of the matrix through a sequence.  index cannot go above the row size of the matrix.
  - slice operations on matrices work with sequences now (rows of the matrix) example:  mymatrix[0:2] returns a list of 2 wrapped vectors with access to the matrix data.
  - slice assignment will no longer modify the data if the assignment operation fails
  - fixed error in matrix * scalar multiplication
  - euler.toMatrix(), toQuat() no longer causes "creep" from repeated use
  - Wrapped data will generate wrapped objects when toEuler(), toQuat(), toMatrix() is used
  - Quats can be created with angle/axis, axis/angle
  - 4x4 matrices can be multiplied by 3D vectors (by popular demand :))
  - vec *quat / quat * vec is now defined
  - vec.magnitude alias for vec.length
  - all self, internal methods return a pointer to self now so you can do print vector.internalmethod() or vector.internalmethod().nextmethod() (no more print matrix.inverse() returning 'none')
  - these methods have been deprecated (still functioning but suggested to use the corrected functionality):
    * CopyVec() - replaced by Vector() functionality
    * CopyMat() - replaced by Matrix() functionality
    * CopyQuat() - replace by Quaternion() functionality
    * CopyEuler() - replaced by Euler() functionality
    * RotateEuler() - replaced by Euler.rotate() funtionality
    * MatMultVec() - replaced by matrix * vector
    * VecMultMat() - replaced by vector * matrix
  -  New struct containers references to python object data or internally allocated blender data for wrapping
  * Explaination here:  math structs now function as a 'simple wrapper' or a 'py_object' - data that is created on the fly will now be a 'py_object' with its memory managed by python
  *    otherwise if the data is returned by blender's G.main then the math object is a 'simple wrapper' and data can be accessed directly from the struct just like other python objects.
											 
										 
										
											2005-07-14 03:34:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BSE_editipo.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BSE_edit.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-12-19 18:56:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BIF_space.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-12-19 18:56:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BIF_editview.h" 
  
						 
					
						
							
								
									
										
										
										
											2006-01-03 16:27:34 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BIF_drawscene.h" 
  
						 
					
						
							
								
									
										
										
										
											2006-01-03 17:24:24 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BIF_meshtools.h" 
  
						 
					
						
							
								
									
										
										
										
											2006-01-03 16:27:34 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BIF_editarmature.h" 
  
						 
					
						
							
								
									
										
										
										
											2006-01-28 20:17:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BIF_editaction.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BIF_editnla.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-12-19 18:56:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BLI_arithb.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BLI_blenlib.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-12-19 18:56:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BDR_editobject.h" 
  
						 
					
						
							
								
									
										
										
										
											2006-01-28 20:17:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BDR_editcurve.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-12-19 18:56:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "MEM_guardedalloc.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-12-19 18:56:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "mydevice.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "blendef.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "Scene.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "Mathutils.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-10-04 15:17:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "Mesh.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "NMesh.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "Curve.h" 
  
						 
					
						
							
								
									
										
										
										
											2004-10-07 19:25:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "Ipo.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "Armature.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-12-18 20:14:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "Pose.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "Camera.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "Lamp.h" 
  
						 
					
						
							
								
									
										
										
										
											2004-10-07 19:25:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "Lattice.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "Text.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "Text3d.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "Metaball.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "Draw.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "NLA.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "logic.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-11-06 22:29:49 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "Effect.h" 
  
						 
					
						
							
								
									
										
										
										
											2006-01-11 19:40:06 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "Pose.h" 
  
						 
					
						
							
								
									
										
										
										
											2006-03-18 17:24:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "Group.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "gen_utils.h" 
  
						 
					
						
							
								
									
										
										
										
											2006-01-17 06:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BIF_editkey.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-03-12 11:38:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-03-19 23:47:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Defines for insertIpoKey */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# define IPOKEY_LOC              0 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define IPOKEY_ROT              1 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define IPOKEY_SIZE             2 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define IPOKEY_LOCROT           3 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define IPOKEY_LOCROTSIZE       4 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define IPOKEY_PI_STRENGTH      5 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define IPOKEY_PI_FALLOFF       6 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define IPOKEY_PI_MAXDIST       7  /*Not Ready Yet*/ 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define IPOKEY_PI_SURFACEDAMP   8 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define IPOKEY_PI_RANDOMDAMP    9 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define IPOKEY_PI_PERM          10 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define PFIELD_FORCE	1 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define PFIELD_VORTEX	2 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define PFIELD_MAGNET	3 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define PFIELD_WIND		4 
  
						 
					
						
							
								
									
										
										
										
											2005-03-19 23:47:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Python API function prototypes for the Blender module.		 */  
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * M_Object_New (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * M_Object_Get (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * M_Object_GetSelected (  PyObject  *  self  ) ;  
						 
					
						
							
								
									
										
										
										
											2006-01-02 10:40:13 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * M_Object_Duplicate (  PyObject  *  self ,  PyObject  *  args ,  PyObject  * kwd ) ;  
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-15 05:30:58 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* HELPER FUNCTION FOR PARENTING */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * internal_makeParent ( Object  * parent ,  PyObject  * py_child ,  int  partype ,  int  noninverse ,  int  fast ,  int  v1 ,  int  v2 ,  int  v3 ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* The following string definitions are used for documentation strings.	 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* In Python these will be written to the console when doing a		 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Blender.Object.__doc__						 */  
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								char  M_Object_doc [ ]  =  " The Blender Object module \n \n \
  
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								This  module  provides  access  to  * * Object  Data * *  in  Blender . \ n " ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								char  M_Object_New_doc [ ]  =  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" (type) - Add a new object of type 'type' in the current scene " ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								char  M_Object_Get_doc [ ]  =  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" (name) - return the object with the name 'name', returns None if not \
 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									found . \ n \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									If  ' name '  is  not  specified ,  it  returns  a  list  of  all  objects  in  the \ n \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									current  scene . " ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								char  M_Object_GetSelected_doc [ ]  =  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" () - Returns a list of selected Objects in the active layer(s) \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								The  active  object  is  the  first  in  the  list ,  if  visible " ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-12-30 11:54:53 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								char  M_Object_Duplicate_doc [ ]  =  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									" (linked) - Duplicate all selected, visible objects in the current scene " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-12-30 14:17:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Python method structure definition for Blender.Object module:	 */  
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								struct  PyMethodDef  M_Object_methods [ ]  =  {  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " New " ,  (  PyCFunction  )  M_Object_New ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 M_Object_New_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " Get " ,  (  PyCFunction  )  M_Object_Get ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 M_Object_Get_doc } , 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " GetSelected " ,  (  PyCFunction  )  M_Object_GetSelected ,  METH_NOARGS , 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 M_Object_GetSelected_doc } , 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-02 10:40:13 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " Duplicate " ,  (  PyCFunction  )  M_Object_Duplicate ,  METH_VARARGS  |  METH_KEYWORDS , 
							 
						 
					
						
							
								
									
										
										
										
											2005-12-30 11:54:53 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 M_Object_Duplicate_doc } , 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ NULL ,  NULL ,  0 ,  NULL } 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-01-02 10:40:13 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Python BPy_Object methods declarations:				   */  
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								int  setupSB ( Object *  ob ) ;  /*Make sure Softbody Pointer is initialized */  
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								int  setupPI ( Object *  ob ) ;  
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_buildParts (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_clearIpo (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_clrParent (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_clearTrack (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2005-04-02 17:01:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getData ( BPy_Object  * self ,  PyObject  * args ,  PyObject  * kwd ) ;  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getDeltaLocation (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getDrawMode (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getDrawType (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getEuler (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getInverseMatrix (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getIpo (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getLocation (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getMaterials (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getMatrix (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getName (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getParent (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
									
										
										
										
											2005-07-18 18:11:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getParentBoneName (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getSize (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getTimeOffset (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getTracked (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getType (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getBoundBox (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getAction (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
									
										
										
										
											2005-12-18 20:14:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getPose (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_isSelected (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_makeDisplayList (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_link (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_makeParent (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2006-01-03 02:35:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_join (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2005-07-15 05:30:58 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_makeParentDeform (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_makeParentVertex (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_materialUsage (  void  ) ;  
						 
					
						
							
								
									
										
										
										
											2005-03-12 11:38:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getDupliVerts  (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
									
										
										
										
											2006-02-27 04:05:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getDupliFrames  (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getDupliGroup  (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getDupliRot  (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getDupliNoSpeed  (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getDupliObjects  (  BPy_Object  *  self ) ;  
						 
					
						
							
								
									
										
										
										
											2005-11-06 22:29:49 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getEffects (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_setDeltaLocation (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setDrawMode (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setDrawType (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setEuler (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setMatrix (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setIpo (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2005-03-19 23:47:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_insertIpoKey (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2005-12-14 17:44:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_insertPoseKey (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2005-12-18 20:14:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_insertCurrentPoseKey (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_insertMatrixKey (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_bake_to_action (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2006-02-01 22:21:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_setConstraintInfluenceForBone (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_setLocation (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setMaterials (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setName (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setSize (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setTimeOffset (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_makeTrack (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_shareFrom (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_Select (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getAllProperties (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_addProperty (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_removeProperty (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getProperty (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_removeAllProperties (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_copyAllPropertiesTo (  BPy_Object  *  self ,  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													     PyObject  *  args  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getScriptLinks (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_addScriptLink (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2005-04-21 19:44:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_clearScriptLinks (  BPy_Object  *  self ,  PyObject  * args  ) ;  
						 
					
						
							
								
									
										
										
										
											2005-03-12 11:38:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_setDupliVerts  (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2006-02-27 04:05:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_setDupliFrames  (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setDupliGroup  (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setDupliRot  (  BPy_Object  *  self  ,  PyObject  *  args ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setDupliNoSpeed  (  BPy_Object  *  self  ,  PyObject  *  args ) ;  
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getPIStrength (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setPIStrength (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getPIFalloff (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setPIFalloff (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getPIMaxDist (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setPIMaxDist (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getPIUseMaxDist (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setPIUseMaxDist (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getPIType (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setPIType (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getPIPerm (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setPIPerm (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getPIRandomDamp (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setPIRandomDamp (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getPISurfaceDamp (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setPISurfaceDamp (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getPIDeflection (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setPIDeflection (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-05-17 07:17:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_isSB (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getSBMass (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setSBMass (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getSBGravity (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setSBGravity (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getSBFriction (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setSBFriction (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getSBErrorLimit (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setSBErrorLimit (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getSBGoalSpring (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setSBGoalSpring (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getSBGoalFriction (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setSBGoalFriction (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getSBMinGoal (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setSBMinGoal (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getSBMaxGoal (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setSBMaxGoal (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getSBInnerSpring (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setSBInnerSpring (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getSBInnerSpringFriction (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setSBInnerSpringFriction (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getSBDefaultGoal (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setSBDefaultGoal (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getSBUseGoal (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setSBUseGoal (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getSBUseEdges (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setSBUseEdges (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getSBStiffQuads (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setSBStiffQuads (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2006-01-17 06:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_insertShapeKey ( BPy_Object  *  self ) ;  
						 
					
						
							
								
									
										
										
										
											2006-02-08 16:58:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_copyNLA (  BPy_Object  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_convertActionToStrip (  BPy_Object  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Python BPy_Object methods table:					   */  
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2003-06-28 07:38:21 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyMethodDef  BPy_Object_methods [ ]  =  {  
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* name, method, flags, doc */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " buildParts " ,  (  PyCFunction  )  Object_buildParts ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Recalcs particle system (if any)  " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getIpo " ,  (  PyCFunction  )  Object_getIpo ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns the ipo of this object (if any)  " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " clrParent " ,  (  PyCFunction  )  Object_clrParent ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Clears parent object. Optionally specify: \n \
 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								mode \ n \ tnonzero :  Keep  object  transform \ nfast \ n \ t > 0 :  Don ' t  update  scene  \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								hierarchy  ( faster ) " },  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " clearTrack " ,  (  PyCFunction  )  Object_clearTrack ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Make this object not track another anymore. Optionally specify: \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								mode \ n \ t2 :  Keep  object  transform \ nfast \ n \ t > 0 :  Don ' t  update  scene  \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								hierarchy  ( faster ) " },  
						 
					
						
							
								
									
										
										
										
											2005-02-02 03:38:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " getData " ,  (  PyCFunction  )  Object_getData ,  METH_VARARGS  |  METH_KEYWORDS , 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-04 15:17:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 " (name_only = 0, mesh = 0) - Returns the datablock object containing the object's  \
 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-02 03:38:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								data ,  e . g .  Mesh . \ n \ 
						 
					
						
							
								
									
										
										
										
											2005-02-09 05:19:24 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								If  ' name_only '  is  nonzero  or  True ,  only  the  name  of  the  datablock  is  returned " },  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " getDeltaLocation " ,  (  PyCFunction  )  Object_getDeltaLocation , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns the object's delta location (x, y, z) " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getDrawMode " ,  (  PyCFunction  )  Object_getDrawMode ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns the object draw modes " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getDrawType " ,  (  PyCFunction  )  Object_getDrawType ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns the object draw type " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getAction " ,  (  PyCFunction  )  Object_getAction ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns the active action for this object " } , 
							 
						 
					
						
							
								
									
										
										
										
											2005-12-18 20:14:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " getPose " ,  (  PyCFunction  )  Object_getPose ,  METH_NOARGS , 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-28 16:35:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" () - returns the pose from an object if it exists, else None " } , 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " isSelected " ,  (  PyCFunction  )  Object_isSelected ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Return a 1 or 0 depending on whether the object is selected " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getEuler " ,  (  PyCFunction  )  Object_getEuler ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns the object's rotation as Euler rotation vector \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								( rotX ,  rotY ,  rotZ ) " },  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " getInverseMatrix " ,  (  PyCFunction  )  Object_getInverseMatrix , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns the object's inverse matrix " } , 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " getLocation " ,  (  PyCFunction  )  Object_getLocation ,  METH_NOARGS , 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 " Returns the object's location (x, y, z) " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getMaterials " ,  (  PyCFunction  )  Object_getMaterials ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " (i = 0) - Returns list of materials assigned to the object. \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-20 08:16:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if  i  is  nonzero ,  empty  slots  are  not  ignored :  they  are  returned  as  None ' s . " },  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " getMatrix " ,  (  PyCFunction  )  Object_getMatrix ,  METH_VARARGS , 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython:
- Blender.Window: added function GetPerspMatrix() (Tom Musgrave's patch, thanks);
- added Chris Want's patch to tell argc, argv to the Python interpreter (thanks, Hos);
- Blender.Image: added image.glFree() to free textures bound by the recently added
  image.glLoad() (both suggested by Campbell Barton -- thanks, with these Blender can
  be used to load textures for scripts);
- Blender.Sound: removed for now at least a few get/set methods of vars that can't be
  accessed via interface;
- renamed Get/makeActive to Get/setCurrent in Blender.World (actually added alias for
  now), same in Blender.Sound: renamed makeActive to setCurrent.  Stephen Swaney
  pointed this some weeks ago, we should stick to one naming convention.
- added documentation for Sound and Window.Theme modules and the other added
  functions, made other small updates.
- Blender.Object: made 'worldspace' become the default output of .getMatrix and .mat/.matrix:
  after reading a discussion on blender.org's Python forum where eeshlo mentioned the
  pre 2.34 default was worldspace, I took a better look at Blender's relevant code,
  confirmed, talked to Theeth about this and as he suggested am changing the default
  back to 'worldspace'.
											 
										 
										
											2004-10-20 05:51:24 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 " (str = 'worldspace') - Returns the object matrix. \n \
 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython -- a few fixes:
-- fixed bug #1689:
http://projects.blender.org/tracker/?func=detail&atid=125&aid=1689&group_id=9
Reported by Tom Musgrove (thanks), the problem was that Window.QHandle was not passing events to windows that had id's below the current active window.  It was a stupid mistake (mine), the code was iterating from curarea instead of from the first area in the areabase list.
-- fixed bug #1568:
http://projects.blender.org/tracker/index.php?func=detail&aid=1568&group_id=9&atid=125
Stephen investigated the problem, reported by Gabriel Beloin, and left hints in the bug report, thanks :).  I also implemented what he suggested, now Effect.Get('objname') returns a list with all objname's effects and as before, Get('objname, position') returns the effect at position 'position'.  Ref doc already updated.
-- Allowed menu registration lines to appear commented out -- Python comments: '#', of course -- (suggested by Michael Reimpell) in scripts:
Some Python doc tools need the doc strings between triple double-quotes, so to avoid conflicts scripts writers can now comment out the registration code, it should work anyway.  Michael also provided a patch for this a few days ago, too (thanks), but to keep changes at a minimum because of proximity to a release I didn't use it.
											 
										 
										
											2004-10-31 04:09:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								( str  =  ' worldspace ' )  -  the  wanted  matrix :  worldspace  ( default ) ,  localspace \ n \ 
						 
					
						
							
								
									
										
											 
										
											
												BPython:
- Blender.Window: added function GetPerspMatrix() (Tom Musgrave's patch, thanks);
- added Chris Want's patch to tell argc, argv to the Python interpreter (thanks, Hos);
- Blender.Image: added image.glFree() to free textures bound by the recently added
  image.glLoad() (both suggested by Campbell Barton -- thanks, with these Blender can
  be used to load textures for scripts);
- Blender.Sound: removed for now at least a few get/set methods of vars that can't be
  accessed via interface;
- renamed Get/makeActive to Get/setCurrent in Blender.World (actually added alias for
  now), same in Blender.Sound: renamed makeActive to setCurrent.  Stephen Swaney
  pointed this some weeks ago, we should stick to one naming convention.
- added documentation for Sound and Window.Theme modules and the other added
  functions, made other small updates.
- Blender.Object: made 'worldspace' become the default output of .getMatrix and .mat/.matrix:
  after reading a discussion on blender.org's Python forum where eeshlo mentioned the
  pre 2.34 default was worldspace, I took a better look at Blender's relevant code,
  confirmed, talked to Theeth about this and as he suggested am changing the default
  back to 'worldspace'.
											 
										 
										
											2004-10-20 05:51:24 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								or  old_worldspace . \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								\ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								' old_worldspace '  was  the  only  behavior  before  Blender  2.34 .   With  it  the \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								matrix  is  not  updated  for  changes  made  by  the  script  itself \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( like  obj . LocX  =  10 )  until  a  redraw  happens ,  either  called  by  the  script  or \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								automatic  when  the  script  finishes . " },  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " getName " ,  (  PyCFunction  )  Object_getName ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns the name of the object " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getParent " ,  (  PyCFunction  )  Object_getParent ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns the object's parent object " } , 
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 18:11:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " getParentBoneName " ,  (  PyCFunction  )  Object_getParentBoneName ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns None, or the 'sub-name' of the parent (eg. Bone name) " } , 
							 
						 
					
						
							
								
									
										
										
										
											2005-08-21 15:00:17 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " getSize " ,  (  PyCFunction  )  Object_getSize ,  METH_NOARGS , 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 " Returns the object's size (x, y, z) " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getTimeOffset " ,  (  PyCFunction  )  Object_getTimeOffset ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns the object's time offset " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getTracked " ,  (  PyCFunction  )  Object_getTracked ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns the object's tracked object " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getType " ,  (  PyCFunction  )  Object_getType ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns type of string of Object " } , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Particle Interaction */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getPIStrength " ,  (  PyCFunction  )  Object_getPIStrength ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns Particle Interaction Strength " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setPIStrength " ,  (  PyCFunction  )  Object_setPIStrength ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets Particle Interaction Strength " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getPIFalloff " ,  (  PyCFunction  )  Object_getPIFalloff ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns Particle Interaction Falloff " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setPIFalloff " ,  (  PyCFunction  )  Object_setPIFalloff ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets Particle Interaction Falloff " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getPIMaxDist " ,  (  PyCFunction  )  Object_getPIMaxDist ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns Particle Interaction Max Distance " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setPIMaxDist " ,  (  PyCFunction  )  Object_setPIMaxDist ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets Particle Interaction Max Distance " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getPIUseMaxDist " ,  (  PyCFunction  )  Object_getPIUseMaxDist ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns bool for Use Max Distace in Particle Interaction  " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setPIUseMaxDist " ,  (  PyCFunction  )  Object_setPIUseMaxDist ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets if Max Distance should be used in Particle Interaction " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getPIType " ,  (  PyCFunction  )  Object_getPIType ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns Particle Interaction Type " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setPIType " ,  (  PyCFunction  )  Object_setPIType ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " sets Particle Interaction Type " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getPIPerm " ,  (  PyCFunction  )  Object_getPIPerm ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns Particle Interaction Permiability " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setPIPerm " ,  (  PyCFunction  )  Object_setPIPerm ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets Particle Interaction  Permiability " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getPISurfaceDamp " ,  (  PyCFunction  )  Object_getPISurfaceDamp ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns Particle Interaction Surface Damping " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setPISurfaceDamp " ,  (  PyCFunction  )  Object_setPISurfaceDamp ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets Particle Interaction Surface Damping " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getPIRandomDamp " ,  (  PyCFunction  )  Object_getPIRandomDamp ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns Particle Interaction Random Damping " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setPIRandomDamp " ,  (  PyCFunction  )  Object_setPIRandomDamp ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets Particle Interaction Random Damping " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getPIDeflection " ,  (  PyCFunction  )  Object_getPIDeflection ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns Particle Interaction Deflection " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setPIDeflection " ,  (  PyCFunction  )  Object_setPIDeflection ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets Particle Interaction Deflection " } ,   
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Softbody */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-05-17 07:17:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " isSB " ,  (  PyCFunction  )  Object_isSB ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " True if object is a soft body " } , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " getSBMass " ,  (  PyCFunction  )  Object_getSBMass ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns SB Mass " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setSBMass " ,  (  PyCFunction  )  Object_setSBMass ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets SB Mass " } ,  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getSBGravity " ,  (  PyCFunction  )  Object_getSBGravity ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns SB Gravity " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setSBGravity " ,  (  PyCFunction  )  Object_setSBGravity ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets SB Gravity " } ,  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getSBFriction " ,  (  PyCFunction  )  Object_getSBFriction ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns SB Friction " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setSBFriction " ,  (  PyCFunction  )  Object_setSBFriction ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets SB Friction " } ,  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getSBErrorLimit " ,  (  PyCFunction  )  Object_getSBErrorLimit ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns SB ErrorLimit " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setSBErrorLimit " ,  (  PyCFunction  )  Object_setSBErrorLimit ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets SB ErrorLimit " } ,  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getSBGoalSpring " ,  (  PyCFunction  )  Object_getSBGoalSpring ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns SB GoalSpring " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setSBGoalSpring " ,  (  PyCFunction  )  Object_setSBGoalSpring ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets SB GoalSpring " } ,  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getSBGoalFriction " ,  (  PyCFunction  )  Object_getSBGoalFriction ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns SB GoalFriction " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setSBGoalFriction " ,  (  PyCFunction  )  Object_setSBGoalFriction ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets SB GoalFriction " } ,  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getSBMinGoal " ,  (  PyCFunction  )  Object_getSBMinGoal ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns SB MinGoal " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setSBMinGoal " ,  (  PyCFunction  )  Object_setSBMinGoal ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets SB MinGoal  " } ,  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getSBMaxGoal " ,  (  PyCFunction  )  Object_getSBMaxGoal ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns SB MaxGoal " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setSBMaxGoal " ,  (  PyCFunction  )  Object_setSBMaxGoal ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets SB MaxGoal " } ,   
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getSBInnerSpring " ,  (  PyCFunction  )  Object_getSBInnerSpring ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns SB InnerSpring " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setSBInnerSpring " ,  (  PyCFunction  )  Object_setSBInnerSpring ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets SB InnerSpring " } ,  	 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getSBInnerSpringFriction " ,  (  PyCFunction  )  Object_getSBInnerSpringFriction ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns SB InnerSpringFriction " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setSBInnerSpringFriction " ,  (  PyCFunction  )  Object_setSBInnerSpringFriction ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets SB InnerSpringFriction " } ,  	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getSBDefaultGoal " ,  (  PyCFunction  )  Object_getSBDefaultGoal ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns SB DefaultGoal " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setSBDefaultGoal " ,  (  PyCFunction  )  Object_setSBDefaultGoal ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets SB DefaultGoal " } ,  		 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getSBUseGoal " ,  (  PyCFunction  )  Object_getSBUseGoal ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns SB UseGoal " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setSBUseGoal " ,  (  PyCFunction  )  Object_setSBUseGoal ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets SB UseGoal " } ,  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getSBUseEdges " ,  (  PyCFunction  )  Object_getSBUseEdges ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns SB UseEdges " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setSBUseEdges " ,  (  PyCFunction  )  Object_setSBUseEdges ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets SB UseEdges " } ,  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getSBStiffQuads " ,  (  PyCFunction  )  Object_getSBStiffQuads ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns SB StiffQuads " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setSBStiffQuads " ,  (  PyCFunction  )  Object_setSBStiffQuads ,  METH_VARARGS , 
							 
						 
					
						
							
								
									
										
										
										
											2006-02-27 04:05:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 " Sets SB StiffQuads " } , 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " getBoundBox " ,  (  PyCFunction  )  Object_getBoundBox ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Returns the object's bounding box " } , 
							 
						 
					
						
							
								
									
										
										
										
											2005-03-12 11:38:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " getDupliVerts " ,  (  PyCFunction  )  Object_getDupliVerts , 
							 
						 
					
						
							
								
									
										
										
										
											2006-02-27 04:05:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 METH_VARARGS ,  " Returns state of duplicates propertie " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getDupliFrames " ,  (  PyCFunction  )  Object_getDupliFrames , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 METH_NOARGS ,  " Returns state of Frames duplicates propertie " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getDupliGroup " ,  (  PyCFunction  )  Object_getDupliGroup , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 METH_NOARGS ,  " Returns state of Group duplicates propertie " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getDupliRot " ,  (  PyCFunction  )  Object_getDupliRot , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 METH_NOARGS ,  " Returns state of Rot duplicates propertie " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getDupliNoSpeed " ,  (  PyCFunction  )  Object_getDupliNoSpeed , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 METH_NOARGS ,  " Returns state of Nospeed duplicates propertie " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getDupliObjects " ,  (  PyCFunction  )  Object_getDupliObjects , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 METH_NOARGS ,  " Returns of list of tuples for object duplicated (object, dupliMatrix) \n \
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 by  dupliframe  or  dupliverst  state  " }, 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " makeDisplayList " ,  (  PyCFunction  )  Object_makeDisplayList , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Update this object's Display List. Some changes like turning  \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2003-09-20 03:40:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								' SubSurf '  on  for  a  mesh  need  this  method  ( followed  by  a  Redraw )  to  \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								show  the  changes  on  the  3 d  window . " },  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " link " ,  (  PyCFunction  )  Object_link ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Links Object with data provided in the argument. The data must  \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								match  the  Object ' s  type ,  so  you  cannot  link  a  Lamp  to  a  Mesh  type  object . " },  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " makeParent " ,  (  PyCFunction  )  Object_makeParent ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Makes the object the parent of the objects provided in the  \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								argument  which  must  be  a  list  of  valid  Objects .  Optional  extra  arguments : \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								mode : \ n \ t0 :  make  parent  with  inverse \ n \ t1 :  without  inverse \ n \ 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								fast : \ n \ t0 :  update  scene  hierarchy  automatically \ n \ t \ 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								don ' t  update  scene  hierarchy  ( faster ) .  In  this  case ,  you  must \ n \ t \ 
						 
					
						
							
								
									
										
										
										
											2005-07-15 05:30:58 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								explicitely  update  the  Scene  hierarchy . " },  
						 
					
						
							
								
									
										
										
										
											2006-01-03 02:35:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " join " ,  (  PyCFunction  )  Object_join ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " (object_list) - Joins the objects in object list of the same type, into this object. " } , 
							 
						 
					
						
							
								
									
										
										
										
											2005-07-15 05:30:58 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " makeParentDeform " ,  (  PyCFunction  )  Object_makeParentDeform ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Makes the object the deformation parent of the objects provided in the  \n \
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								argument  which  must  be  a  list  of  valid  Objects .  Optional  extra  arguments : \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								mode : \ n \ t0 :  make  parent  with  inverse \ n \ t1 :  without  inverse \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								fast : \ n \ t0 :  update  scene  hierarchy  automatically \ n \ t \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								don ' t  update  scene  hierarchy  ( faster ) .  In  this  case ,  you  must \ n \ t \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								explicitely  update  the  Scene  hierarchy . " },  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " makeParentVertex " ,  (  PyCFunction  )  Object_makeParentVertex ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Makes the object the vertex parent of the objects provided in the  \n \
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								argument  which  must  be  a  list  of  valid  Objects .  \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								The  second  argument  is  a  tuple  of  1  or  3  positive  integers  which  corresponds  \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								to  the  index  of  the  vertex  you  are  parenting  to . \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Optional  extra  arguments : \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								mode : \ n \ t0 :  make  parent  with  inverse \ n \ t1 :  without  inverse \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								fast : \ n \ t0 :  update  scene  hierarchy  automatically \ n \ t \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								don ' t  update  scene  hierarchy  ( faster ) .  In  this  case ,  you  must \ n \ t \ 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								explicitely  update  the  Scene  hierarchy . " },  
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " materialUsage " ,  (  PyCFunction  )  Object_materialUsage ,  METH_NOARGS , 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 " Determines the way the material is used and returns status. \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Possible  arguments  ( provide  as  strings ) : \ n \ 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								\ tData :    Materials  assigned  to  the  object ' s  data  are  shown .  ( default ) \ n \ 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								\ tObject :  Materials  assigned  to  the  object  are  shown . " },  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " setDeltaLocation " ,  (  PyCFunction  )  Object_setDeltaLocation , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets the object's delta location which must be a vector triple. " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setDrawMode " ,  (  PyCFunction  )  Object_setDrawMode ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets the object's drawing mode. The argument can be a sum of: \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								2 : 	axis \ n4 :   texspace \ n8 : 	drawname \ n16 :  drawimage \ n32 :  drawwire " },  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " setDrawType " ,  (  PyCFunction  )  Object_setDrawType ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets the object's drawing type. The argument must be one of: \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								1 :  Bounding  box \ n2 :  Wire \ n3 :  Solid \ n4 :  Shaded \ n5 :  Textured " },  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " setEuler " ,  (  PyCFunction  )  Object_setEuler ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Set the object's rotation according to the specified Euler \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								angles .  The  argument  must  be  a  vector  triple " },  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " setMatrix " ,  (  PyCFunction  )  Object_setMatrix ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Set and apply a new matrix for the object " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setLocation " ,  (  PyCFunction  )  Object_setLocation ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Set the object's location. The first argument must be a vector \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								triple . " },  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " setMaterials " ,  (  PyCFunction  )  Object_setMaterials ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets materials. The argument must be a list of valid material \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								objects . " },  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " setName " ,  (  PyCFunction  )  Object_setName ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Sets the name of the object " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setSize " ,  (  PyCFunction  )  Object_setSize ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Set the object's size. The first argument must be a vector \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2004-01-23 02:59:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								triple . " },  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " setTimeOffset " ,  (  PyCFunction  )  Object_setTimeOffset ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Set the object's time offset. " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " makeTrack " ,  (  PyCFunction  )  Object_makeTrack ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " (trackedobj, fast = 0) - Make this object track another. \n \
 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 ( trackedobj )  -  the  object  that  will  be  tracked . \ n \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 ( fast  =  0 )  -  if  0 :  update  the  scene  hierarchy  automatically .   If  you \ n \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 set  ' fast '  to  a  nonzero  value ,  don ' t  forget  to  update  the  scene  yourself \ n \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 ( see  scene . update ( ) ) . " }, 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " shareFrom " ,  (  PyCFunction  )  Object_shareFrom ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " Link data of self with object specified in the argument. This \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								works  only  if  self  and  the  object  specified  are  of  the  same  type . " },  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " select " ,  (  PyCFunction  )  Object_Select ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " ( 1 or 0 )  - Set the selected state of the object. \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-02 06:19:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								   1  is  selected ,  0  not  selected  " }, 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " setIpo " ,  (  PyCFunction  )  Object_setIpo ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " (Blender Ipo) - Sets the object's ipo " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " clearIpo " ,  (  PyCFunction  )  Object_clearIpo ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " () - Unlink ipo from this object " } , 
							 
						 
					
						
							
								
									
										
										
										
											2005-03-19 23:47:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 { " insertIpoKey " ,  (  PyCFunction  )  Object_insertIpoKey ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " ( Object IPO type ) - Inserts a key into IPO " } , 
							 
						 
					
						
							
								
									
										
										
										
											2005-12-14 17:44:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 { " insertPoseKey " ,  (  PyCFunction  )  Object_insertPoseKey ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " ( Object Pose type ) - Inserts a key into Action " } , 
							 
						 
					
						
							
								
									
										
										
										
											2005-12-18 20:14:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 { " insertCurrentPoseKey " ,  (  PyCFunction  )  Object_insertCurrentPoseKey ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " ( Object Pose type ) - Inserts a key into Action based on current pose " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 { " insertMatrixKey " ,  (  PyCFunction  )  Object_insertMatrixKey ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " (  ) - Inserts a key into Action based on current/giventime object matrix " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 { " bake_to_action " ,  (  PyCFunction  )  Object_bake_to_action ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " (  ) - creates a new action with the information from object animations " } , 
							 
						 
					
						
							
								
									
										
										
										
											2006-02-01 22:21:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 { " setConstraintInfluenceForBone " ,  (  PyCFunction  )  Object_setConstraintInfluenceForBone ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									  " (  ) - sets a constraint influence for a certain bone in this (armature)object. " } , 
							 
						 
					
						
							
								
									
										
										
										
											2006-02-08 16:58:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 { " copyNLA " ,  (  PyCFunction  )  Object_copyNLA ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									  " (  ) - copies all NLA strips from another object to this object. " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " convertActionToStrip " ,  (  PyCFunction  )  Object_convertActionToStrip ,  METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " (  ) - copies all NLA strips from another object to this object. " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getAllProperties " ,  (  PyCFunction  )  Object_getAllProperties ,  METH_NOARGS , 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 " () - Get all the properties from this object " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " addProperty " ,  (  PyCFunction  )  Object_addProperty ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " () - Add a property to this object " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " removeProperty " ,  (  PyCFunction  )  Object_removeProperty ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " () - Remove a property from  this object " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getProperty " ,  (  PyCFunction  )  Object_getProperty ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " () - Get a property from this object by name " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " removeAllProperties " ,  (  PyCFunction  )  Object_removeAllProperties , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 METH_NOARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " () - removeAll a properties from this object " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " copyAllPropertiesTo " ,  (  PyCFunction  )  Object_copyAllPropertiesTo , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " () - copy all properties from this object to another object " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " getScriptLinks " ,  (  PyCFunction  )  Object_getScriptLinks ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " (eventname) - Get a list of this object's scriptlinks (Text names)  " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " of the given type \n " 
							 
						 
					
						
							
								
									
										
										
										
											2005-05-27 05:39:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 " (eventname) - string: FrameChanged, Redraw or Render. " } , 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " addScriptLink " ,  (  PyCFunction  )  Object_addScriptLink ,  METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " (text, evt) - Add a new object scriptlink. \n " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " (text) - string: an existing Blender Text name; \n " 
							 
						 
					
						
							
								
									
										
										
										
											2005-05-27 05:39:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 " (evt) string: FrameChanged, Redraw or Render. " } , 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " clearScriptLinks " ,  (  PyCFunction  )  Object_clearScriptLinks , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-21 19:44:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 METH_VARARGS , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " () - Delete all scriptlinks from this object. \n " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 " ([s1<,s2,s3...>]) - Delete specified scriptlinks from this object. " } , 
							 
						 
					
						
							
								
									
										
										
										
											2005-03-06 14:55:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " setDupliVerts " ,  (  PyCFunction  )  Object_setDupliVerts , 
							 
						 
					
						
							
								
									
										
										
										
											2005-03-12 11:38:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 METH_VARARGS ,  " () - set or reset duplicate child objects on all vertices " } , 
							 
						 
					
						
							
								
									
										
										
										
											2006-02-27 04:05:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " setDupliFrames " ,  (  PyCFunction  )  Object_setDupliFrames , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 METH_VARARGS ,  " - set or reset state of Frames duplicates propertie " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setDupliGroup " ,  (  PyCFunction  )  Object_setDupliGroup , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 METH_VARARGS ,  " - set or reset state of Group duplicates propertie " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setDupliRot " ,  (  PyCFunction  )  Object_setDupliRot , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 METH_VARARGS ,  " - set or reset state of Rot duplicates propertie " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " setDupliNoSpeed " ,  (  PyCFunction  )  Object_setDupliNoSpeed , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 METH_VARARGS ,  " - set or reset state of Nospeed duplicates propertie " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " insertShapeKey " ,  (  PyCFunction  )  Object_insertShapeKey , 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-17 06:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 METH_NOARGS ,  " () - Insert a Shape Key in the current object " } , 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ NULL ,  NULL ,  0 ,  NULL } 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* PythonTypeObject callback function prototypes			 */  
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  void  Object_dealloc (  BPy_Object  *  obj  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getAttr (  BPy_Object  *  obj ,  char  * name  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  int  Object_setAttr (  BPy_Object  *  obj ,  char  * name ,  PyObject  *  v  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_repr (  BPy_Object  *  obj  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  int  Object_compare (  BPy_Object  *  a ,  BPy_Object  *  b  ) ;  
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Python TypeObject structure definition.				 */  
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								PyTypeObject  Object_Type  =  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject_HEAD_INIT (  NULL  )  /* requred macro */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									0 , 	/* ob_size */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									" Blender Object " , 	/* tp_name */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									sizeof (  BPy_Object  ) , 	/* tp_basicsize */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									0 , 			/* tp_itemsize */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* methods */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									(  destructor  )  Object_dealloc , 	/* tp_dealloc */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									0 , 			/* tp_print */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									(  getattrfunc  )  Object_getAttr , 	/* tp_getattr */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									(  setattrfunc  )  Object_setAttr , 	/* tp_setattr */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									(  cmpfunc  )  Object_compare , 	/* tp_compare */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									(  reprfunc  )  Object_repr , 	/* 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_Object_methods , 	/* tp_methods */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									0 , 			/* tp_members */ 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-09 15:53:35 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 04:01:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-03-08 18:10:20 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Function:			  M_Object_New				 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Python equivalent:	  Blender.Object.New				 */  
						 
					
						
							
								
									
										
										
										
											2003-03-08 18:10:20 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								PyObject  * M_Object_New (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									struct  Object  * object ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * str_type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * name  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " s|s " ,  & str_type ,  & name  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												" string expected as argument "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  strcmp (  str_type ,  " Armature "  )  = =  0  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										type  =  OB_ARMATURE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if (  strcmp (  str_type ,  " Camera "  )  = =  0  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										type  =  OB_CAMERA ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if (  strcmp (  str_type ,  " Curve "  )  = =  0  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										type  =  OB_CURVE ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-03-06 14:55:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  if  ( strcmp  ( str_type ,  " Text " )  = =  0 ) 	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										type  =  OB_FONT ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  if (  strcmp (  str_type ,  " Lamp "  )  = =  0  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										type  =  OB_LAMP ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if (  strcmp (  str_type ,  " Lattice "  )  = =  0  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										type  =  OB_LATTICE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if (  strcmp (  str_type ,  " Mball "  )  = =  0  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										type  =  OB_MBALL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if (  strcmp (  str_type ,  " Mesh "  )  = =  0  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										type  =  OB_MESH ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if (  strcmp (  str_type ,  " Surf "  )  = =  0  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										type  =  OB_SURF ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*	else if (strcmp (str_type, "Wave") == 0)	type = OB_WAVE; */  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  if (  strcmp (  str_type ,  " Empty "  )  = =  0  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										type  =  OB_EMPTY ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" Unknown type specified "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* Create a new object. */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  name  = =  NULL  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* No name is specified, set the name to the type of the object. */ 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										name  =  str_type ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									object  =  alloc_libblock (  & (  G . main - > object  ) ,  ID_OB ,  name  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									object - > flag  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									object - > type  =  ( short ) type ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* transforms */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									QuatOne (  object - > quat  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									QuatOne (  object - > dquat  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									object - > col [ 3 ]  =  1.0 ; 	// alpha 
 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									object - > size [ 0 ]  =  object - > size [ 1 ]  =  object - > size [ 2 ]  =  1.0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									object - > loc [ 0 ]  =  object - > loc [ 1 ]  =  object - > loc [ 2 ]  =  0.0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Mat4One (  object - > parentinv  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Mat4One (  object - > obmat  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									object - > dt  =  OB_SHADED ; 	// drawtype
 
							 
						 
					
						
							
								
									
										
										
										
											2006-02-27 06:00:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									object - > empty_drawsize =  1.0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									object - > empty_drawtype =  OB_ARROWS ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  U . flag  &  USER_MAT_ON_OB  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										object - > colbits  =  - 1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									switch  (  object - > type  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_CAMERA : 	/* fall through. */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_LAMP : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										object - > trackflag  =  OB_NEGZ ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										object - > upflag  =  OB_POSY ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										object - > trackflag  =  OB_POSY ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										object - > upflag  =  OB_POSZ ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									object - > ipoflag  =  OB_OFFS_OB  +  OB_OFFS_PARENT ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* duplivert settings */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									object - > dupon  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									object - > dupoff  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									object - > dupsta  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									object - > dupend  =  100 ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* Gameengine defaults */ 
							 
						 
					
						
							
								
									
										
										
										
											2005-05-22 17:40:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									object - > mass  =  1.0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									object - > inertia  =  1.0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									object - > formfactor  =  0.4f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									object - > damping  =  0.04f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									object - > rdamping  =  0.1f ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-05-22 17:40:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									object - > anisotropicFriction [ 0 ]  =  1.0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									object - > anisotropicFriction [ 1 ]  =  1.0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									object - > anisotropicFriction [ 2 ]  =  1.0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									object - > gameflag  =  OB_PROP ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									object - > lay  =  1 ; 	// Layer, by default visible
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									G . totobj + + ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									object - > data  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* user count be incremented in Object_CreatePyObject */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									object - > id . us  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* Create a Python object from it. */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  Object_CreatePyObject (  object  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Function:	  M_Object_Get						*/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Python equivalent:	  Blender.Object.Get				*/  
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								PyObject  * M_Object_Get (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									struct  Object  * object ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * blen_object ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									char  * name  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyArg_ParseTuple (  args ,  " |s " ,  & name  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  name  ! =  NULL  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										object  =  GetObjectByName (  name  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											/* No object exists with the name specified in the argument name. */ 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-14 02:13:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  ! object  ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											char  buffer [ 128 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											PyOS_snprintf (  buffer ,  sizeof ( buffer ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														   " object  \" %s \"  not found " ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  EXPP_ReturnPyObjError (  PyExc_ValueError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
																		  buffer  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2003-04-21 20:33:06 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  Object_CreatePyObject (  object  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										/* No argument has been given. Return a list of all objects. */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										PyObject  * obj_list ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Link  * link ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										int  index ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										obj_list  =  PyList_New (  BLI_countlist (  & (  G . main - > object  )  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  ! obj_list  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  EXPP_ReturnPyObjError (  PyExc_SystemError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															" List creation failed. "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										link  =  G . main - > object . first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										index  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										while (  link  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											object  =  (  Object  *  )  link ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											blen_object  =  Object_CreatePyObject (  object  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if (  ! blen_object  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Py_DECREF (  obj_list  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Py_RETURN_NONE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											PyList_SetItem (  obj_list ,  index ,  blen_object  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											index + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											link  =  link - > next ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  obj_list ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-02-26 19:22:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-03-08 18:10:20 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Function:	  M_Object_GetSelected				*/  
						 
					
						
							
								
									
										
										
										
											2004-11-30 02:27:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Python equivalent:	  Blender.Object.GetSelected		*/  
						 
					
						
							
								
									
										
										
										
											2003-03-08 18:10:20 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * M_Object_GetSelected (  PyObject  *  self  )  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * blen_object ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * list ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Base  * base_iter ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-01-03 06:14:53 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									list  =  PyList_New (  0  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  G . vd  = =  NULL  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-03 06:14:53 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										/* No 3d view has been initialized yet, simply return an empty list */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  list ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-03 06:14:53 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  (  G . scene - > basact  )  & & 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									    (  (  G . scene - > basact - > flag  &  SELECT  )  & & 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									      (  G . scene - > basact - > lay  &  G . vd - > lay  )  )  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										/* Active object is first in the list. */ 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										blen_object  =  Object_CreatePyObject (  G . scene - > basact - > object  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  ! blen_object  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Py_DECREF (  list  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Py_RETURN_NONE ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										PyList_Append (  list ,  blen_object  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-10-11 17:05:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Py_DECREF (  blen_object  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									base_iter  =  G . scene - > base . first ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									while (  base_iter  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  (  (  base_iter - > flag  &  SELECT  )  & & 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-03 06:14:53 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												(  base_iter - > lay  &  G . vd - > lay  )  )  & & 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												(  base_iter  ! =  G . scene - > basact  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											blen_object  =  Object_CreatePyObject (  base_iter - > object  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-03 06:14:53 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											if (  blen_object  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												PyList_Append (  list ,  blen_object  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Py_DECREF (  blen_object  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										base_iter  =  base_iter - > next ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  list ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-02-26 19:22:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2003-03-08 18:10:20 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-12-30 11:54:53 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Function:			  M_Object_Duplicate				 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Python equivalent:	  Blender.Object.Duplicate				 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2006-01-02 10:40:13 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * M_Object_Duplicate (  PyObject  *  self ,  PyObject  *  args ,  PyObject  * kwd  )  
						 
					
						
							
								
									
										
										
										
											2005-12-30 11:54:53 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2006-01-02 10:40:13 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  dupflag =  0 ;  /* this a flag, passed to adduplicate() and used instead of U.dupflag sp python can set what is duplicated */ 	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* the following variables are bools, if set true they will modify the dupflag to pass to adduplicate() */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  mesh_dupe  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  surface_dupe  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  curve_dupe  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  text_dupe  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  metaball_dupe  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  armature_dupe  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  lamp_dupe  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  material_dupe  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  texture_dupe  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  ipo_dupe  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									static  char  * kwlist [ ]  =  { " mesh " ,  " surface " ,  " curve " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" text " ,  " metaball " ,  " armature " ,  " lamp " ,  " material " ,  " texture " ,  " ipo " ,  NULL } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( ! PyArg_ParseTupleAndKeywords ( args ,  kwd ,  " |iiiiiiiiii " ,  kwlist , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										& mesh_dupe ,  & surface_dupe ,  & curve_dupe ,  & text_dupe ,  & metaball_dupe , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										& armature_dupe ,  & lamp_dupe ,  & material_dupe ,  & texture_dupe ,  & ipo_dupe ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												" expected nothing or bool keywords 'mesh', 'surface', 'curve', 'text', 'metaball', 'armature', 'lamp' 'material', 'texture' and 'ipo' as arguments "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* USER_DUP_ACT for actions is not supported in the UI so dont support it here */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( mesh_dupe ) 		dupflag  | =  USER_DUP_MESH ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( surface_dupe ) 	dupflag  | =  USER_DUP_SURF ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( curve_dupe ) 		dupflag  | =  USER_DUP_CURVE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( text_dupe ) 		dupflag  | =  USER_DUP_FONT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( metaball_dupe ) 	dupflag  | =  USER_DUP_MBALL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( armature_dupe ) 	dupflag  | =  USER_DUP_ARM ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( lamp_dupe ) 		dupflag  | =  USER_DUP_LAMP ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( material_dupe ) 	dupflag  | =  USER_DUP_MAT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( texture_dupe ) 	dupflag  | =  USER_DUP_TEX ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( ipo_dupe ) 		dupflag  | =  USER_DUP_IPO ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-02 23:26:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									adduplicate ( 2 ,  dupflag ) ;  /* 2 is a mode with no transform and no redraw, Duplicate the current selection, context sensitive */ 
							 
						 
					
						
							
								
									
										
										
										
											2005-12-30 11:54:53 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_RETURN_NONE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-03-08 18:10:20 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Function:	 initObject						*/  
						 
					
						
							
								
									
										
										
										
											2003-03-08 18:10:20 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								PyObject  * Object_Init (  void  )  
						 
					
						
							
								
									
										
										
										
											2003-03-08 18:10:20 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2006-01-11 19:40:06 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * module ,  * dict ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-03-08 18:10:20 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Object_Type . ob_type  =  & PyType_Type ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-02 20:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									module  =  Py_InitModule3 (  " Blender.Object " ,  M_Object_methods , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												 M_Object_doc  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-03-08 18:10:20 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-03-19 23:47:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyModule_AddIntConstant (  module ,  " LOC " ,  IPOKEY_LOC  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyModule_AddIntConstant (  module ,  " ROT " ,  IPOKEY_ROT  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyModule_AddIntConstant (  module ,  " SIZE " ,  IPOKEY_SIZE  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyModule_AddIntConstant (  module ,  " LOCROT " ,  IPOKEY_LOCROT  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyModule_AddIntConstant (  module ,  " LOCROTSIZE " ,  IPOKEY_LOCROTSIZE  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyModule_AddIntConstant (  module ,  " PI_STRENGTH " ,  IPOKEY_PI_STRENGTH  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyModule_AddIntConstant (  module ,  " PI_FALLOFF " ,  IPOKEY_PI_FALLOFF  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyModule_AddIntConstant (  module ,  " PI_SURFACEDAMP " ,  IPOKEY_PI_SURFACEDAMP  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyModule_AddIntConstant (  module ,  " PI_RANDOMDAMP " ,  IPOKEY_PI_RANDOMDAMP  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyModule_AddIntConstant (  module ,  " PI_PERM " ,  IPOKEY_PI_PERM  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyModule_AddIntConstant (  module ,  " NONE " , 0  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyModule_AddIntConstant (  module ,  " FORCE " , PFIELD_FORCE  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyModule_AddIntConstant (  module ,  " VORTEX " , PFIELD_VORTEX  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyModule_AddIntConstant (  module ,  " MAGNET " , PFIELD_MAGNET  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyModule_AddIntConstant (  module ,  " WIND " , PFIELD_WIND  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-01-11 19:40:06 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										//Add SUBMODULES to the module
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									dict  =  PyModule_GetDict (  module  ) ;  //borrowed
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyDict_SetItemString ( dict ,  " Pose " ,  Pose_Init ( ) ) ;  //creates a *new* module
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//PyDict_SetItemString(dict, "Constraint", Constraint_Init()); //creates a *new* module
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  module  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-03-08 18:10:20 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-03-15 19:14:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Python BPy_Object methods:					*/  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2003-07-25 19:52:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_buildParts (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2003-10-28 23:23:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									void  build_particle_system (  Object  *  ob  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									struct  Object  * obj  =  self - > object ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-28 23:23:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									build_particle_system (  obj  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-07-25 19:52:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-07-25 19:52:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_clearIpo (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Object  * ob  =  self - > object ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Ipo  * ipo  =  (  Ipo  *  )  ob - > ipo ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ipo  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										ID  * id  =  & ipo - > id ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  id - > us  >  0  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											id - > us - - ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										ob - > ipo  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-02-09 15:53:35 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  EXPP_incr_ret_True ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-02-09 15:53:35 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  EXPP_incr_ret_False ( ) ;  /* no ipo found */ 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_clrParent (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  mode  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  fast  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " |ii " ,  & mode ,  & fast  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected one or two integers as arguments "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* Remove the link only, the object is still in the scene. */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > parent  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  mode  = =  2  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										/* Keep transform */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										apply_obmat (  self - > object  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! fast  )  { 
							 
						 
					
						
							
								
									
										
											 
										
											
												Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
  centralized. Calls to where_is_object and makeDispList are
  forbidden, instead we tag objects 'changed' and let the
  depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
  constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
  flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
   That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
  and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
  for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
  the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
  on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
  (wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
  (But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
  position anymore. That system looks nice (no flips) but is not well
  suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
  IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
											 
										 
										
											2005-07-03 17:35:38 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										DAG_scene_sort (  G . scene  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_clearTrack (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  mode  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  fast  =  0 ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " |ii " ,  & mode ,  & fast  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected one or two integers as arguments "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* Remove the link only, the object is still in the scene. */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > track  =  NULL ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  mode  )  { 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										/* Keep transform */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										apply_obmat (  self - > object  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! fast  )  { 
							 
						 
					
						
							
								
									
										
											 
										
											
												Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
  centralized. Calls to where_is_object and makeDispList are
  forbidden, instead we tag objects 'changed' and let the
  depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
  constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
  flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
   That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
  and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
  for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
  the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
  on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
  (wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
  (But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
  position anymore. That system looks nice (no flips) but is not well
  suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
  IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
											 
										 
										
											2005-07-03 17:35:38 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										DAG_scene_sort (  G . scene  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* adds object data to a Blender object, if object->data = NULL */  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								int  EXPP_add_obdata (  struct  Object  * object  )  
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  object - > data  ! =  NULL  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  - 1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									switch  (  object - > type  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  OB_ARMATURE : 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										/* TODO: Do we need to add something to G? (see the OB_LAMP case) */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										object - > data  =  add_armature (   ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  OB_CAMERA : 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										/* TODO: Do we need to add something to G? (see the OB_LAMP case) */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										object - > data  =  add_camera (   ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  OB_CURVE : 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										object - > data  =  add_curve (  OB_CURVE  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										G . totcurve + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  OB_LAMP : 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										object - > data  =  add_lamp (   ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										G . totlamp + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  OB_MESH : 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										object - > data  =  add_mesh (   ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										G . totmesh + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-11-13 04:00:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  OB_LATTICE : 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										object - > data  =  (  void  *  )  add_lattice (   ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										object - > dt  =  OB_WIRE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-08 07:27:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  OB_MBALL : 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										object - > data  =  add_mball (   ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-12-29 12:06:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										/* TODO the following types will be supported later,
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										   be  sure  to  update  Scene_link  when  new  types  are  supported 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										   case  OB_SURF : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										   object - > data  =  add_curve ( OB_SURF ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										   G . totcurve + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										   break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										   case  OB_FONT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										   object - > data  =  add_curve ( OB_FONT ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										   break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										   case  OB_WAVE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										   object - > data  =  add_wave ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										   break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										 */ 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									default : 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! object - > data  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  - 1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-04-03 20:24:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-04-02 17:01:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getData (  BPy_Object  * self ,  PyObject  * args ,  PyObject  * kwd  )  
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * data_object ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Object  * object  =  self - > object ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-09 05:19:24 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  name_only  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-04 15:17:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  mesh  =  0 ; 		/* default mesh type = NMesh */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									static  char  * kwlist [ ]  =  { " name_only " ,  " mesh " ,  NULL } ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-02 03:38:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-10-04 15:17:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( ! PyArg_ParseTupleAndKeywords ( args ,  kwd ,  " |ii " ,  kwlist ,  & name_only ,  & mesh ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-02 03:38:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-02 17:01:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											" expected nothing or bool keyword 'name_only' as argument "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* if there's no obdata, try to create it */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  object - > data  = =  NULL  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  EXPP_add_obdata (  object  )  ! =  0  )  { 	/* couldn't create obdata */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-02-02 03:38:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* user wants only the name of the data object */ 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-09 05:19:24 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( name_only )  { 
							 
						 
					
						
							
								
									
										
										
										
											2005-03-01 02:37:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										ID  * id  =  object - > data ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-02 03:38:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										data_object  =  Py_BuildValue ( " s " ,  id - > name + 2 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( data_object )  return  data_object ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError  ( PyExc_MemoryError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" could not create a string pyobject! " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* user wants the data object wrapper */ 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									data_object  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									switch  (  object - > type  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_ARMATURE : 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-07 20:03:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										data_object  =  PyArmature_FromArmature (  object - > data  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_CAMERA : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										data_object  =  Camera_CreatePyObject (  object - > data  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_CURVE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										data_object  =  Curve_CreatePyObject (  object - > data  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  ID_IM : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										data_object  =  Image_CreatePyObject (  object - > data  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  ID_IP : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										data_object  =  Ipo_CreatePyObject (  object - > data  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_LAMP : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										data_object  =  Lamp_CreatePyObject (  object - > data  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_LATTICE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										data_object  =  Lattice_CreatePyObject (  object - > data  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  ID_MA : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_MESH : 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-04 15:17:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  ! mesh  ) 		/* get as NMesh (default) */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											data_object  =  NMesh_CreatePyObject (  object - > data ,  object  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										else 			/* else get as Mesh */ 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-27 19:37:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											data_object  =  Mesh_CreatePyObject (  object - > data ,  object  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  ID_OB : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										data_object  =  Object_CreatePyObject (  object - > data  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  ID_SCE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  ID_TXT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										data_object  =  Text_CreatePyObject (  object - > data  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-03-26 18:14:29 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  OB_FONT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										data_object  =  Text3d_CreatePyObject (  object - > data  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 		
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									case  ID_WO : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  data_object  = =  NULL  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  data_object  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getDeltaLocation (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * attr  =  Py_BuildValue (  " fff " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													self - > object - > dloc [ 0 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													self - > object - > dloc [ 1 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													self - > object - > dloc [ 2 ]  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-21 19:54:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  attr  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-21 19:54:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object.dloc attributes "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getDrawMode (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * attr  =  Py_BuildValue (  " b " ,  self - > object - > dtx  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-02 20:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  attr  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-02 20:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object.drawMode attribute "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getAction (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2004-04-19 06:57:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/*BPy_Action *py_action = NULL; */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-04-19 06:57:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! self - > object - > action  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  Action_CreatePyObject (  self - > object - > action  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-04-19 06:57:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-01-28 16:35:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								#if 0 
  
						 
					
						
							
								
									
										
										
										
											2005-12-18 20:14:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getPose (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/*BPy_Action *py_action = NULL; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-12-18 21:20:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  if (  ! self - > object - > pose  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  } 
							 
						 
					
						
							
								
									
										
										
										
											2005-12-18 20:14:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  Pose_CreatePyObject (  self - > object - > pose  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2004-06-02 06:19:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-01-28 16:35:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# endif 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  *  Object_getPose ( BPy_Object  * self )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//if there is no pose will return PyNone
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  PyPose_FromPose ( self - > object - > pose ,  self - > object - > id . name + 2 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2004-06-02 06:19:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_isSelected (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2004-06-02 06:19:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Base  * base ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									base  =  FIRSTBASE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									while (  base  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  base - > object  = =  self - > object  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if (  base - > flag  &  SELECT  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-09 15:53:35 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												return  EXPP_incr_ret_True ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-02 06:19:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-09 15:53:35 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												return  EXPP_incr_ret_False ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-02 06:19:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										base  =  base - > next ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-02 06:19:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" Internal error: could not find objects selection state "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-02 06:19:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getDrawType (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * attr  =  Py_BuildValue (  " b " ,  self - > object - > dt  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-21 19:54:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  attr  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-21 19:54:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object.drawType attribute "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getEuler (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
											 
										
											
												Mathutils update
- also included is some fixes for preprocessor inclues and some clean up of the previous commit
-rewrite and bugfixes
  ----------------------------------
  Here's my changelog:
  -fixed Rand() so that it doesn't seed everytime and should generate better random numbers
  - changed a few error return types to something more appropriate
  - clean up of uninitialized variables & removal of unneccessary objects
  - NMesh returns wrapped vectors now
  - World returns wrapped matrices now
  - Object.getEuler() and Object.getBoundingBox() return Wrapped data when data is present
  - Object.getMatrix() returns wrapped data if it's worldspace, 'localspace' returns a new matrix
  - Vector, Euler, Mat, Quat, call all now internally wrap object without destroying internal datablocks
  - Removed memory allocation (unneeded) from all methods
  - Vector's resize methods are only applicable to new vectors not wrapped data.
  - Matrix(), Quat(), Euler(), Vector() now accepts ANY sequence list, including tuples, list, or a self object to copy - matrices accept multiple sequences
  - Fixed Slerp() so that it now works correctly values are clamped between 0 and 1
  - Euler.rotate does internal rotation now
  - Slice assignment now works better for all types
  - Vector * Vector and Quat * Quat are defined and return the DOT product
  - Mat * Vec and Vec * Mat are defined now
  - Moved #includes to .c file from headers. Also fixed prototypes in mathutils
  - Added new helper functions for incref'ing to genutils
  - Major cleanup of header files includes - include Mathutils.h for access to math types
  - matrix.toQuat() and .toEuler() now fixed take appropriate matrix sizes
  - Matrix() with no parameters now returns an identity matrix by default not a zero matrix
  - printf() now prints with 6 digits instead of 4
  - printf() now prints output with object descriptor
  - Matrices now support [x][y] assignment (e.g. matrix[x][y] = 5.4)
  - Matrix[index] = value now expectes a sequence not an integer. This will now set a ROW of the matrix through a sequence.  index cannot go above the row size of the matrix.
  - slice operations on matrices work with sequences now (rows of the matrix) example:  mymatrix[0:2] returns a list of 2 wrapped vectors with access to the matrix data.
  - slice assignment will no longer modify the data if the assignment operation fails
  - fixed error in matrix * scalar multiplication
  - euler.toMatrix(), toQuat() no longer causes "creep" from repeated use
  - Wrapped data will generate wrapped objects when toEuler(), toQuat(), toMatrix() is used
  - Quats can be created with angle/axis, axis/angle
  - 4x4 matrices can be multiplied by 3D vectors (by popular demand :))
  - vec *quat / quat * vec is now defined
  - vec.magnitude alias for vec.length
  - all self, internal methods return a pointer to self now so you can do print vector.internalmethod() or vector.internalmethod().nextmethod() (no more print matrix.inverse() returning 'none')
  - these methods have been deprecated (still functioning but suggested to use the corrected functionality):
    * CopyVec() - replaced by Vector() functionality
    * CopyMat() - replaced by Matrix() functionality
    * CopyQuat() - replace by Quaternion() functionality
    * CopyEuler() - replaced by Euler() functionality
    * RotateEuler() - replaced by Euler.rotate() funtionality
    * MatMultVec() - replaced by matrix * vector
    * VecMultMat() - replaced by vector * matrix
  -  New struct containers references to python object data or internally allocated blender data for wrapping
  * Explaination here:  math structs now function as a 'simple wrapper' or a 'py_object' - data that is created on the fly will now be a 'py_object' with its memory managed by python
  *    otherwise if the data is returned by blender's G.main then the math object is a 'simple wrapper' and data can be accessed directly from the struct just like other python objects.
											 
										 
										
											2005-07-14 03:34:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									float  eul [ 3 ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-21 19:54:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												Mathutils update
- also included is some fixes for preprocessor inclues and some clean up of the previous commit
-rewrite and bugfixes
  ----------------------------------
  Here's my changelog:
  -fixed Rand() so that it doesn't seed everytime and should generate better random numbers
  - changed a few error return types to something more appropriate
  - clean up of uninitialized variables & removal of unneccessary objects
  - NMesh returns wrapped vectors now
  - World returns wrapped matrices now
  - Object.getEuler() and Object.getBoundingBox() return Wrapped data when data is present
  - Object.getMatrix() returns wrapped data if it's worldspace, 'localspace' returns a new matrix
  - Vector, Euler, Mat, Quat, call all now internally wrap object without destroying internal datablocks
  - Removed memory allocation (unneeded) from all methods
  - Vector's resize methods are only applicable to new vectors not wrapped data.
  - Matrix(), Quat(), Euler(), Vector() now accepts ANY sequence list, including tuples, list, or a self object to copy - matrices accept multiple sequences
  - Fixed Slerp() so that it now works correctly values are clamped between 0 and 1
  - Euler.rotate does internal rotation now
  - Slice assignment now works better for all types
  - Vector * Vector and Quat * Quat are defined and return the DOT product
  - Mat * Vec and Vec * Mat are defined now
  - Moved #includes to .c file from headers. Also fixed prototypes in mathutils
  - Added new helper functions for incref'ing to genutils
  - Major cleanup of header files includes - include Mathutils.h for access to math types
  - matrix.toQuat() and .toEuler() now fixed take appropriate matrix sizes
  - Matrix() with no parameters now returns an identity matrix by default not a zero matrix
  - printf() now prints with 6 digits instead of 4
  - printf() now prints output with object descriptor
  - Matrices now support [x][y] assignment (e.g. matrix[x][y] = 5.4)
  - Matrix[index] = value now expectes a sequence not an integer. This will now set a ROW of the matrix through a sequence.  index cannot go above the row size of the matrix.
  - slice operations on matrices work with sequences now (rows of the matrix) example:  mymatrix[0:2] returns a list of 2 wrapped vectors with access to the matrix data.
  - slice assignment will no longer modify the data if the assignment operation fails
  - fixed error in matrix * scalar multiplication
  - euler.toMatrix(), toQuat() no longer causes "creep" from repeated use
  - Wrapped data will generate wrapped objects when toEuler(), toQuat(), toMatrix() is used
  - Quats can be created with angle/axis, axis/angle
  - 4x4 matrices can be multiplied by 3D vectors (by popular demand :))
  - vec *quat / quat * vec is now defined
  - vec.magnitude alias for vec.length
  - all self, internal methods return a pointer to self now so you can do print vector.internalmethod() or vector.internalmethod().nextmethod() (no more print matrix.inverse() returning 'none')
  - these methods have been deprecated (still functioning but suggested to use the corrected functionality):
    * CopyVec() - replaced by Vector() functionality
    * CopyMat() - replaced by Matrix() functionality
    * CopyQuat() - replace by Quaternion() functionality
    * CopyEuler() - replaced by Euler() functionality
    * RotateEuler() - replaced by Euler.rotate() funtionality
    * MatMultVec() - replaced by matrix * vector
    * VecMultMat() - replaced by vector * matrix
  -  New struct containers references to python object data or internally allocated blender data for wrapping
  * Explaination here:  math structs now function as a 'simple wrapper' or a 'py_object' - data that is created on the fly will now be a 'py_object' with its memory managed by python
  *    otherwise if the data is returned by blender's G.main then the math object is a 'simple wrapper' and data can be accessed directly from the struct just like other python objects.
											 
										 
										
											2005-07-14 03:34:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									eul [ 0 ]  =  self - > object - > rot [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									eul [ 1 ]  =  self - > object - > rot [ 1 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									eul [ 2 ]  =  self - > object - > rot [ 2 ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-03 00:45:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-02 23:28:36 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  PyObject  *  )  newEulerObject (  eul ,  Py_NEW  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-21 19:54:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getInverseMatrix (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									MatrixObject  * inverse  = 
							 
						 
					
						
							
								
									
										
											 
										
											
												Mathutils update
- also included is some fixes for preprocessor inclues and some clean up of the previous commit
-rewrite and bugfixes
  ----------------------------------
  Here's my changelog:
  -fixed Rand() so that it doesn't seed everytime and should generate better random numbers
  - changed a few error return types to something more appropriate
  - clean up of uninitialized variables & removal of unneccessary objects
  - NMesh returns wrapped vectors now
  - World returns wrapped matrices now
  - Object.getEuler() and Object.getBoundingBox() return Wrapped data when data is present
  - Object.getMatrix() returns wrapped data if it's worldspace, 'localspace' returns a new matrix
  - Vector, Euler, Mat, Quat, call all now internally wrap object without destroying internal datablocks
  - Removed memory allocation (unneeded) from all methods
  - Vector's resize methods are only applicable to new vectors not wrapped data.
  - Matrix(), Quat(), Euler(), Vector() now accepts ANY sequence list, including tuples, list, or a self object to copy - matrices accept multiple sequences
  - Fixed Slerp() so that it now works correctly values are clamped between 0 and 1
  - Euler.rotate does internal rotation now
  - Slice assignment now works better for all types
  - Vector * Vector and Quat * Quat are defined and return the DOT product
  - Mat * Vec and Vec * Mat are defined now
  - Moved #includes to .c file from headers. Also fixed prototypes in mathutils
  - Added new helper functions for incref'ing to genutils
  - Major cleanup of header files includes - include Mathutils.h for access to math types
  - matrix.toQuat() and .toEuler() now fixed take appropriate matrix sizes
  - Matrix() with no parameters now returns an identity matrix by default not a zero matrix
  - printf() now prints with 6 digits instead of 4
  - printf() now prints output with object descriptor
  - Matrices now support [x][y] assignment (e.g. matrix[x][y] = 5.4)
  - Matrix[index] = value now expectes a sequence not an integer. This will now set a ROW of the matrix through a sequence.  index cannot go above the row size of the matrix.
  - slice operations on matrices work with sequences now (rows of the matrix) example:  mymatrix[0:2] returns a list of 2 wrapped vectors with access to the matrix data.
  - slice assignment will no longer modify the data if the assignment operation fails
  - fixed error in matrix * scalar multiplication
  - euler.toMatrix(), toQuat() no longer causes "creep" from repeated use
  - Wrapped data will generate wrapped objects when toEuler(), toQuat(), toMatrix() is used
  - Quats can be created with angle/axis, axis/angle
  - 4x4 matrices can be multiplied by 3D vectors (by popular demand :))
  - vec *quat / quat * vec is now defined
  - vec.magnitude alias for vec.length
  - all self, internal methods return a pointer to self now so you can do print vector.internalmethod() or vector.internalmethod().nextmethod() (no more print matrix.inverse() returning 'none')
  - these methods have been deprecated (still functioning but suggested to use the corrected functionality):
    * CopyVec() - replaced by Vector() functionality
    * CopyMat() - replaced by Matrix() functionality
    * CopyQuat() - replace by Quaternion() functionality
    * CopyEuler() - replaced by Euler() functionality
    * RotateEuler() - replaced by Euler.rotate() funtionality
    * MatMultVec() - replaced by matrix * vector
    * VecMultMat() - replaced by vector * matrix
  -  New struct containers references to python object data or internally allocated blender data for wrapping
  * Explaination here:  math structs now function as a 'simple wrapper' or a 'py_object' - data that is created on the fly will now be a 'py_object' with its memory managed by python
  *    otherwise if the data is returned by blender's G.main then the math object is a 'simple wrapper' and data can be accessed directly from the struct just like other python objects.
											 
										 
										
											2005-07-14 03:34:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										(  MatrixObject  *  )  newMatrixObject (  NULL ,  4 ,  4 ,  Py_NEW ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-03-09 19:45:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Mat4Invert (  ( float  (  *  ) [ 4 ] ) * inverse - > matrix ,  self - > object - > obmat  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  (  PyObject  *  )  inverse  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getIpo (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									struct  Ipo  * ipo  =  self - > object - > ipo ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-22 20:14:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! ipo  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  Py_None ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  Ipo_CreatePyObject (  ipo  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getLocation (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * attr  =  Py_BuildValue (  " fff " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													self - > object - > loc [ 0 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													self - > object - > loc [ 1 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													self - > object - > loc [ 2 ]  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-21 19:54:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  attr  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-21 19:54:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object.loc attributes "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getMaterials (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-07-20 08:16:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  all  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " |i " ,  & all  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected an int or nothing "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-20 08:16:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  EXPP_PyList_fromMaterialList (  self - > object - > mat , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													       self - > object - > totcol ,  all  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getMatrix (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
											 
										
											
												Mathutils update
- also included is some fixes for preprocessor inclues and some clean up of the previous commit
-rewrite and bugfixes
  ----------------------------------
  Here's my changelog:
  -fixed Rand() so that it doesn't seed everytime and should generate better random numbers
  - changed a few error return types to something more appropriate
  - clean up of uninitialized variables & removal of unneccessary objects
  - NMesh returns wrapped vectors now
  - World returns wrapped matrices now
  - Object.getEuler() and Object.getBoundingBox() return Wrapped data when data is present
  - Object.getMatrix() returns wrapped data if it's worldspace, 'localspace' returns a new matrix
  - Vector, Euler, Mat, Quat, call all now internally wrap object without destroying internal datablocks
  - Removed memory allocation (unneeded) from all methods
  - Vector's resize methods are only applicable to new vectors not wrapped data.
  - Matrix(), Quat(), Euler(), Vector() now accepts ANY sequence list, including tuples, list, or a self object to copy - matrices accept multiple sequences
  - Fixed Slerp() so that it now works correctly values are clamped between 0 and 1
  - Euler.rotate does internal rotation now
  - Slice assignment now works better for all types
  - Vector * Vector and Quat * Quat are defined and return the DOT product
  - Mat * Vec and Vec * Mat are defined now
  - Moved #includes to .c file from headers. Also fixed prototypes in mathutils
  - Added new helper functions for incref'ing to genutils
  - Major cleanup of header files includes - include Mathutils.h for access to math types
  - matrix.toQuat() and .toEuler() now fixed take appropriate matrix sizes
  - Matrix() with no parameters now returns an identity matrix by default not a zero matrix
  - printf() now prints with 6 digits instead of 4
  - printf() now prints output with object descriptor
  - Matrices now support [x][y] assignment (e.g. matrix[x][y] = 5.4)
  - Matrix[index] = value now expectes a sequence not an integer. This will now set a ROW of the matrix through a sequence.  index cannot go above the row size of the matrix.
  - slice operations on matrices work with sequences now (rows of the matrix) example:  mymatrix[0:2] returns a list of 2 wrapped vectors with access to the matrix data.
  - slice assignment will no longer modify the data if the assignment operation fails
  - fixed error in matrix * scalar multiplication
  - euler.toMatrix(), toQuat() no longer causes "creep" from repeated use
  - Wrapped data will generate wrapped objects when toEuler(), toQuat(), toMatrix() is used
  - Quats can be created with angle/axis, axis/angle
  - 4x4 matrices can be multiplied by 3D vectors (by popular demand :))
  - vec *quat / quat * vec is now defined
  - vec.magnitude alias for vec.length
  - all self, internal methods return a pointer to self now so you can do print vector.internalmethod() or vector.internalmethod().nextmethod() (no more print matrix.inverse() returning 'none')
  - these methods have been deprecated (still functioning but suggested to use the corrected functionality):
    * CopyVec() - replaced by Vector() functionality
    * CopyMat() - replaced by Matrix() functionality
    * CopyQuat() - replace by Quaternion() functionality
    * CopyEuler() - replaced by Euler() functionality
    * RotateEuler() - replaced by Euler.rotate() funtionality
    * MatMultVec() - replaced by matrix * vector
    * VecMultMat() - replaced by vector * matrix
  -  New struct containers references to python object data or internally allocated blender data for wrapping
  * Explaination here:  math structs now function as a 'simple wrapper' or a 'py_object' - data that is created on the fly will now be a 'py_object' with its memory managed by python
  *    otherwise if the data is returned by blender's G.main then the math object is a 'simple wrapper' and data can be accessed directly from the struct just like other python objects.
											 
										 
										
											2005-07-14 03:34:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									float  matrix [ 16 ]  =  { 0.0f ,  0.0f ,  0.0f ,  0.0f ,  0.0f ,  0.0f ,  0.0f ,  0.0f , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  	                 0.0f ,  0.0f ,  0.0f ,  0.0f ,  0.0f ,  0.0f ,  0.0f ,  1.0f } ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython -- a few fixes:
-- fixed bug #1689:
http://projects.blender.org/tracker/?func=detail&atid=125&aid=1689&group_id=9
Reported by Tom Musgrove (thanks), the problem was that Window.QHandle was not passing events to windows that had id's below the current active window.  It was a stupid mistake (mine), the code was iterating from curarea instead of from the first area in the areabase list.
-- fixed bug #1568:
http://projects.blender.org/tracker/index.php?func=detail&aid=1568&group_id=9&atid=125
Stephen investigated the problem, reported by Gabriel Beloin, and left hints in the bug report, thanks :).  I also implemented what he suggested, now Effect.Get('objname') returns a list with all objname's effects and as before, Get('objname, position') returns the effect at position 'position'.  Ref doc already updated.
-- Allowed menu registration lines to appear commented out -- Python comments: '#', of course -- (suggested by Michael Reimpell) in scripts:
Some Python doc tools need the doc strings between triple double-quotes, so to avoid conflicts scripts writers can now comment out the registration code, it should work anyway.  Michael also provided a patch for this a few days ago, too (thanks), but to keep changes at a minimum because of proximity to a release I didn't use it.
											 
										 
										
											2004-10-31 04:09:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									char  * space  =  " worldspace " ; 	/* default to world */ 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-22 20:14:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " |s " ,  & space  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected a string or nothing "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-26 14:38:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2005-05-22 17:40:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  BLI_streq (  space ,  " worldspace "  )  )  { 	/* Worldspace matrix */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										disable_where_script (  1  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										where_is_object (  self - > object  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										disable_where_script (  0  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									}  else  if (  BLI_streq (  space ,  " localspace "  )  )  { 	/* Localspace matrix */ 
							 
						 
					
						
							
								
									
										
											 
										
											
												Mathutils update
- also included is some fixes for preprocessor inclues and some clean up of the previous commit
-rewrite and bugfixes
  ----------------------------------
  Here's my changelog:
  -fixed Rand() so that it doesn't seed everytime and should generate better random numbers
  - changed a few error return types to something more appropriate
  - clean up of uninitialized variables & removal of unneccessary objects
  - NMesh returns wrapped vectors now
  - World returns wrapped matrices now
  - Object.getEuler() and Object.getBoundingBox() return Wrapped data when data is present
  - Object.getMatrix() returns wrapped data if it's worldspace, 'localspace' returns a new matrix
  - Vector, Euler, Mat, Quat, call all now internally wrap object without destroying internal datablocks
  - Removed memory allocation (unneeded) from all methods
  - Vector's resize methods are only applicable to new vectors not wrapped data.
  - Matrix(), Quat(), Euler(), Vector() now accepts ANY sequence list, including tuples, list, or a self object to copy - matrices accept multiple sequences
  - Fixed Slerp() so that it now works correctly values are clamped between 0 and 1
  - Euler.rotate does internal rotation now
  - Slice assignment now works better for all types
  - Vector * Vector and Quat * Quat are defined and return the DOT product
  - Mat * Vec and Vec * Mat are defined now
  - Moved #includes to .c file from headers. Also fixed prototypes in mathutils
  - Added new helper functions for incref'ing to genutils
  - Major cleanup of header files includes - include Mathutils.h for access to math types
  - matrix.toQuat() and .toEuler() now fixed take appropriate matrix sizes
  - Matrix() with no parameters now returns an identity matrix by default not a zero matrix
  - printf() now prints with 6 digits instead of 4
  - printf() now prints output with object descriptor
  - Matrices now support [x][y] assignment (e.g. matrix[x][y] = 5.4)
  - Matrix[index] = value now expectes a sequence not an integer. This will now set a ROW of the matrix through a sequence.  index cannot go above the row size of the matrix.
  - slice operations on matrices work with sequences now (rows of the matrix) example:  mymatrix[0:2] returns a list of 2 wrapped vectors with access to the matrix data.
  - slice assignment will no longer modify the data if the assignment operation fails
  - fixed error in matrix * scalar multiplication
  - euler.toMatrix(), toQuat() no longer causes "creep" from repeated use
  - Wrapped data will generate wrapped objects when toEuler(), toQuat(), toMatrix() is used
  - Quats can be created with angle/axis, axis/angle
  - 4x4 matrices can be multiplied by 3D vectors (by popular demand :))
  - vec *quat / quat * vec is now defined
  - vec.magnitude alias for vec.length
  - all self, internal methods return a pointer to self now so you can do print vector.internalmethod() or vector.internalmethod().nextmethod() (no more print matrix.inverse() returning 'none')
  - these methods have been deprecated (still functioning but suggested to use the corrected functionality):
    * CopyVec() - replaced by Vector() functionality
    * CopyMat() - replaced by Matrix() functionality
    * CopyQuat() - replace by Quaternion() functionality
    * CopyEuler() - replaced by Euler() functionality
    * RotateEuler() - replaced by Euler.rotate() funtionality
    * MatMultVec() - replaced by matrix * vector
    * VecMultMat() - replaced by vector * matrix
  -  New struct containers references to python object data or internally allocated blender data for wrapping
  * Explaination here:  math structs now function as a 'simple wrapper' or a 'py_object' - data that is created on the fly will now be a 'py_object' with its memory managed by python
  *    otherwise if the data is returned by blender's G.main then the math object is a 'simple wrapper' and data can be accessed directly from the struct just like other python objects.
											 
										 
										
											2005-07-14 03:34:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										object_to_mat4 (  self - > object ,  ( float  ( * ) [ 4 ] ) matrix  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  newMatrixObject ( matrix , 4 , 4 , Py_NEW ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-05-22 17:40:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									}  else  if (  BLI_streq (  space ,  " old_worldspace "  )  )  { 
							 
						 
					
						
							
								
									
										
											 
										
											
												Mathutils update
- also included is some fixes for preprocessor inclues and some clean up of the previous commit
-rewrite and bugfixes
  ----------------------------------
  Here's my changelog:
  -fixed Rand() so that it doesn't seed everytime and should generate better random numbers
  - changed a few error return types to something more appropriate
  - clean up of uninitialized variables & removal of unneccessary objects
  - NMesh returns wrapped vectors now
  - World returns wrapped matrices now
  - Object.getEuler() and Object.getBoundingBox() return Wrapped data when data is present
  - Object.getMatrix() returns wrapped data if it's worldspace, 'localspace' returns a new matrix
  - Vector, Euler, Mat, Quat, call all now internally wrap object without destroying internal datablocks
  - Removed memory allocation (unneeded) from all methods
  - Vector's resize methods are only applicable to new vectors not wrapped data.
  - Matrix(), Quat(), Euler(), Vector() now accepts ANY sequence list, including tuples, list, or a self object to copy - matrices accept multiple sequences
  - Fixed Slerp() so that it now works correctly values are clamped between 0 and 1
  - Euler.rotate does internal rotation now
  - Slice assignment now works better for all types
  - Vector * Vector and Quat * Quat are defined and return the DOT product
  - Mat * Vec and Vec * Mat are defined now
  - Moved #includes to .c file from headers. Also fixed prototypes in mathutils
  - Added new helper functions for incref'ing to genutils
  - Major cleanup of header files includes - include Mathutils.h for access to math types
  - matrix.toQuat() and .toEuler() now fixed take appropriate matrix sizes
  - Matrix() with no parameters now returns an identity matrix by default not a zero matrix
  - printf() now prints with 6 digits instead of 4
  - printf() now prints output with object descriptor
  - Matrices now support [x][y] assignment (e.g. matrix[x][y] = 5.4)
  - Matrix[index] = value now expectes a sequence not an integer. This will now set a ROW of the matrix through a sequence.  index cannot go above the row size of the matrix.
  - slice operations on matrices work with sequences now (rows of the matrix) example:  mymatrix[0:2] returns a list of 2 wrapped vectors with access to the matrix data.
  - slice assignment will no longer modify the data if the assignment operation fails
  - fixed error in matrix * scalar multiplication
  - euler.toMatrix(), toQuat() no longer causes "creep" from repeated use
  - Wrapped data will generate wrapped objects when toEuler(), toQuat(), toMatrix() is used
  - Quats can be created with angle/axis, axis/angle
  - 4x4 matrices can be multiplied by 3D vectors (by popular demand :))
  - vec *quat / quat * vec is now defined
  - vec.magnitude alias for vec.length
  - all self, internal methods return a pointer to self now so you can do print vector.internalmethod() or vector.internalmethod().nextmethod() (no more print matrix.inverse() returning 'none')
  - these methods have been deprecated (still functioning but suggested to use the corrected functionality):
    * CopyVec() - replaced by Vector() functionality
    * CopyMat() - replaced by Matrix() functionality
    * CopyQuat() - replace by Quaternion() functionality
    * CopyEuler() - replaced by Euler() functionality
    * RotateEuler() - replaced by Euler.rotate() funtionality
    * MatMultVec() - replaced by matrix * vector
    * VecMultMat() - replaced by vector * matrix
  -  New struct containers references to python object data or internally allocated blender data for wrapping
  * Explaination here:  math structs now function as a 'simple wrapper' or a 'py_object' - data that is created on the fly will now be a 'py_object' with its memory managed by python
  *    otherwise if the data is returned by blender's G.main then the math object is a 'simple wrapper' and data can be accessed directly from the struct just like other python objects.
											 
										 
										
											2005-07-14 03:34:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										/* old behavior, prior to 2.34, check this method's doc string: */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-26 14:38:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython:
- Blender.Window: added function GetPerspMatrix() (Tom Musgrave's patch, thanks);
- added Chris Want's patch to tell argc, argv to the Python interpreter (thanks, Hos);
- Blender.Image: added image.glFree() to free textures bound by the recently added
  image.glLoad() (both suggested by Campbell Barton -- thanks, with these Blender can
  be used to load textures for scripts);
- Blender.Sound: removed for now at least a few get/set methods of vars that can't be
  accessed via interface;
- renamed Get/makeActive to Get/setCurrent in Blender.World (actually added alias for
  now), same in Blender.Sound: renamed makeActive to setCurrent.  Stephen Swaney
  pointed this some weeks ago, we should stick to one naming convention.
- added documentation for Sound and Window.Theme modules and the other added
  functions, made other small updates.
- Blender.Object: made 'worldspace' become the default output of .getMatrix and .mat/.matrix:
  after reading a discussion on blender.org's Python forum where eeshlo mentioned the
  pre 2.34 default was worldspace, I took a better look at Blender's relevant code,
  confirmed, talked to Theeth about this and as he suggested am changing the default
  back to 'worldspace'.
											 
										 
										
											2004-10-20 05:51:24 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												" wrong parameter, expected nothing or either 'worldspace' (default), \n \
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								' localspace '  or  ' old_worldspace ' "  ) );  
						 
					
						
							
								
									
										
										
										
											2004-06-26 14:38:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
											 
										
											
												Mathutils update
- also included is some fixes for preprocessor inclues and some clean up of the previous commit
-rewrite and bugfixes
  ----------------------------------
  Here's my changelog:
  -fixed Rand() so that it doesn't seed everytime and should generate better random numbers
  - changed a few error return types to something more appropriate
  - clean up of uninitialized variables & removal of unneccessary objects
  - NMesh returns wrapped vectors now
  - World returns wrapped matrices now
  - Object.getEuler() and Object.getBoundingBox() return Wrapped data when data is present
  - Object.getMatrix() returns wrapped data if it's worldspace, 'localspace' returns a new matrix
  - Vector, Euler, Mat, Quat, call all now internally wrap object without destroying internal datablocks
  - Removed memory allocation (unneeded) from all methods
  - Vector's resize methods are only applicable to new vectors not wrapped data.
  - Matrix(), Quat(), Euler(), Vector() now accepts ANY sequence list, including tuples, list, or a self object to copy - matrices accept multiple sequences
  - Fixed Slerp() so that it now works correctly values are clamped between 0 and 1
  - Euler.rotate does internal rotation now
  - Slice assignment now works better for all types
  - Vector * Vector and Quat * Quat are defined and return the DOT product
  - Mat * Vec and Vec * Mat are defined now
  - Moved #includes to .c file from headers. Also fixed prototypes in mathutils
  - Added new helper functions for incref'ing to genutils
  - Major cleanup of header files includes - include Mathutils.h for access to math types
  - matrix.toQuat() and .toEuler() now fixed take appropriate matrix sizes
  - Matrix() with no parameters now returns an identity matrix by default not a zero matrix
  - printf() now prints with 6 digits instead of 4
  - printf() now prints output with object descriptor
  - Matrices now support [x][y] assignment (e.g. matrix[x][y] = 5.4)
  - Matrix[index] = value now expectes a sequence not an integer. This will now set a ROW of the matrix through a sequence.  index cannot go above the row size of the matrix.
  - slice operations on matrices work with sequences now (rows of the matrix) example:  mymatrix[0:2] returns a list of 2 wrapped vectors with access to the matrix data.
  - slice assignment will no longer modify the data if the assignment operation fails
  - fixed error in matrix * scalar multiplication
  - euler.toMatrix(), toQuat() no longer causes "creep" from repeated use
  - Wrapped data will generate wrapped objects when toEuler(), toQuat(), toMatrix() is used
  - Quats can be created with angle/axis, axis/angle
  - 4x4 matrices can be multiplied by 3D vectors (by popular demand :))
  - vec *quat / quat * vec is now defined
  - vec.magnitude alias for vec.length
  - all self, internal methods return a pointer to self now so you can do print vector.internalmethod() or vector.internalmethod().nextmethod() (no more print matrix.inverse() returning 'none')
  - these methods have been deprecated (still functioning but suggested to use the corrected functionality):
    * CopyVec() - replaced by Vector() functionality
    * CopyMat() - replaced by Matrix() functionality
    * CopyQuat() - replace by Quaternion() functionality
    * CopyEuler() - replaced by Euler() functionality
    * RotateEuler() - replaced by Euler.rotate() funtionality
    * MatMultVec() - replaced by matrix * vector
    * VecMultMat() - replaced by vector * matrix
  -  New struct containers references to python object data or internally allocated blender data for wrapping
  * Explaination here:  math structs now function as a 'simple wrapper' or a 'py_object' - data that is created on the fly will now be a 'py_object' with its memory managed by python
  *    otherwise if the data is returned by blender's G.main then the math object is a 'simple wrapper' and data can be accessed directly from the struct just like other python objects.
											 
										 
										
											2005-07-14 03:34:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  newMatrixObject ( ( float * ) self - > object - > obmat , 4 , 4 , Py_WRAP ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getName (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2003-06-28 15:10:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * attr  =  Py_BuildValue (  " s " ,  self - > object - > id . name  +  2  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-28 15:10:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  attr  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-28 15:10:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get the name of the Object "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-28 15:10:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getParent (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-21 19:54:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  self - > object - > parent  = =  NULL  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-07-30 18:47:05 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									attr  =  Object_CreatePyObject (  self - > object - > parent  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-21 19:54:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  attr  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  attr  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-21 19:54:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object.parent attribute "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 18:11:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getParentBoneName (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  self - > object - > parent  = =  NULL  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  self - > object - > parsubstr [ 0 ]  = =  ' \0 '  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									attr  =  Py_BuildValue (  " s " ,  self - > object - > parsubstr  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" Failed to get parent bone name "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getSize (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2004-01-23 02:59:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * attr  =  Py_BuildValue (  " fff " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													self - > object - > size [ 0 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													self - > object - > size [ 1 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													self - > object - > size [ 2 ]  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-01-23 02:59:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  attr  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-01-23 02:59:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object.size attributes "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-01-23 02:59:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getTimeOffset (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2004-04-02 18:38:38 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * attr  =  Py_BuildValue (  " f " ,  self - > object - > sf  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-04-02 18:38:38 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  attr  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-04-02 18:38:38 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object.sf attributes "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-04-02 18:38:38 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getTracked (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-21 19:54:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  self - > object - > track  = =  NULL  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-21 19:54:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									attr  =  Object_CreatePyObject (  self - > object - > track  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  attr  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-21 19:54:19 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object.track attribute "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getType (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									switch  (  self - > object - > type  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_ARMATURE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue (  " s " ,  " Armature "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_CAMERA : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue (  " s " ,  " Camera "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_CURVE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue (  " s " ,  " Curve "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_EMPTY : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue (  " s " ,  " Empty "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_FONT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue (  " s " ,  " Text "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_LAMP : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue (  " s " ,  " Lamp "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_LATTICE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue (  " s " ,  " Lattice "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_MBALL : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue (  " s " ,  " MBall "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_MESH : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue (  " s " ,  " Mesh "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_SURF : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue (  " s " ,  " Surf "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_WAVE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue (  " s " ,  " Wave "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue (  " s " ,  " unknown "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getBoundBox (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2003-09-20 03:40:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  * vec  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * vector ,  * bbox ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! self - > object - > data  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " This object isn't linked to any object data (mesh, curve, etc) yet "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! self - > object - > bb  )  { 	/* if no ob bbox, we look in obdata */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Mesh  * me ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Curve  * curve ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										switch  (  self - > object - > type  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  OB_MESH : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											me  =  self - > object - > data ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-07-14 18:04:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											vec  =  ( float * )  mesh_get_bb ( me ) - > vec ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  OB_CURVE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  OB_FONT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  OB_SURF : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											curve  =  self - > object - > data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if (  ! curve - > bb  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												tex_space_curve (  curve  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											vec  =  (  float  *  )  curve - > bb - > vec ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  Py_None ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-15 23:10:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										{ 		/* transform our obdata bbox by the obmat.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												   the  obmat  is  4 x4  homogeneous  coords  matrix . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												   each  bbox  coord  is  xyz ,  so  we  make  it  homogenous 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												   by  padding  it  with  w = 1.0  and  doing  the  matrix  mult . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												   afterwards  we  divide  by  w  to  get  back  to  xyz . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												 */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											/* printmatrix4( "obmat", self->object->obmat); */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											float  tmpvec [ 4 ] ; 	/* tmp vector for homogenous coords math */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											int  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											float  * from ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											bbox  =  PyList_New (  8  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if (  ! bbox  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												return  EXPP_ReturnPyObjError 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													(  PyExc_MemoryError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													  " couldn't create pylist "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											for (  i  =  0 ,  from  =  vec ;  i  <  8 ;  i + + ,  from  + =  3  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												memcpy (  tmpvec ,  from ,  3  *  sizeof (  float  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												tmpvec [ 3 ]  =  1.0f ; 	/* set w coord */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Mat4MulVec4fl (  self - > object - > obmat ,  tmpvec  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												/* divide x,y,z by w */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												tmpvec [ 0 ]  / =  tmpvec [ 3 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												tmpvec [ 1 ]  / =  tmpvec [ 3 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												tmpvec [ 2 ]  / =  tmpvec [ 3 ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-15 23:10:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								#if 0 
  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												{ 	/* debug print stuff */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													int  i ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-15 23:10:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													printf (  " \n obj bbox transformed \n "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													for (  i  =  0 ;  i  <  4 ;  + + i  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														printf (  " %f  " ,  tmpvec [ i ]  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-15 23:10:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													printf (  " \n "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-15 23:10:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# endif 
  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												/* because our bounding box is calculated and
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												   does  not  have  its  own  memory , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												   we  must  create  vectors  that  allocate  space  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												Mathutils update
- also included is some fixes for preprocessor inclues and some clean up of the previous commit
-rewrite and bugfixes
  ----------------------------------
  Here's my changelog:
  -fixed Rand() so that it doesn't seed everytime and should generate better random numbers
  - changed a few error return types to something more appropriate
  - clean up of uninitialized variables & removal of unneccessary objects
  - NMesh returns wrapped vectors now
  - World returns wrapped matrices now
  - Object.getEuler() and Object.getBoundingBox() return Wrapped data when data is present
  - Object.getMatrix() returns wrapped data if it's worldspace, 'localspace' returns a new matrix
  - Vector, Euler, Mat, Quat, call all now internally wrap object without destroying internal datablocks
  - Removed memory allocation (unneeded) from all methods
  - Vector's resize methods are only applicable to new vectors not wrapped data.
  - Matrix(), Quat(), Euler(), Vector() now accepts ANY sequence list, including tuples, list, or a self object to copy - matrices accept multiple sequences
  - Fixed Slerp() so that it now works correctly values are clamped between 0 and 1
  - Euler.rotate does internal rotation now
  - Slice assignment now works better for all types
  - Vector * Vector and Quat * Quat are defined and return the DOT product
  - Mat * Vec and Vec * Mat are defined now
  - Moved #includes to .c file from headers. Also fixed prototypes in mathutils
  - Added new helper functions for incref'ing to genutils
  - Major cleanup of header files includes - include Mathutils.h for access to math types
  - matrix.toQuat() and .toEuler() now fixed take appropriate matrix sizes
  - Matrix() with no parameters now returns an identity matrix by default not a zero matrix
  - printf() now prints with 6 digits instead of 4
  - printf() now prints output with object descriptor
  - Matrices now support [x][y] assignment (e.g. matrix[x][y] = 5.4)
  - Matrix[index] = value now expectes a sequence not an integer. This will now set a ROW of the matrix through a sequence.  index cannot go above the row size of the matrix.
  - slice operations on matrices work with sequences now (rows of the matrix) example:  mymatrix[0:2] returns a list of 2 wrapped vectors with access to the matrix data.
  - slice assignment will no longer modify the data if the assignment operation fails
  - fixed error in matrix * scalar multiplication
  - euler.toMatrix(), toQuat() no longer causes "creep" from repeated use
  - Wrapped data will generate wrapped objects when toEuler(), toQuat(), toMatrix() is used
  - Quats can be created with angle/axis, axis/angle
  - 4x4 matrices can be multiplied by 3D vectors (by popular demand :))
  - vec *quat / quat * vec is now defined
  - vec.magnitude alias for vec.length
  - all self, internal methods return a pointer to self now so you can do print vector.internalmethod() or vector.internalmethod().nextmethod() (no more print matrix.inverse() returning 'none')
  - these methods have been deprecated (still functioning but suggested to use the corrected functionality):
    * CopyVec() - replaced by Vector() functionality
    * CopyMat() - replaced by Matrix() functionality
    * CopyQuat() - replace by Quaternion() functionality
    * CopyEuler() - replaced by Euler() functionality
    * RotateEuler() - replaced by Euler.rotate() funtionality
    * MatMultVec() - replaced by matrix * vector
    * VecMultMat() - replaced by vector * matrix
  -  New struct containers references to python object data or internally allocated blender data for wrapping
  * Explaination here:  math structs now function as a 'simple wrapper' or a 'py_object' - data that is created on the fly will now be a 'py_object' with its memory managed by python
  *    otherwise if the data is returned by blender's G.main then the math object is a 'simple wrapper' and data can be accessed directly from the struct just like other python objects.
											 
										 
										
											2005-07-14 03:34:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												vector  =  newVectorObject (  NULL ,  3 ,  Py_NEW ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												memcpy (  (  (  VectorObject  *  )  vector  ) - > vec , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													tmpvec ,  3  *  sizeof (  float  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												PyList_SET_ITEM (  bbox ,  i ,  vector  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-15 23:10:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									}  else  { 		/* the ob bbox exists */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										vec  =  (  float  *  )  self - > object - > bb - > vec ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  ! vec  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														      " couldn't retrieve bounding box data "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										bbox  =  PyList_New (  8  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  ! bbox  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  EXPP_ReturnPyObjError (  PyExc_MemoryError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														      " couldn't create pylist "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										/* create vectors referencing object bounding box coords */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										for (  i  =  0 ;  i  <  8 ;  i + +  )  { 
							 
						 
					
						
							
								
									
										
											 
										
											
												Mathutils update
- also included is some fixes for preprocessor inclues and some clean up of the previous commit
-rewrite and bugfixes
  ----------------------------------
  Here's my changelog:
  -fixed Rand() so that it doesn't seed everytime and should generate better random numbers
  - changed a few error return types to something more appropriate
  - clean up of uninitialized variables & removal of unneccessary objects
  - NMesh returns wrapped vectors now
  - World returns wrapped matrices now
  - Object.getEuler() and Object.getBoundingBox() return Wrapped data when data is present
  - Object.getMatrix() returns wrapped data if it's worldspace, 'localspace' returns a new matrix
  - Vector, Euler, Mat, Quat, call all now internally wrap object without destroying internal datablocks
  - Removed memory allocation (unneeded) from all methods
  - Vector's resize methods are only applicable to new vectors not wrapped data.
  - Matrix(), Quat(), Euler(), Vector() now accepts ANY sequence list, including tuples, list, or a self object to copy - matrices accept multiple sequences
  - Fixed Slerp() so that it now works correctly values are clamped between 0 and 1
  - Euler.rotate does internal rotation now
  - Slice assignment now works better for all types
  - Vector * Vector and Quat * Quat are defined and return the DOT product
  - Mat * Vec and Vec * Mat are defined now
  - Moved #includes to .c file from headers. Also fixed prototypes in mathutils
  - Added new helper functions for incref'ing to genutils
  - Major cleanup of header files includes - include Mathutils.h for access to math types
  - matrix.toQuat() and .toEuler() now fixed take appropriate matrix sizes
  - Matrix() with no parameters now returns an identity matrix by default not a zero matrix
  - printf() now prints with 6 digits instead of 4
  - printf() now prints output with object descriptor
  - Matrices now support [x][y] assignment (e.g. matrix[x][y] = 5.4)
  - Matrix[index] = value now expectes a sequence not an integer. This will now set a ROW of the matrix through a sequence.  index cannot go above the row size of the matrix.
  - slice operations on matrices work with sequences now (rows of the matrix) example:  mymatrix[0:2] returns a list of 2 wrapped vectors with access to the matrix data.
  - slice assignment will no longer modify the data if the assignment operation fails
  - fixed error in matrix * scalar multiplication
  - euler.toMatrix(), toQuat() no longer causes "creep" from repeated use
  - Wrapped data will generate wrapped objects when toEuler(), toQuat(), toMatrix() is used
  - Quats can be created with angle/axis, axis/angle
  - 4x4 matrices can be multiplied by 3D vectors (by popular demand :))
  - vec *quat / quat * vec is now defined
  - vec.magnitude alias for vec.length
  - all self, internal methods return a pointer to self now so you can do print vector.internalmethod() or vector.internalmethod().nextmethod() (no more print matrix.inverse() returning 'none')
  - these methods have been deprecated (still functioning but suggested to use the corrected functionality):
    * CopyVec() - replaced by Vector() functionality
    * CopyMat() - replaced by Matrix() functionality
    * CopyQuat() - replace by Quaternion() functionality
    * CopyEuler() - replaced by Euler() functionality
    * RotateEuler() - replaced by Euler.rotate() funtionality
    * MatMultVec() - replaced by matrix * vector
    * VecMultMat() - replaced by vector * matrix
  -  New struct containers references to python object data or internally allocated blender data for wrapping
  * Explaination here:  math structs now function as a 'simple wrapper' or a 'py_object' - data that is created on the fly will now be a 'py_object' with its memory managed by python
  *    otherwise if the data is returned by blender's G.main then the math object is a 'simple wrapper' and data can be accessed directly from the struct just like other python objects.
											 
										 
										
											2005-07-14 03:34:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											vector  =  newVectorObject (  vec ,  3 ,  Py_WRAP  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											PyList_SET_ITEM (  bbox ,  i ,  vector  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											vec  + =  3 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  bbox ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-09-20 03:40:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-05-15 23:10:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_makeDisplayList (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2003-09-20 03:40:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Object  * ob  =  self - > object ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-09-20 03:40:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ob - > type  = =  OB_FONT  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										text_to_curve (  ob ,  0  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-09-20 03:40:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-15 20:56:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									DAG_object_flush_update ( G . scene ,  ob ,  OB_RECALC_DATA ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-09-20 03:40:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  Py_None ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-09-20 03:40:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_link (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * py_data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ID  * id ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ID  * oldid ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  obj_id ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									void  * data  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " O " ,  & py_data  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected an object as argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-07 20:03:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ArmatureObject_Check (  py_data  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										data  =  (  void  *  )  PyArmature_AsArmature ( ( BPy_Armature * ) py_data ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  if (  Camera_CheckPyObject (  py_data  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										data  =  (  void  *  )  Camera_FromPyObject (  py_data  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-04 15:17:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  if (  Lamp_CheckPyObject (  py_data  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										data  =  (  void  *  )  Lamp_FromPyObject (  py_data  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-04 15:17:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  if (  Curve_CheckPyObject (  py_data  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										data  =  (  void  *  )  Curve_FromPyObject (  py_data  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-30 03:05:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  if (  NMesh_CheckPyObject (  py_data  )  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-04 15:17:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										data  =  (  void  *  )  NMesh_FromPyObject (  py_data ,  self - > object  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-30 03:05:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  ! data  ) 		/* NULL means there is already an error */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									}  else  if (  Mesh_CheckPyObject (  py_data  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-27 19:37:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										data  =  (  void  *  )  Mesh_FromPyObject (  py_data ,  self - > object  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-04 15:17:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  if (  Lattice_CheckPyObject (  py_data  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										data  =  (  void  *  )  Lattice_FromPyObject (  py_data  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-04 15:17:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  if (  Metaball_CheckPyObject (  py_data  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										data  =  (  void  *  )  Metaball_FromPyObject (  py_data  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-04 15:17:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  if (  Text3d_CheckPyObject (  py_data  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2005-03-06 14:55:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										data  =  (  void  *  )  Text3d_FromPyObject (  py_data  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* have we set data to something good? */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! data  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" link argument type is not supported  "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									oldid  =  (  ID  *  )  self - > object - > data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									id  =  (  ID  *  )  data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									obj_id  =  MAKE_ID2 (  id - > name [ 0 ] ,  id - > name [ 1 ]  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									switch  (  obj_id  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  ID_AR : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  self - > object - > type  ! =  OB_ARMATURE  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															" The 'link' object is incompatible with the base object "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  ID_CA : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  self - > object - > type  ! =  OB_CAMERA  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															" The 'link' object is incompatible with the base object "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  ID_LA : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  self - > object - > type  ! =  OB_LAMP  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															" The 'link' object is incompatible with the base object "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  ID_ME : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  self - > object - > type  ! =  OB_MESH  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															" The 'link' object is incompatible with the base object "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  ID_CU : 
							 
						 
					
						
							
								
									
										
										
										
											2005-03-06 14:55:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  self - > object - > type  ! =  OB_CURVE  & &  self - > object - > type  ! =  OB_FONT  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															" The 'link' object is incompatible with the base object "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  ID_LT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  self - > object - > type  ! =  OB_LATTICE  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															" The 'link' object is incompatible with the base object "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  ID_MB : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  self - > object - > type  ! =  OB_MBALL  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															" The 'link' object is incompatible with the base object "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" Linking this object type is not supported "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > data  =  data ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-01-16 23:40:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-03-11 01:17:21 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* creates the curve for the text object */ 
							 
						 
					
						
							
								
									
										
										
										
											2005-03-19 03:24:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( self - > object - > type  = =  OB_FONT )  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										text_to_curve ( self - > object ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									id_us_plus (  id  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  oldid  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  oldid - > us  >  0  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											oldid - > us - - ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2006-03-11 01:17:21 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" old object reference count below 0 "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2006-03-11 01:17:21 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* make sure data and object materials are consistent */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									test_object_materials (  id  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-15 05:30:58 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_makeParentVertex (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * list ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * vlist ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * py_child ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * ret_val ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Object  * parent ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  noninverse  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  fast  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  partype ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  v1 ,  v2 = 0 ,  v3 = 0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  i ,  vlen ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* Check if the arguments passed to makeParent are valid. */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " OO|ii " ,  & list ,  & vlist ,  & noninverse ,  & fast  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected a list of objects, a tuple of integers and one or two integers as arguments "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PySequence_Check (  list  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected a list of objects "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( ! PyTuple_Check (  vlist  ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected a tuple of integers "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									vlen  =  PyTuple_Size (  vlist  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									switch  ( vlen )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  1 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  ! PyArg_ParseTuple (  vlist ,  " i " ,  & v1  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															" expected a tuple of 1 or 3 integers "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  (  v1  <  0  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError (  PyExc_ValueError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															" indices must be strictly positive "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										partype  =  PARVERT1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  3 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  ! PyArg_ParseTuple (  vlist ,  " iii " ,  & v1 ,  & v2 ,  & v3  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															" expected a tuple of 1 or 3 integers "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  (  v1  <  0  | |  v2  <  0  | |  v3  <  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError (  PyExc_ValueError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															" indices must be strictly positive "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										partype  =  PARVERT3 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected a tuple of 1 or 3 integers "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									parent  =  (  Object  *  )  self - > object ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( ! ELEM3 ( parent - > type ,  OB_MESH ,  OB_CURVE ,  OB_SURF ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" Parent Vertex only applies to curve, mesh or surface objects "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( parent - > id . us  = =  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError  ( PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" object must be linked to a scene before it can become a parent " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* Check if the PyObject passed in list is a Blender object. */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									for (  i  =  0 ;  i  <  PySequence_Length (  list  ) ;  i + +  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										py_child  =  PySequence_GetItem (  list ,  i  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										ret_val  =  internal_makeParent ( parent ,  py_child ,  partype ,  noninverse ,  fast ,  v1 ,  v2 ,  v3 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_DECREF  ( py_child ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( ret_val ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											Py_DECREF ( ret_val ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( ! fast ) 	/* need to sort when interupting in the middle of the list */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												DAG_scene_sort (  G . scene  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  NULL ;  /* error has been set already */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( ! fast )  /* otherwise, only sort at the end */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										DAG_scene_sort (  G . scene  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_makeParentDeform (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * list ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * py_child ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-07-15 05:30:58 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * ret_val ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Object  * parent ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  noninverse  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  fast  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  i ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* Check if the arguments passed to makeParent are valid. */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " O|ii " ,  & list ,  & noninverse ,  & fast  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected a list of objects and one or two integers as arguments "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PySequence_Check (  list  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected a list of objects "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-05-22 07:22:34 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									parent  =  (  Object  *  )  self - > object ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-15 05:30:58 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( parent - > type  ! =  OB_CURVE  & &  parent - > type  ! =  OB_ARMATURE ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_ValueError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" Parent Deform only applies to curve or armature objects "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-05-22 07:22:34 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( parent - > id . us  = =  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError  ( PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" object must be linked to a scene before it can become a parent " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* Check if the PyObject passed in list is a Blender object. */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									for (  i  =  0 ;  i  <  PySequence_Length (  list  ) ;  i + +  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										py_child  =  PySequence_GetItem (  list ,  i  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-15 05:30:58 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										ret_val  =  internal_makeParent ( parent ,  py_child ,  PARSKEL ,  noninverse ,  fast ,  0 ,  0 ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_DECREF  ( py_child ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( ret_val ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											Py_DECREF ( ret_val ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( ! fast ) 	/* need to sort when interupting in the middle of the list */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												DAG_scene_sort (  G . scene  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  NULL ;  /* error has been set already */ 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2005-07-15 05:30:58 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-15 05:30:58 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( ! fast )  /* otherwise, only sort at the end */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										DAG_scene_sort (  G . scene  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_makeParent (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * list ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * py_child ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * ret_val ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Object  * parent ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  noninverse  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  fast  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* Check if the arguments passed to makeParent are valid. */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " O|ii " ,  & list ,  & noninverse ,  & fast  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected a list of objects and one or two integers as arguments "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PySequence_Check (  list  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected a list of objects "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									parent  =  (  Object  *  )  self - > object ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( parent - > id . us  = =  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError  ( PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" object must be linked to a scene before it can become a parent " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* Check if the PyObject passed in list is a Blender object. */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									for (  i  =  0 ;  i  <  PySequence_Length (  list  ) ;  i + +  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										py_child  =  PySequence_GetItem (  list ,  i  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										ret_val  =  internal_makeParent ( parent ,  py_child ,  PAROBJECT ,  noninverse ,  fast ,  0 ,  0 ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_DECREF  ( py_child ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( ret_val ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											Py_DECREF ( ret_val ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( ! fast ) 	/* need to sort when interupting in the middle of the list */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												DAG_scene_sort (  G . scene  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  NULL ;  /* error has been set already */ 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2005-07-15 05:30:58 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( ! fast )  /* otherwise, only sort at the end */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										DAG_scene_sort (  G . scene  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-01-03 02:35:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_join (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * list ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * py_child ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Object  * parent ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Object  * child ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Scene  * temp_scene ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Scene  * orig_scene ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Base  * temp_base ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									short  type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  i ,  ok = 0 ,  ret_value = 0 ,  list_length = 0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* Check if the arguments passed to makeParent are valid. */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " O " ,  & list  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-05 15:53:07 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected a list of objects "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-03 02:35:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PySequence_Check (  list  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected a list of objects "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									list_length  =  PySequence_Length (  list  ) ;  /* if there are no objects to join then exit silently */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! list_length  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									parent  =  (  Object  *  )  self - > object ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									type  =  parent - > type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2006-01-05 15:53:07 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* Only these object types are sypported */ 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-03 02:35:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( type = = OB_MESH  | |  type = = OB_MESH  | |  type = = OB_CURVE  | |  type = = OB_SURF  | |  type = = OB_ARMATURE ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" Base object is not a type blender can join "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2006-01-05 15:53:07 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* exit editmode so join can be done */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  G . obedit  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										exit_editmode (  1  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2006-01-03 02:35:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									temp_scene  =  add_scene (  " Scene "  ) ;  /* make the new scene */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									temp_scene - > lay =  2097151 ;  /* all layers on */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* Check if the PyObject passed in list is a Blender object. */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									for (  i  =  0 ;  i  <  list_length ;  i + +  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										child  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										py_child  =  PySequence_GetItem (  list ,  i  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  ! Object_CheckPyObject (  py_child  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											/* Cleanup */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											free_libblock (  & G . main - > scene ,  temp_scene  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												" expected a list of objects, one or more of the list items is not a Blender Object. "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											/* List item is an object, is it the same type? */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											child  =  (  Object  *  )  Object_FromPyObject (  py_child  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( parent - > type  = =  child - > type )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												ok  = 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												/* Add a new base, then link the base to the temp_scene */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												temp_base  =  MEM_callocN (  sizeof (  Base  ) ,  " pynewbase "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												/*we know these types are the same, link to the temp scene for joining*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												temp_base - > object  =  child ; 	/* link object to the new base */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												temp_base - > flag  | =  SELECT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												temp_base - > lay  =  1 ;  /*1 layer on */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												BLI_addhead (  & temp_scene - > base ,  temp_base  ) ; 	/* finally, link new base to scene */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												/*child->id.us += 1;*/  /*Would useually increase user count but in this case its ok not to */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												child - > id . us  - =  1 ;  /* python object user oddness */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									orig_scene  =  G . scene ;  /* backup our scene */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* Add the main object into the temp_scene */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									temp_base  =  MEM_callocN (  sizeof (  Base  ) ,  " pynewbase "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									temp_base - > object  =  parent ; 	/* link object to the new base */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									temp_base - > flag  | =  SELECT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									temp_base - > lay  =  1 ;  /*1 layer on */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									BLI_addhead (  & temp_scene - > base ,  temp_base  ) ; 	/* finally, link new base to scene */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									parent - > id . us  + =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* all objects in the scene, set it active and the active object */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									set_scene (  temp_scene  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									set_active_base (  temp_base  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* Do the joining now we know everythings OK. */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( type  = =  OB_MESH ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										ret_value  =  join_mesh ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if ( type  = =  OB_CURVE ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										ret_value  =  join_curve ( OB_CURVE ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if ( type  = =  OB_SURF ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										ret_value  =  join_curve ( OB_SURF ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if ( type  = =  OB_ARMATURE ) 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-05 15:53:07 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										ret_value  =  join_armature ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* May use this for correcting object user counts later on */ 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-03 02:35:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/*
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( ! ret_value )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										temp_base  =  temp_scene - > base . first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										while (  base  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											object  =  base - > object ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											object - > id . us  + = 1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											base  =  base - > next ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* remove old scene */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									set_scene (  orig_scene  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									free_libblock (  & G . main - > scene ,  temp_scene  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2006-01-05 15:53:07 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* no objects were of the correct type, return None */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( ! ok ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* If the join failed then raise an error */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( ! ret_value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								" Blender failed to join the objects, this is not a script error \n \
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Please  add  exception  handeling  to  your  script  with  a  RuntimeError  exception \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								letting  the  user  know  that  their  data  could  not  be  joined . "  ) );  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-03 02:35:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-15 05:30:58 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * internal_makeParent ( Object  * parent ,  PyObject  * py_child ,  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
																	 int  partype , 	/* parenting type */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
																	 int  noninverse ,  int  fast , 	/* parenting arguments */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
																	 int  v1 ,  int  v2 ,  int  v3 	/* for vertex parent */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
																	 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Object  * child  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  Object_CheckPyObject (  py_child  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										child  =  (  Object  *  )  Object_FromPyObject (  py_child  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  child  = =  NULL  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" Object Type expected "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  test_parent_loop (  parent ,  child  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" parenting loop detected - parenting failed "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( partype  = =  PARSKEL  & &  child - > type  ! =  OB_MESH ) 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										child - > partype  =  PAROBJECT ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-07-15 05:30:58 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else 
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										child - > partype  =  ( short ) partype ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-15 05:30:58 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( partype  = =  PARVERT3 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										child - > par1  =  v1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										child - > par2  =  v2 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										child - > par3  =  v3 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if  ( partype  = =  PARVERT1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										child - > par1  =  v1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2005-07-15 05:30:58 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									child - > parent  =  parent ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//py_obj_child = (BPy_Object *) py_child;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  noninverse  = =  1  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-27 01:42:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Mat4One ( child - > parentinv ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-07-15 05:30:58 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										/* Parent inverse = unity */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										child - > loc [ 0 ]  =  0.0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										child - > loc [ 1 ]  =  0.0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										child - > loc [ 2 ]  =  0.0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										what_does_parent (  child  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Mat4Invert (  child - > parentinv ,  workob . obmat  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										clear_workob ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! fast  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										child - > recalc  | =  OB_RECALC_OB ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_materialUsage (  void  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  EXPP_ReturnPyObjError (  PyExc_NotImplementedError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" materialUsage: not yet implemented "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_setDeltaLocation (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									float  dloc1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  dloc2 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  dloc3 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  status ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  PyObject_Length (  args  )  = =  3  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										status  =  PyArg_ParseTuple (  args ,  " fff " ,  & dloc1 ,  & dloc2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													   & dloc3  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										status  =  PyArg_ParseTuple (  args ,  " (fff) " ,  & dloc1 ,  & dloc2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													   & dloc3  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! status  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " expected list argument of 3 floats "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									self - > object - > dloc [ 0 ]  =  dloc1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > dloc [ 1 ]  =  dloc2 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > dloc [ 2 ]  =  dloc3 ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-15 16:34:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* since we have messed with object, we need to flag for DAG recalc */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > recalc  | =  OB_RECALC_OB ;   
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_setDrawMode (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									char  dtx ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-02 20:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " b " ,  & dtx  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected an integer as argument "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-01-25 17:58:24 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									self - > object - > dtx  =  dtx ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-02 20:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-15 16:34:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* since we have messed with object, we need to flag for DAG recalc */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > recalc  | =  OB_RECALC_OB ;   
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_setDrawType (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  dt ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-02 20:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " b " ,  & dt  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected an integer as argument "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-01-25 17:58:24 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									self - > object - > dt  =  dt ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-02 20:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-15 16:34:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* since we have messed with object, we need to flag for DAG recalc */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > recalc  | =  OB_RECALC_OB ;   
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_setEuler (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									float  rot1  =  0.0f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  rot2  =  0.0f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  rot3  =  0.0f ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  status  =  0 ; 		/* failure */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * ob ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-05-12 08:06:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									   args  is  either  a  tuple / list  of  floats  or  an  euler . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									   for  backward  compatibility ,  we  also  accept  3  floats . 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-05-12 08:06:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* do we have 3 floats? */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  PyObject_Length (  args  )  = =  3  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										status  =  PyArg_ParseTuple (  args ,  " fff " ,  & rot1 ,  & rot2 ,  & rot3  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									}  else  { 		//test to see if it's a list or a euler
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  PyArg_ParseTuple (  args ,  " O " ,  & ob  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if (  EulerObject_Check (  ob  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												rot1  =  (  (  EulerObject  *  )  ob  ) - > eul [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												rot2  =  (  (  EulerObject  *  )  ob  ) - > eul [ 1 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												rot3  =  (  (  EulerObject  *  )  ob  ) - > eul [ 2 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												status  =  1 ; 	/* success! */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											}  else  if (  PySequence_Check (  ob  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												status  =  PyArg_ParseTuple (  args ,  " (fff) " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															   & rot1 ,  & rot2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															   & rot3  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											else  { 	/* not an euler or tuple */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-12 08:06:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												/* python C api doc says don't decref this */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												/*Py_DECREF (ob); */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												status  =  0 ; 	/* false */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-12 08:06:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										}  else  { 	/* arg parsing failed */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-12 08:06:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											status  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-03 00:45:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! status  ) 		/* parsing args failed */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected euler or list/tuple of 3 floats  "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									self - > object - > rot [ 0 ]  =  rot1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > rot [ 1 ]  =  rot2 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > rot [ 2 ]  =  rot3 ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-15 16:34:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* since we have messed with object, we need to flag for DAG recalc */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > recalc  | =  OB_RECALC_OB ;   
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-05-12 08:06:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_setMatrix (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2004-03-03 00:45:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									MatrixObject  * mat ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  x ,  y ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-03 00:45:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " O! " ,  & matrix_Type ,  & mat  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											(  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											  " expected matrix object as argument "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-03 00:45:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-02-16 20:09:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  mat - > rowSize  = =  4  & &  mat - > colSize  = =  4  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										for (  x  =  0 ;  x  <  4 ;  x + +  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											for (  y  =  0 ;  y  <  4 ;  y + +  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												self - > object - > obmat [ x ] [ y ]  =  mat - > matrix [ x ] [ y ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-03 00:45:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2006-02-16 20:09:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									}  else  if (  mat - > rowSize  = =  3  & &  mat - > colSize  = =  3  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										for (  x  =  0 ;  x  <  3 ;  x + +  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											for (  y  =  0 ;  y  <  3 ;  y + +  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												self - > object - > obmat [ x ] [ y ]  =  mat - > matrix [ x ] [ y ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										/* if a 3x3 matrix, clear the fourth row/column */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										for (  x  =  0 ;  x  <  3 ;  x + +  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											self - > object - > obmat [ x ] [ 3 ]  =  self - > object - > obmat [ 3 ] [ x ]  =  0.0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										self - > object - > obmat [ 3 ] [ 3 ]  =  1.0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									}  else  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError  (  PyExc_ValueError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											  " expected 3x3 or 4x4 matrix "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									apply_obmat (  self - > object  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-03 00:45:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-15 16:34:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* since we have messed with object, we need to flag for DAG recalc */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > recalc  | =  OB_RECALC_OB ;   
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-03 00:45:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-06-02 06:19:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_setIpo (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * pyipo  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Ipo  * ipo  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Ipo  * oldipo ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " O! " ,  & Ipo_Type ,  & pyipo  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " expected Ipo as argument "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									ipo  =  Ipo_FromPyObject (  pyipo  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! ipo  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " null ipo! "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ipo - > blocktype  ! =  ID_OB  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " this ipo is not an object ipo "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									oldipo  =  self - > object - > ipo ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  oldipo  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										ID  * id  =  & oldipo - > id ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  id - > us  >  0  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											id - > us - - ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									(  (  ID  *  )  &  ipo - > id  ) - > us + + ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > ipo  =  ipo ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-15 16:34:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* since we have messed with object, we need to flag for DAG recalc */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > recalc  | =  OB_RECALC_OB ;   
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  Py_None ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-03-19 23:47:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  Object_insertIpoKey ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *   inserts  Object  IPO  key  for  LOC ,  ROT ,  SIZE ,  LOCROT ,  or  LOCROTSIZE 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-10 18:05:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *   Note  it  also  inserts  actions !  
							 
						 
					
						
							
								
									
										
										
										
											2005-03-19 23:47:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_insertIpoKey (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2005-10-10 18:05:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Object  * ob =  self - > object ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-12-14 17:44:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  key  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-10 18:05:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									char  * actname =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-03-19 23:47:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " i " ,  & (  key  )  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
																		" expected int argument "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-10 18:05:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if ( ob - > ipoflag  &  OB_ACTION_OB ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										actname =  " Object " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2005-03-19 23:47:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( key  = =  IPOKEY_LOC  | |  key  = =  IPOKEY_LOCROT  | |  key  = =  IPOKEY_LOCROTSIZE ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-10 18:05:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										insertkey ( ( ID  * ) ob ,  ID_OB ,  actname ,  NULL , OB_LOC_X ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										insertkey ( ( ID  * ) ob ,  ID_OB ,  actname ,  NULL , OB_LOC_Y ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										insertkey ( ( ID  * ) ob ,  ID_OB ,  actname ,  NULL , OB_LOC_Z ) ;       
							 
						 
					
						
							
								
									
										
										
										
											2005-03-19 23:47:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  ( key  = =  IPOKEY_ROT  | |  key  = =  IPOKEY_LOCROT  | |  key  = =  IPOKEY_LOCROTSIZE ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-10 18:05:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										insertkey ( ( ID  * ) ob ,  ID_OB ,  actname ,  NULL , OB_ROT_X ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										insertkey ( ( ID  * ) ob ,  ID_OB ,  actname ,  NULL , OB_ROT_Y ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										insertkey ( ( ID  * ) ob ,  ID_OB ,  actname ,  NULL , OB_ROT_Z ) ;       
							 
						 
					
						
							
								
									
										
										
										
											2005-03-19 23:47:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  ( key  = =  IPOKEY_SIZE  | |  key  = =  IPOKEY_LOCROTSIZE  ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-10 18:05:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										insertkey ( ( ID  * ) ob ,  ID_OB ,  actname ,  NULL , OB_SIZE_X ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										insertkey ( ( ID  * ) ob ,  ID_OB ,  actname ,  NULL , OB_SIZE_Y ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										insertkey ( ( ID  * ) ob ,  ID_OB ,  actname ,  NULL , OB_SIZE_Z ) ;       
							 
						 
					
						
							
								
									
										
										
										
											2005-03-19 23:47:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  ( key  = =  IPOKEY_PI_STRENGTH  ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-10 18:05:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        insertkey ( ( ID  * ) ob ,  ID_OB ,  actname ,  NULL ,  OB_PD_FSTR ) ;    
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  ( key  = =  IPOKEY_PI_FALLOFF  ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-10 18:05:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        insertkey ( ( ID  * ) ob ,  ID_OB ,  actname ,  NULL ,  OB_PD_FFALL ) ;    
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  ( key  = =  IPOKEY_PI_SURFACEDAMP  ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-10 18:05:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        insertkey ( ( ID  * ) ob ,  ID_OB ,  actname ,  NULL ,  OB_PD_SDAMP ) ;    
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  ( key  = =  IPOKEY_PI_RANDOMDAMP  ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-10 18:05:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        insertkey ( ( ID  * ) ob ,  ID_OB ,  actname ,  NULL ,  OB_PD_RDAMP ) ;    
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  ( key  = =  IPOKEY_PI_PERM  ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-10 18:05:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        insertkey ( ( ID  * ) ob ,  ID_OB ,  actname ,  NULL ,  OB_PD_PERM ) ;    
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-03-19 23:47:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									allspace ( REMAKEIPO ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_allqueue ( REDRAWIPO ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_allqueue ( REDRAWVIEW3D ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_allqueue ( REDRAWACTION ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_allqueue ( REDRAWNLA ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-12-14 17:44:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  Object_insertPoseKey ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2005-12-18 20:14:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *   inserts  a  Action  Pose  key  from  a  given  pose  ( sourceaction ,  frame )  to  the  active  action  to  a  given  framenum 
							 
						 
					
						
							
								
									
										
										
										
											2005-12-14 17:44:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_insertPoseKey (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Object  * ob =  self - > object ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-12-18 20:14:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									BPy_Action  * sourceact ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-12-14 17:44:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									char  * chanName ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-12-18 20:14:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  actframe ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//for debug prints
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bActionChannel  * achan ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bPoseChannel  * pchan ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-12-14 17:44:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* for doing the time trick, similar to editaction bake_action_with_client() */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  oldframe ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  curframe ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-12-18 20:14:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " O!sii " ,  & Action_Type ,  & sourceact ,  & chanName ,  & actframe ,  & curframe  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 										" expects an action to copy poses from, a string for chan/bone name, an int argument for frame-to-extract from the action and finally another int for the frame where to put the new key in the active object.action "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									printf ( " %s %s %d %d,  " ,  sourceact - > action - > id . name ,  chanName ,  actframe ,  curframe ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									printf ( " %s \n " ,  ob - > action - > id . name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/*  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									extract_pose_from_action ( ob - > pose ,  sourceact - > action ,  actframe ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-12-14 17:44:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									oldframe  =  G . scene - > r . cfra ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									G . scene - > r . cfra  =  curframe ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-12-18 20:14:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//debug
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									pchan  =  get_pose_channel ( ob - > pose ,  chanName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									printquat ( pchan - > name ,  pchan - > quat ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-12-14 17:44:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-12-18 20:14:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									achan  =  get_action_channel ( sourceact - > action ,  chanName ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( achan - > ipo )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									  IpoCurve *  icu ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									  for  ( icu  =  achan - > ipo - > curve . first ;  icu ;  icu = icu - > next ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									    printvecf ( " bezt " ,  icu - > bezt - > vec [ 1 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2005-12-14 17:44:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_LOC_X ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_LOC_Y ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_LOC_Z ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_QUAT_X ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_QUAT_Y ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_QUAT_Z ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_QUAT_W ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_SIZE_X ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_SIZE_Y ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_SIZE_Z ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2005-12-18 20:14:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/*
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									for  ( achan  =  ob - > action - > chanbase . first ;  achan ;  achan = achan - > next )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									  if ( achan - > ipo )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									    IpoCurve *  icu ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									    for  ( icu  =  achan - > ipo - > curve . first ;  icu ;  icu = icu - > next ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									      printf ( " result: %f %f %f %f " ,  icu - > bp - > vec [ 0 ] ,  icu - > bp - > vec [ 1 ] ,  icu - > bp - > vec [ 2 ] ,  icu - > bp - > vec [ 3 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									G . scene - > r . cfra  =  oldframe ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									allspace ( REMAKEIPO ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_allqueue ( REDRAWIPO ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_allqueue ( REDRAWVIEW3D ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_allqueue ( REDRAWACTION ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_allqueue ( REDRAWNLA ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* restore, but now with the new action in place */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//extract_pose_from_action(ob->pose, ob->action, G.scene->r.cfra);
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//where_is_pose(ob);
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									allqueue ( REDRAWACTION ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_insertCurrentPoseKey (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  Object  * ob =  self - > object ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  //bPoseChannel *pchan; //for iterating over all channels in object->pose
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  char  * chanName ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  /* for doing the time trick, similar to editaction bake_action_with_client() */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  int  oldframe ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  int  curframe ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  if (  ! PyArg_ParseTuple (  args ,  " si " ,  & chanName ,  & curframe  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 										" expected chan/bone name, and a time (int) argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  oldframe  =  G . scene - > r . cfra ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  G . scene - > r . cfra  =  curframe ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_LOC_X ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_LOC_Y ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_LOC_Z ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_QUAT_X ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_QUAT_Y ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_QUAT_Z ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_QUAT_W ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_SIZE_X ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_SIZE_Y ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  insertkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_SIZE_Z ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  G . scene - > r . cfra  =  oldframe ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  allspace ( REMAKEIPO ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  EXPP_allqueue ( REDRAWIPO ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  EXPP_allqueue ( REDRAWVIEW3D ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  EXPP_allqueue ( REDRAWACTION ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  EXPP_allqueue ( REDRAWNLA ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  /* restore */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  extract_pose_from_action ( ob - > pose ,  ob - > action ,  G . scene - > r . cfra ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  where_is_pose ( ob ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  allqueue ( REDRAWACTION ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}    
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_insertMatrixKey (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Object  * ob =  self - > object ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * chanName ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* for doing the time trick, similar to editaction bake_action_with_client() */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  oldframe ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  curframe ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* for copying the current object/bone matrices to the new action */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  localQuat [ 4 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  tmat [ 4 ] [ 4 ] ,  startpos [ 4 ] [ 4 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//to get the matrix
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bArmature  * arm ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Bone       * bone ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									        
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " si " ,  & chanName ,   & curframe  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									  return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError ,  " expects a string for chan/bone name and an int for the frame where to put the new key "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									oldframe  =  G . scene - > r . cfra ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									G . scene - > r . cfra  =  curframe ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//just to get the armaturespace mat
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									arm  =  get_armature ( ob ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									for  ( bone  =  arm - > bonebase . first ;  bone ;  bone = bone - > next ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									  if  ( bone - > name  = =  chanName )  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									  //XXX does not check for if-not-found
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									where_is_object ( ob ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									world2bonespace ( tmat ,  ob - > obmat ,  bone - > arm_mat ,  startpos ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Mat4ToQuat ( tmat ,  localQuat ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									insertmatrixkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_LOC_X ,  tmat [ 3 ] [ 0 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									insertmatrixkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_LOC_Y ,  tmat [ 3 ] [ 1 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									insertmatrixkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_LOC_Z ,  tmat [ 3 ] [ 2 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									insertmatrixkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_QUAT_W ,  localQuat [ 0 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									insertmatrixkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_QUAT_X ,  localQuat [ 1 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									insertmatrixkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_QUAT_Y ,  localQuat [ 2 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									insertmatrixkey ( & ob - > id ,  ID_PO ,  chanName ,  NULL ,  AC_QUAT_Z ,  localQuat [ 3 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//insertmatrixkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_X, );
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//insertmatrixkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Y);
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//insertmatrixkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Z);
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2005-12-14 17:44:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									allspace ( REMAKEIPO ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_allqueue ( REDRAWIPO ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_allqueue ( REDRAWVIEW3D ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_allqueue ( REDRAWACTION ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_allqueue ( REDRAWNLA ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									G . scene - > r . cfra  =  oldframe ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-12-18 20:14:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* restore, but now with the new action in place */ 
							 
						 
					
						
							
								
									
										
										
										
											2005-12-14 17:44:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									extract_pose_from_action ( ob - > pose ,  ob - > action ,  G . scene - > r . cfra ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									where_is_pose ( ob ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									allqueue ( REDRAWACTION ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-12-18 20:14:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_bake_to_action (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* for doing the time trick, similar to editaction bake_action_with_client() */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//int oldframe;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//int curframe;
 
							 
						 
					
						
							
								
									
										
										
										
											2005-03-19 23:47:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-12-18 20:14:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									//if( !PyArg_ParseTuple( args, "i", &curframe ) )
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//  return ( EXPP_ReturnPyObjError( PyExc_AttributeError, "expects an int for the frame where to put the new key" ) );
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//oldframe = G.scene->r.cfra;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//G.scene->r.cfra = curframe;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bake_all_to_action ( ) ;  //ob);
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//G.scene->r.cfra = oldframe;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2005-03-19 23:47:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-02-01 22:21:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_setConstraintInfluenceForBone (  BPy_Object  *  self ,  PyObject  *  args  )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * boneName ,  * constName ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  influence ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									IpoCurve  * icu ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " ssf " ,  & boneName ,   & constName ,  & influence  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError ,  " expects: bonename, constraintname, influenceval "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									icu  =  verify_ipocurve ( ( ID  * ) self - > object ,  ID_CO ,  boneName ,  constName ,  CO_ENFORCE ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									insert_vert_ipo ( icu ,  CFRA ,  influence ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-02-08 16:58:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_copyNLA (  BPy_Object  *  self ,  PyObject  *  args  )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									BPy_Object  * bpy_fromob ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " O " ,  & bpy_fromob  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError ,  " requires a Blender Object to copy NLA strips from. "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									copy_nlastrips ( & self - > object - > nlastrips ,  & bpy_fromob - > object - > nlastrips ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_convertActionToStrip (  BPy_Object  *  self  )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//when BPY gets a Strip type, make this to return the created strip.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									convert_action_to_strip ( self - > object ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret_True  ( ) ;  //figured that True is closer to a Strip than None..
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_setLocation (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									float  loc1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  loc2 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  loc3 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  status ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  PyObject_Length (  args  )  = =  3  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										status  =  PyArg_ParseTuple (  args ,  " fff " ,  & loc1 ,  & loc2 ,  & loc3  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										status  =  PyArg_ParseTuple (  args ,  " (fff) " ,  & loc1 ,  & loc2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													   & loc3  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! status  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " expected list argument of 3 floats "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									self - > object - > loc [ 0 ]  =  loc1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > loc [ 1 ]  =  loc2 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > loc [ 2 ]  =  loc3 ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-09-27 20:56:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* since we have messed with object, we need to flag for DAG recalc */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > recalc  | =  OB_RECALC_OB ;   
							 
						 
					
						
							
								
									
										
										
										
											2006-03-03 17:45:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									DAG_object_flush_update ( G . scene ,  self - > object ,  OB_RECALC_DATA ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-09-27 20:56:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_setMaterials (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * list ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  len ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  i ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-10-11 19:05:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Material  * * matlist  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( ! self - > object - > data ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      " object must be linked to object data (e.g. to a mesh) first "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2781, reported by Ed Blake: crash on undo when there were active space handlers. Space Handler script links belong to screen areas, which do not get saved on undo. Thanks Ton for pointing out the function that restores ui pointers gone bad.
- Applied patch #2822 by Ken Hughes for bug #2647 ("Setting a Face UV"), reported by Campbell Barton.
- #3022, reported by Timothy Wakeham: "Blender.BGL.glDrawPixels crashes when drawing more pixels then buffer size". Made glDrawPixels check buffer dimensions.
- #2882, reported by Campbell: crash in nmesh.getMaterials(arg == 0 or 1) when nmesh came from GetRawFromMesh(). Raw nmeshes are not linked to Blender meshes, so the method doesn't support these options (getting mat info from the actual mesh) for it.
- #2817, reported by Tod Koeckeritz: Dir_Depth var was not being decremented in BPY_Menus.c, causing dir depth limits to be reached prematurely.
- #2954, reported by Daniel Holtz: "Python scripts crash hard with valid windows paths". Blender.Load() was not meant for background mode, now it's been update to support it, using BKE_read_file instead of BIF_read_file in this case. Also found another issue with command line scripts using Blender.Load() that could crash Blender: trying to free the Text when it wasn't available anymore (loading a new .blend already removed it). There are still issues with one case, though, causing a crash on start or "Memoryblock winopen: double free" at end, when running a script that is already a Blender Text (only if the script calls Blender.Load, of course). Will investigate.
- #2897: reported by Timothy Wakeham: object.setMaterials was asking the length of a Python list w/o confirming first if the passed obj was really a list.
Thanks all for the help and for being patient (long delay, again).
											 
										 
										
											2005-10-03 19:12:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " O! " ,  & PyList_Type ,  & list  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      " expected a list of materials (None's also accepted) as argument "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									len  =  PyList_Size ( list ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-10-11 19:05:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* Object_getMaterials can return '[]' (zero-length list), so that must
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  also  be  accepted  by  this  method  for 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  ob2 . setMaterials ( ob1 . getMaterials ( ) )  to  always  work . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  In  other  words ,  list  can  be  ' [ ] '  and  so  len  can  be  zero .  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( len  >  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  len  >  MAXMAT  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												" list must have from 1 up to 16 materials "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										matlist  =  EXPP_newMaterialList_fromPyList (  list  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  ! matlist  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												" material list must be a list of valid materials! "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2781, reported by Ed Blake: crash on undo when there were active space handlers. Space Handler script links belong to screen areas, which do not get saved on undo. Thanks Ton for pointing out the function that restores ui pointers gone bad.
- Applied patch #2822 by Ken Hughes for bug #2647 ("Setting a Face UV"), reported by Campbell Barton.
- #3022, reported by Timothy Wakeham: "Blender.BGL.glDrawPixels crashes when drawing more pixels then buffer size". Made glDrawPixels check buffer dimensions.
- #2882, reported by Campbell: crash in nmesh.getMaterials(arg == 0 or 1) when nmesh came from GetRawFromMesh(). Raw nmeshes are not linked to Blender meshes, so the method doesn't support these options (getting mat info from the actual mesh) for it.
- #2817, reported by Tod Koeckeritz: Dir_Depth var was not being decremented in BPY_Menus.c, causing dir depth limits to be reached prematurely.
- #2954, reported by Daniel Holtz: "Python scripts crash hard with valid windows paths". Blender.Load() was not meant for background mode, now it's been update to support it, using BKE_read_file instead of BIF_read_file in this case. Also found another issue with command line scripts using Blender.Load() that could crash Blender: trying to free the Text when it wasn't available anymore (loading a new .blend already removed it). There are still issues with one case, though, causing a crash on start or "Memoryblock winopen: double free" at end, when running a script that is already a Blender Text (only if the script calls Blender.Load, of course). Will investigate.
- #2897: reported by Timothy Wakeham: object.setMaterials was asking the length of a Python list w/o confirming first if the passed obj was really a list.
Thanks all for the help and for being patient (long delay, again).
											 
										 
										
											2005-10-03 19:12:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  self - > object - > mat  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										EXPP_releaseMaterialList (  self - > object - > mat ,  self - > object - > totcol  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2781, reported by Ed Blake: crash on undo when there were active space handlers. Space Handler script links belong to screen areas, which do not get saved on undo. Thanks Ton for pointing out the function that restores ui pointers gone bad.
- Applied patch #2822 by Ken Hughes for bug #2647 ("Setting a Face UV"), reported by Campbell Barton.
- #3022, reported by Timothy Wakeham: "Blender.BGL.glDrawPixels crashes when drawing more pixels then buffer size". Made glDrawPixels check buffer dimensions.
- #2882, reported by Campbell: crash in nmesh.getMaterials(arg == 0 or 1) when nmesh came from GetRawFromMesh(). Raw nmeshes are not linked to Blender meshes, so the method doesn't support these options (getting mat info from the actual mesh) for it.
- #2817, reported by Tod Koeckeritz: Dir_Depth var was not being decremented in BPY_Menus.c, causing dir depth limits to be reached prematurely.
- #2954, reported by Daniel Holtz: "Python scripts crash hard with valid windows paths". Blender.Load() was not meant for background mode, now it's been update to support it, using BKE_read_file instead of BIF_read_file in this case. Also found another issue with command line scripts using Blender.Load() that could crash Blender: trying to free the Text when it wasn't available anymore (loading a new .blend already removed it). There are still issues with one case, though, causing a crash on start or "Memoryblock winopen: double free" at end, when running a script that is already a Blender Text (only if the script calls Blender.Load, of course). Will investigate.
- #2897: reported by Timothy Wakeham: object.setMaterials was asking the length of a Python list w/o confirming first if the passed obj was really a list.
Thanks all for the help and for being patient (long delay, again).
											 
										 
										
											2005-10-03 19:12:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* Increase the user count on all materials */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									for (  i  =  0 ;  i  <  len ;  i + +  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  matlist [ i ]  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											id_us_plus (  (  ID  *  )  matlist [ i ]  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > mat  =  matlist ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > totcol  =  ( char ) len ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > actcol  =  ( char ) len ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2781, reported by Ed Blake: crash on undo when there were active space handlers. Space Handler script links belong to screen areas, which do not get saved on undo. Thanks Ton for pointing out the function that restores ui pointers gone bad.
- Applied patch #2822 by Ken Hughes for bug #2647 ("Setting a Face UV"), reported by Campbell Barton.
- #3022, reported by Timothy Wakeham: "Blender.BGL.glDrawPixels crashes when drawing more pixels then buffer size". Made glDrawPixels check buffer dimensions.
- #2882, reported by Campbell: crash in nmesh.getMaterials(arg == 0 or 1) when nmesh came from GetRawFromMesh(). Raw nmeshes are not linked to Blender meshes, so the method doesn't support these options (getting mat info from the actual mesh) for it.
- #2817, reported by Tod Koeckeritz: Dir_Depth var was not being decremented in BPY_Menus.c, causing dir depth limits to be reached prematurely.
- #2954, reported by Daniel Holtz: "Python scripts crash hard with valid windows paths". Blender.Load() was not meant for background mode, now it's been update to support it, using BKE_read_file instead of BIF_read_file in this case. Also found another issue with command line scripts using Blender.Load() that could crash Blender: trying to free the Text when it wasn't available anymore (loading a new .blend already removed it). There are still issues with one case, though, causing a crash on start or "Memoryblock winopen: double free" at end, when running a script that is already a Blender Text (only if the script calls Blender.Load, of course). Will investigate.
- #2897: reported by Timothy Wakeham: object.setMaterials was asking the length of a Python list w/o confirming first if the passed obj was really a list.
Thanks all for the help and for being patient (long delay, again).
											 
										 
										
											2005-10-03 19:12:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									switch  (  self - > object - > type  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										case  OB_CURVE : 	/* fall through */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  OB_FONT : 	/* fall through */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  OB_MESH : 	/* fall through */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  OB_MBALL : 	/* fall through */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  OB_SURF : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											EXPP_synchronizeMaterialLists (  self - > object  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											break ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-15 16:34:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* since we have messed with object, we need to flag for DAG recalc */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > recalc  | =  OB_RECALC_OB ;   
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_setName (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-06-28 15:10:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									char  * name ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  buf [ 21 ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-28 15:10:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " s " ,  & name  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected a String as argument "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-28 15:10:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyOS_snprintf (  buf ,  sizeof (  buf  ) ,  " %s " ,  name  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-28 15:10:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									rename_id (  & self - > object - > id ,  buf  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-28 15:10:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-01-23 02:59:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_setSize (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2004-01-23 02:59:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									float  sizex ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  sizey ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  sizez ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  status ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-01-23 02:59:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  PyObject_Length (  args  )  = =  3  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										status  =  PyArg_ParseTuple (  args ,  " fff " ,  & sizex ,  & sizey , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													   & sizez  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-01-23 02:59:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										status  =  PyArg_ParseTuple (  args ,  " (fff) " ,  & sizex ,  & sizey , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													   & sizez  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-01-23 02:59:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! status  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " expected list argument of 3 floats "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-01-23 02:59:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > size [ 0 ]  =  sizex ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > size [ 1 ]  =  sizey ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > size [ 2 ]  =  sizez ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-15 16:34:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* since we have messed with object, we need to flag for DAG recalc */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > recalc  | =  OB_RECALC_OB ;   
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-04-02 18:38:38 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_setTimeOffset (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2004-04-02 18:38:38 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  newTimeOffset ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " f " ,  & newTimeOffset  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected a float as argument "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-04-02 18:38:38 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									self - > object - > sf  =  newTimeOffset ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-04-02 18:38:38 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-28 15:10:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_makeTrack (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									BPy_Object  * tracked  =  NULL ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Object  * ob  =  self - > object ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  fast  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " O!|i " ,  & Object_Type ,  & tracked ,  & fast  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " expected an object and optionally also an int as arguments. "  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ob - > track  =  tracked - > object ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! fast  ) 
							 
						 
					
						
							
								
									
										
											 
										
											
												Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
  centralized. Calls to where_is_object and makeDispList are
  forbidden, instead we tag objects 'changed' and let the
  depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
  constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
  flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
   That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
  and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
  for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
  the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
  on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
  (wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
  (But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
  position anymore. That system looks nice (no flips) but is not well
  suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
  IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
											 
										 
										
											2005-07-03 17:35:38 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										DAG_scene_sort (  G . scene  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_shareFrom (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									BPy_Object  * object ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ID  * id ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ID  * oldid ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " O " ,  & object  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " expected an object argument "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! Object_CheckPyObject (  (  PyObject  *  )  object  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " first argument is not of type 'Object' "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  self - > object - > type  ! =  object - > object - > type  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " objects are not of same data type "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									switch  (  self - > object - > type  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_MESH : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_LAMP : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_CAMERA : 	/* we can probably add the other types, too */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_ARMATURE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_CURVE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_SURF : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  OB_LATTICE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										oldid  =  (  ID  *  )  self - > object - > data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id  =  (  ID  *  )  object - > object - > data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										self - > object - > data  =  object - > object - > data ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-20 08:16:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  self - > object - > type  = =  OB_MESH  & &  id  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											self - > object - > totcol  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											EXPP_synchronizeMaterialLists (  self - > object  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										id_us_plus (  id  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  oldid  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if (  oldid - > us  >  0  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												oldid - > us - - ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												return  (  EXPP_ReturnPyObjError 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													 (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													   " old object reference count below 0 "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " type not supported "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-06-02 06:19:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_Select (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2004-06-02 06:19:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Base  * base ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  sel ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									base  =  FIRSTBASE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " i " ,  & sel  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											(  PyExc_TypeError ,  " expected an integer, 0 or 1 "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									while (  base  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  base - > object  = =  self - > object  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if (  sel  = =  1  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-02 06:19:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												base - > flag  | =  SELECT ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												self - > object - > flag  =  ( short ) base - > flag ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-04 07:52:06 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												set_active_base (  base  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-02 06:19:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												base - > flag  & =  ~ SELECT ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												self - > object - > flag  =  ( short ) base - > flag ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-02 06:19:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										base  =  base - > next ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-02 06:19:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									countall (   ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-02 06:19:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getAllProperties (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * prop_list ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bProperty  * prop  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									prop_list  =  PyList_New (  0  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									prop  =  self - > object - > prop . first ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									while (  prop  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PyList_Append (  prop_list ,  Property_CreatePyObject (  prop  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										prop  =  prop - > next ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  prop_list ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getProperty (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * prop_name  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									bProperty  * prop  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * py_prop  =  Py_None ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " s " ,  & prop_name  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected a string "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									prop  =  get_property (  self - > object ,  prop_name  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  prop  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										py_prop  =  Property_CreatePyObject (  prop  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" couldn't find the property.... "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  py_prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_addProperty (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bProperty  * prop  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * prop_name  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * prop_data  =  Py_None ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * prop_type  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									short  type  =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									BPy_Property  * py_prop  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-12-05 04:01:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  argslen  =  PyObject_Length (  args  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-12-05 04:01:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  argslen  = =  3  | |  argslen  = =  2  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  ! PyArg_ParseTuple 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										    (  args ,  " sO|s " ,  & prop_name ,  & prop_data ,  & prop_type  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												 (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												   " unable to get string, data, and optional string "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2004-12-05 04:01:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									}  else  if (  argslen  = =  1  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  ! PyArg_ParseTuple (  args ,  " O! " ,  & property_Type ,  & py_prop  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															" unable to get Property "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  py_prop - > property  ! =  NULL  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															" Property is already added to an object "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected 1,2 or 3 arguments "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//parse property type
 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! py_prop  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  prop_type  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if (  BLI_streq (  prop_type ,  " BOOL "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												type  =  PROP_BOOL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											else  if (  BLI_streq (  prop_type ,  " INT "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												type  =  PROP_INT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											else  if (  BLI_streq (  prop_type ,  " FLOAT "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												type  =  PROP_FLOAT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											else  if (  BLI_streq (  prop_type ,  " TIME "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												type  =  PROP_TIME ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											else  if (  BLI_streq (  prop_type ,  " STRING "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												type  =  PROP_STRING ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												return  (  EXPP_ReturnPyObjError 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													 (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													   " BOOL, INT, FLOAT, TIME or STRING expected "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											//use the default
 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											if (  PyInt_Check (  prop_data  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												type  =  PROP_INT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											else  if (  PyFloat_Check (  prop_data  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												type  =  PROP_FLOAT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											else  if (  PyString_Check (  prop_data  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												type  =  PROP_STRING ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										type  =  py_prop - > type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//initialize a new bProperty of the specified type
 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									prop  =  new_property (  type  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//parse data
 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! py_prop  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										BLI_strncpy (  prop - > name ,  prop_name ,  32  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  PyInt_Check (  prop_data  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											* (  (  int  *  )  & prop - > data  )  = 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												(  int  )  PyInt_AsLong (  prop_data  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  else  if (  PyFloat_Check (  prop_data  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											* (  (  float  *  )  & prop - > data  )  = 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												(  float  )  PyFloat_AsDouble (  prop_data  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  else  if (  PyString_Check (  prop_data  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											BLI_strncpy (  prop - > poin , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												     PyString_AsString (  prop_data  ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												     MAX_PROPSTRING  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										py_prop - > property  =  prop ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  ! updateProperyData (  py_prop  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															" Could not update property data - error "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//add to property listbase for the object
 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									BLI_addtail (  & self - > object - > prop ,  prop  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_removeProperty (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * prop_name  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									BPy_Property  * py_prop  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bProperty  * prop  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									// we have property and no optional arg
 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " O! " ,  & property_Type ,  & py_prop  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  ! PyArg_ParseTuple (  args ,  " s " ,  & prop_name  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															" expected a Property or a string "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//remove the link, free the data, and update the py struct
 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  py_prop  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										BLI_remlink (  & self - > object - > prop ,  py_prop - > property  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  updatePyProperty (  py_prop  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											free_property (  py_prop - > property  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											py_prop - > property  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										prop  =  get_property (  self - > object ,  prop_name  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  prop  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											BLI_remlink (  & self - > object - > prop ,  prop  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											free_property (  prop  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_removeAllProperties (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									free_properties (  & self - > object - > prop  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_copyAllPropertiesTo (  BPy_Object  *  self ,  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													     PyObject  *  args  ) 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * dest  =  Py_None ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bProperty  * prop  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									bProperty  * propn  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " O! " ,  & Object_Type ,  & dest  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected an Object "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									//make a copy of all it's properties
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									prop  =  self - > object - > prop . first ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									while (  prop  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										propn  =  copy_property (  prop  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										BLI_addtail (  & (  (  BPy_Object  *  )  dest  ) - > object - > prop ,  propn  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										prop  =  prop - > next ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-11 13:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2004-06-02 06:19:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* obj.addScriptLink */  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_addScriptLink (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Object  * obj  =  self - > object ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ScriptLink  * slink  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									slink  =  & (  obj  ) - > scriptlink ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-04-21 19:44:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  EXPP_addScriptLink (  slink ,  args ,  0  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* obj.clearScriptLinks */  
						 
					
						
							
								
									
										
										
										
											2005-04-21 19:44:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_clearScriptLinks (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Object  * obj  =  self - > object ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ScriptLink  * slink  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									slink  =  & (  obj  ) - > scriptlink ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-04-21 19:44:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  EXPP_clearScriptLinks (  slink ,  args  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* obj.getScriptLinks */  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getScriptLinks (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Object  * obj  =  self - > object ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ScriptLink  * slink  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * ret  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									slink  =  & (  obj  ) - > scriptlink ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									ret  =  EXPP_getScriptLinks (  slink ,  args ,  0  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ret  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  ret ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  NULL ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-03-12 11:38:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getDupliVerts  (  BPy_Object  *  self  )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( self - > object - > transflag  &  OB_DUPLIVERTS ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_incr_ret_True  ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_incr_ret_False ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2005-03-06 14:55:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-03-12 11:38:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_setDupliVerts  (  BPy_Object  *  self ,  PyObject  *  args  )  {  
						 
					
						
							
								
									
										
										
										
											2005-03-19 21:28:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  setting =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-03-12 11:38:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " i " ,  & setting  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
									
										
										
										
											2006-02-27 04:05:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														" expected a int, 0/1 for True/False " )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-03-12 11:38:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( self  & &  self - > object )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( setting ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											self - > object - > transflag  | =  OB_DUPLIVERTS ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										else  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											self - > object - > transflag  & =  ~ OB_DUPLIVERTS ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-03-06 14:55:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  Py_None ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-02-27 04:05:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getDupliFrames  (  BPy_Object  *  self  )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( self - > object - > transflag  &  OB_DUPLIFRAMES ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_incr_ret_True  ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_incr_ret_False ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setDupliFrames  (  BPy_Object  *  self ,  PyObject  *  args  )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  setting =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " i " ,  & setting  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected a int, 0/1 for True/False " )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( self  & &  self - > object )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( setting ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											self - > object - > transflag  | =  OB_DUPLIFRAMES ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										else  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											self - > object - > transflag  & =  ~ OB_DUPLIFRAMES ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  Py_None ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getDupliGroup  (  BPy_Object  *  self  )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( self - > object - > transflag  &  OB_DUPLIGROUP ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_incr_ret_True  ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_incr_ret_False ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setDupliGroup  (  BPy_Object  *  self ,  PyObject  *  args  )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  setting =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " i " ,  & setting  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected a int, 0/1 for True/False " )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( self  & &  self - > object )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( setting ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											self - > object - > transflag  | =  OB_DUPLIGROUP ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										else  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											self - > object - > transflag  & =  ~ OB_DUPLIGROUP ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  Py_None ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getDupliRot  (  BPy_Object  *  self  )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( self - > object - > transflag  &  OB_DUPLIROT ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_incr_ret_True  ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_incr_ret_False ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setDupliRot  (  BPy_Object  *  self ,  PyObject  *  args  )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  setting =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " i " ,  & setting  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected a int, 0/1 for True/False " )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( self  & &  self - > object )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( setting ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											self - > object - > transflag  | =  OB_DUPLIROT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										else  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											self - > object - > transflag  & =  ~ OB_DUPLIROT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  Py_None ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getDupliNoSpeed  (  BPy_Object  *  self  )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( self - > object - > transflag  &  OB_DUPLINOSPEED ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_incr_ret_True  ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_incr_ret_False ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_setDupliNoSpeed  (  BPy_Object  *  self ,  PyObject  *  args  )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  setting =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " i " ,  & setting  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" expected a int, 0/1 for True/False " )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( self  & &  self - > object )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( setting ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											self - > object - > transflag  | =  OB_DUPLINOSPEED ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										else  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											self - > object - > transflag  & =  ~ OB_DUPLINOSPEED ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  Py_None ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Object_getDupliObjects  (  BPy_Object  *  self   )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * dupli_objects_list =  PyList_New (  0  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Object  * ob =  self - > object ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Scene  * sce =  G . scene ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									DupliObject  * dob ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ListBase  * lb ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  index = 0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( ob - > transflag  &  OB_DUPLI )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										/* before make duplis, update particle for current frame */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if ( ob - > transflag  &  OB_DUPLIVERTS )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											PartEff  * paf =  give_parteff ( ob ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if ( paf )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												if ( paf - > flag  &  PAF_ANIMATED )  build_particle_system ( ob ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if ( ob - > type ! = OB_MBALL )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											lb =  object_duplilist ( sce ,  ob ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-03-02 01:00:13 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											dupli_objects_list =  PyList_New (  BLI_countlist ( lb ) - 1  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-02-27 04:05:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											if (  ! dupli_objects_list  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														" PyList_New() failed "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											dob  =  lb - > first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											while ( dob )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												PyList_SetItem (  dupli_objects_list ,  index , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												  Py_BuildValue (  " (OO) " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												  Object_CreatePyObject ( dob - > ob ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												  newMatrixObject ( ( float * ) dob - > mat , 4 , 4 , Py_NEW )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												index + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												dob =  dob - > next ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											free_object_duplilist ( lb ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  dupli_objects_list ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-06 22:29:49 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getEffects (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * effect_list ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Effect  * eff ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									effect_list  =  PyList_New (  0  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! effect_list  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												" PyList_New() failed "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									eff  =  self - > object - > effect . first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									while (  eff  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										PyList_Append (  effect_list ,  EffectCreatePyObject (  eff ,  self - > object  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-06 22:29:49 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										eff  =  eff - > next ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  effect_list ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-01-17 06:47:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static   PyObject  * Object_insertShapeKey ( BPy_Object  *  self )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									insert_shapekey ( self - > object ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  Py_None ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Function:	Object_CreatePyObject					 */  
						 
					
						
							
								
									
										
										
										
											2003-03-15 19:14:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Description: This function will create a new BlenObject from an existing  */  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*		Object structure.					 */  
						 
					
						
							
								
									
										
										
										
											2003-03-15 19:14:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								PyObject  * Object_CreatePyObject (  struct  Object  *  obj  )  
						 
					
						
							
								
									
										
										
										
											2003-03-15 19:14:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									BPy_Object  * blen_object ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-03-15 19:14:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! obj  ) 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-18 16:03:03 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-07-21 03:19:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									blen_object  = 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										(  BPy_Object  *  )  PyObject_NEW (  BPy_Object ,  & Object_Type  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-03-15 19:14:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-18 16:03:03 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  blen_object  = =  NULL  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  NULL  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-18 16:03:03 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									blen_object - > object  =  obj ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									obj - > id . us + + ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  (  PyObject  *  )  blen_object  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-03-15 19:14:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Function:	Object_CheckPyObject					 */  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Description: This function returns true when the given PyObject is of the */  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*		type Object. Otherwise it will return false.		 */  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								int  Object_CheckPyObject (  PyObject  *  py_obj  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  py_obj - > ob_type  = =  & Object_Type  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Function:	Object_FromPyObject					 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Description: This function returns the Blender object from the given	 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*		PyObject.						 */  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								struct  Object  * Object_FromPyObject (  PyObject  *  py_obj  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									BPy_Object  * blen_obj ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									blen_obj  =  (  BPy_Object  *  )  py_obj ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  blen_obj - > object  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-07-27 15:56:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Description: Returns the object with the name specified by the argument  */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*		name. Note that the calling function has to remove the first */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*		two characters of the object name. These two characters	   */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*		specify the type of the object (OB, ME, WO, ...)	 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*		The function will return NULL when no object with the given  */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*		name is found.						 */  
						 
					
						
							
								
									
										
										
										
											2003-07-27 15:56:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Object  * GetObjectByName (  char  * name  )  
						 
					
						
							
								
									
										
										
										
											2003-07-27 15:56:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Object  * obj_iter ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									obj_iter  =  G . main - > object . first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									while (  obj_iter  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  StringEqual (  name ,  GetIdName (  & (  obj_iter - > id  )  )  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  obj_iter  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										obj_iter  =  obj_iter - > id . next ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* There is no object with the given name */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  NULL  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-07-27 15:56:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-03-15 19:14:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Function:	Object_dealloc						 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Description: This is a callback function for the BlenObject type. It is  */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*		the destructor function.				 */  
						 
					
						
							
								
									
										
										
										
											2003-03-15 19:14:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  void  Object_dealloc (  BPy_Object  *  obj  )  
						 
					
						
							
								
									
										
										
										
											2003-03-15 19:14:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2005-11-07 20:03:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									obj - > object - > id . us - - ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject_DEL (  obj  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-03-15 19:14:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Function:	Object_getAttr						 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Description: This is a callback function for the BlenObject type. It is  */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*		the function that retrieves any value from Blender and	 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*		passes it to Python.					 */  
						 
					
						
							
								
									
										
										
										
											2003-03-15 19:14:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_getAttr (  BPy_Object  *  obj ,  char  * name  )  
						 
					
						
							
								
									
										
										
										
											2003-03-15 19:14:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2005-11-06 22:29:49 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Object  * object ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									object  =  obj - > object ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " LocX "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  PyFloat_FromDouble (  object - > loc [ 0 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " LocY "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  PyFloat_FromDouble (  object - > loc [ 1 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " LocZ "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  PyFloat_FromDouble (  object - > loc [ 2 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " loc "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue (  " fff " ,  object - > loc [ 0 ] ,  object - > loc [ 1 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													object - > loc [ 2 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dLocX "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  PyFloat_FromDouble (  object - > dloc [ 0 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dLocY "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  PyFloat_FromDouble (  object - > dloc [ 1 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dLocZ "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  PyFloat_FromDouble (  object - > dloc [ 2 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dloc "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											 (  " fff " ,  object - > dloc [ 0 ] ,  object - > dloc [ 1 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											   object - > dloc [ 2 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " RotX "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  PyFloat_FromDouble (  object - > rot [ 0 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " RotY "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  PyFloat_FromDouble (  object - > rot [ 1 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " RotZ "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  PyFloat_FromDouble (  object - > rot [ 2 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " rot "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue (  " fff " ,  object - > rot [ 0 ] ,  object - > rot [ 1 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													object - > rot [ 2 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dRotX "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  PyFloat_FromDouble (  object - > drot [ 0 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dRotY "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  PyFloat_FromDouble (  object - > drot [ 1 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dRotZ "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  PyFloat_FromDouble (  object - > drot [ 2 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " drot "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											 (  " fff " ,  object - > drot [ 0 ] ,  object - > drot [ 1 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											   object - > drot [ 2 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " SizeX "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  PyFloat_FromDouble (  object - > size [ 0 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " SizeY "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  PyFloat_FromDouble (  object - > size [ 1 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " SizeZ "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  PyFloat_FromDouble (  object - > size [ 2 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " size "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											 (  " fff " ,  object - > size [ 0 ] ,  object - > size [ 1 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											   object - > size [ 2 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dSizeX "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  PyFloat_FromDouble (  object - > dsize [ 0 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dSizeY "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  PyFloat_FromDouble (  object - > dsize [ 1 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dSizeZ "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  PyFloat_FromDouble (  object - > dsize [ 2 ]  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dsize "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											 (  " fff " ,  object - > dsize [ 0 ] ,  object - > dsize [ 1 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											   object - > dsize [ 2 ]  )  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
  centralized. Calls to where_is_object and makeDispList are
  forbidden, instead we tag objects 'changed' and let the
  depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
  constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
  flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
   That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
  and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
  for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
  the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
  on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
  (wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
  (But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
  position anymore. That system looks nice (no flips) but is not well
  suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
  IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
											 
										 
										
											2005-07-03 17:35:38 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-04-21 19:44:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* accept both Layer (old, for compatibility) and Layers */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  strncmp (  name ,  " Layer " ,  5  )  = =  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  (  PyInt_FromLong (  object - > lay  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-21 19:44:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* Layers returns a bitmask, layers returns a list of integers */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " layers "  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										int  layers ,  bit  =  0 ,  val  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PyObject  * item  =  NULL ,  * laylist  =  PyList_New (  0  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  ! laylist  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError (  PyExc_MemoryError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												" couldn't create pylist! "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										layers  =  object - > lay ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										while (  bit  <  20  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											val  =  1  < <  bit ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if (  layers  &  val  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												item  =  Py_BuildValue (  " i " ,  bit  +  1  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												PyList_Append (  laylist ,  item  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Py_DECREF (  item  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											bit + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  laylist ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " parent "  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  object - > parent  ) 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											return  Object_CreatePyObject (  object - > parent  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-28 05:21:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										else  { 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Py_RETURN_NONE ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-28 05:21:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 18:11:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " parentbonename "  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  object - > parent  & &  object - > parsubstr [ 0 ]  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  Py_BuildValue ( " s " ,  object - > parsubstr )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " track "  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  Object_CreatePyObject (  object - > track  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-02 03:38:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " data "  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PyObject  * getdata ,  * tuple  =  PyTuple_New ( 0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( ! tuple ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  EXPP_ReturnPyObjError  ( PyExc_MemoryError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												" couldn't create an empty tuple! " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										getdata  =  Object_getData (  obj ,  tuple ,  NULL  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_DECREF ( tuple ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  getdata ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " ipo "  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  object - > ipo  = =  NULL  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											/* There's no ipo linked to the object, return Py_None. */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-24 17:08:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  (  Ipo_CreatePyObject (  object - > ipo  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " mat "  )  | |  StringEqual (  name ,  " matrix "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Object_getMatrix 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython:
- Blender.Window: added function GetPerspMatrix() (Tom Musgrave's patch, thanks);
- added Chris Want's patch to tell argc, argv to the Python interpreter (thanks, Hos);
- Blender.Image: added image.glFree() to free textures bound by the recently added
  image.glLoad() (both suggested by Campbell Barton -- thanks, with these Blender can
  be used to load textures for scripts);
- Blender.Sound: removed for now at least a few get/set methods of vars that can't be
  accessed via interface;
- renamed Get/makeActive to Get/setCurrent in Blender.World (actually added alias for
  now), same in Blender.Sound: renamed makeActive to setCurrent.  Stephen Swaney
  pointed this some weeks ago, we should stick to one naming convention.
- added documentation for Sound and Window.Theme modules and the other added
  functions, made other small updates.
- Blender.Object: made 'worldspace' become the default output of .getMatrix and .mat/.matrix:
  after reading a discussion on blender.org's Python forum where eeshlo mentioned the
  pre 2.34 default was worldspace, I took a better look at Blender's relevant code,
  confirmed, talked to Theeth about this and as he suggested am changing the default
  back to 'worldspace'.
											 
										 
										
											2004-10-20 05:51:24 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											 (  obj ,  Py_BuildValue (  " (s) " ,  " worldspace "  )  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " matrixWorld "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Object_getMatrix 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											 (  obj ,  Py_BuildValue (  " (s) " ,  " worldspace "  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " matrixLocal "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Object_getMatrix 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											 (  obj ,  Py_BuildValue (  " (s) " ,  " localspace "  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " colbits "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue (  " h " ,  object - > colbits  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " drawType "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue (  " b " ,  object - > dt  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " drawMode "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue (  " b " ,  object - > dtx  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " name "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Py_BuildValue (  " s " ,  object - > id . name  +  2  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " sel "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  Object_isSelected (  obj  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-06-17 05:10:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " DupSta "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  PyInt_FromLong (  obj - > object - > dupsta  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " DupEnd "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  PyInt_FromLong (  obj - > object - > dupend  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " DupOn "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  PyInt_FromLong (  obj - > object - > dupon  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " DupOff "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  PyInt_FromLong (  obj - > object - > dupoff  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-09 15:53:35 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( StringEqual  ( name ,  " oopsLoc " ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( G . soops )  { 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-06 22:29:49 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Oops  * oops =  G . soops - > oops . first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											while ( oops )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												if (  oops - > type = = ID_OB  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													if ( ( Object  * ) oops - > id  = =  object )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														return  ( Py_BuildValue  ( " ff " ,  oops - > x ,  oops - > y ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												oops =  oops - > next ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-09 15:53:35 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-06 22:29:49 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " effects "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  Object_getEffects (  obj  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-17 18:35:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " users "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  PyInt_FromLong (  obj - > object - > id . us  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-18 19:44:44 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " protectFlags "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  PyInt_FromLong (  obj - > object - > protectflag  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-03-18 17:24:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dupliGroup "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  Group_CreatePyObject (  obj - > object - > dup_group  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* not an attribute, search the methods table */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  Py_FindMethod (  BPy_Object_methods ,  (  PyObject  *  )  obj ,  name  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-03-15 19:14:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Function:	Object_setAttr						 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Description: This is a callback function for the BlenObject type. It is  */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*		the function that retrieves any value from Python and sets  */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*		it accordingly in Blender.				 */  
						 
					
						
							
								
									
										
										
										
											2003-03-15 19:14:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  int  Object_setAttr (  BPy_Object  *  obj ,  char  * name ,  PyObject  *  value  )  
						 
					
						
							
								
									
										
										
										
											2003-03-15 19:14:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2005-06-17 05:10:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * valtuple ,  * result = NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									struct  Object  * object ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-10-29 01:37:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									object  =  obj - > object ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-06-17 05:10:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* Handle all properties which are Read Only */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " parent "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnIntError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												       " Setting the parent is not allowed. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " data "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnIntError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												       " Setting the data is not allowed. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " ipo "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnIntError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												       " Setting the ipo is not allowed. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " mat "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnIntError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												       " Not allowed. Please use .setMatrix(matrix) "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " matrix "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnIntError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												       " Not allowed. Please use .setMatrix(matrix) "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-15 16:34:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* FIRST, do attributes that are directly changed */ 
							 
						 
					
						
							
								
									
										
										
										
											2005-09-27 20:56:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									   All  the  methods  below  modify  the  object  so  we  set  the  recalc 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									   flag  here . 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-15 16:34:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   When  we  move  to  tp_getset ,  the  individual  setters  will  need 
							 
						 
					
						
							
								
									
										
										
										
											2005-09-27 20:56:39 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   to  set  the  flag . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									object - > recalc  | =  OB_RECALC_OB ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " LocX "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " f " ,  & (  object - > loc [ 0 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " LocY "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " f " ,  & (  object - > loc [ 1 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " LocZ "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " f " ,  & (  object - > loc [ 2 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dLocX "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " f " ,  & (  object - > dloc [ 0 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dLocY "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " f " ,  & (  object - > dloc [ 1 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dLocZ "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " f " ,  & (  object - > dloc [ 2 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " RotX "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " f " ,  & (  object - > rot [ 0 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " RotY "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " f " ,  & (  object - > rot [ 1 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " RotZ "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " f " ,  & (  object - > rot [ 2 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dRotX "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " f " ,  & (  object - > drot [ 0 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dRotY "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " f " ,  & (  object - > drot [ 1 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dRotZ "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " f " ,  & (  object - > drot [ 2 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " drot "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_ParseTuple (  value ,  " fff " ,  & (  object - > drot [ 0 ]  ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													    & (  object - > drot [ 1 ]  ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													    & (  object - > drot [ 2 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " SizeX "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " f " ,  & (  object - > size [ 0 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " SizeY "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " f " ,  & (  object - > size [ 1 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " SizeZ "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " f " ,  & (  object - > size [ 2 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " size "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_ParseTuple (  value ,  " fff " ,  & (  object - > size [ 0 ]  ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													    & (  object - > size [ 1 ]  ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													    & (  object - > size [ 2 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dSizeX "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " f " ,  & (  object - > dsize [ 0 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dSizeY "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " f " ,  & (  object - > dsize [ 1 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dSizeZ "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " f " ,  & (  object - > dsize [ 2 ]  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dsize "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_ParseTuple 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											 (  value ,  " fff " ,  & (  object - > dsize [ 0 ]  ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											   & (  object - > dsize [ 1 ]  ) ,  & (  object - > dsize [ 2 ]  )  )  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
  centralized. Calls to where_is_object and makeDispList are
  forbidden, instead we tag objects 'changed' and let the
  depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
  constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
  flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
   That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
  and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
  for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
  the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
  on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
  (wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
  (But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
  position anymore. That system looks nice (no flips) but is not well
  suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
  IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
											 
										 
										
											2005-07-03 17:35:38 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2005-06-17 05:10:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " DupSta "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " h " ,  & (  object - > dupsta  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " DupEnd "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " h " ,  & (  object - > dupend  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " DupOn "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " h " ,  & (  object - > dupon  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " DupOff "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " h " ,  & (  object - > dupoff  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " colbits "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  ! PyArg_Parse (  value ,  " h " ,  & (  object - > colbits  )  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-04-21 19:44:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* accept both Layer (for compatibility) and Layers */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  strncmp (  name ,  " Layer " ,  5  )  = =  0  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										/*  usage note: caller of this func needs to do a 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										   Blender . Redraw ( - 1 )  to  update  and  redraw  the  interface  */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-20 06:26:43 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Base  * base ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										int  newLayer ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										int  local ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-10-11 20:33:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  !  PyArg_Parse (  value ,  " i " ,  & newLayer  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  EXPP_ReturnIntError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														    " expected int as bitmask "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										/* uppper 2 nibbles are for local view */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										newLayer  & =  0x00FFFFFF ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-06-17 05:10:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  newLayer  = =  0  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-21 19:44:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											return  EXPP_ReturnIntError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												" bitmask must have from 1 up to 20 bits set " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-06-17 05:10:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-21 19:44:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-10-11 20:33:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										/* update any bases pointing to our object */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										base  =  FIRSTBASE ;   /* first base in current scene */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										while (  base  ) { 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											if (  base - > object  = =  obj - > object  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-20 06:26:43 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												local  =  base - > lay  & =  0xFF000000 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												base - > lay  =  local  |  newLayer ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												object - > lay  =  base - > lay ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2004-10-11 20:33:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											base  =  base - > next ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-20 06:26:43 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2004-10-11 20:33:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										countall (   ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  (  0  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-20 06:26:43 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-21 19:44:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " layers "  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										/*  usage note: caller of this func needs to do a 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										   Blender . Redraw ( - 1 )  to  update  and  redraw  the  interface  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Base  * base ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										int  layers  =  0 ,  len_list  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										int  local ,  i ,  val ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PyObject  * list  =  NULL ,  * item  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  ! PyArg_Parse (  value ,  " O! " ,  & PyList_Type ,  & list  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  EXPP_ReturnIntError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											  " expected a list of integers "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										len_list  =  PyList_Size ( list ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( len_list  = =  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  EXPP_ReturnIntError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											  " list can't be empty, at least one layer must be set "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										for (  i  =  0 ;  i  <  len_list ;  i + +  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											item  =  PyList_GetItem (  list ,  i  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if (  ! PyInt_Check (  item  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												return  EXPP_ReturnIntError 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													(  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													  " list must contain only integer numbers "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											val  =  (  int  )  PyInt_AsLong (  item  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if (  val  <  1  | |  val  >  20  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												return  EXPP_ReturnIntError 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													(  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													  " layer values must be in the range [1, 20] "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											layers  | =  1  < <  (  val  -  1  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										/* update any bases pointing to our object */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										base  =  FIRSTBASE ;   /* first base in current scene */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										while (  base  ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if (  base - > object  = =  obj - > object  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												local  =  base - > lay  & =  0xFF000000 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												base - > lay  =  local  |  layers ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												object - > lay  =  base - > lay ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											base  =  base - > next ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										countall ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  0  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-09 15:53:35 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( StringEqual  ( name ,  " oopsLoc " ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( G . soops )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											Oops  * oops =  G . soops - > oops . first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											while ( oops )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												if ( oops - > type = = ID_OB )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													if  ( ( Object  * ) oops - > id  = =  object )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														return  ( ! PyArg_ParseTuple   ( value ,  " ff " ,  & ( oops - > x ) , & ( oops - > y ) ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												oops =  oops - > next ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-18 19:44:44 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " protectFlags "  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										int  flag = 0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  ! PyArg_Parse (  value ,  " i " ,  & flag  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  EXPP_ReturnIntError  (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													  " expected an integer "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										flag  & =  OB_LOCK_LOCX  |  OB_LOCK_LOCY  |  OB_LOCK_LOCZ  | 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											OB_LOCK_ROTX  |  OB_LOCK_ROTY  |  OB_LOCK_ROTZ  | 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											OB_LOCK_SIZEX  |  OB_LOCK_SIZEY  |  OB_LOCK_SIZEZ ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-11-29 05:08:29 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										object - > protectflag  =  ( short ) flag ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-18 19:44:44 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2006-03-18 17:24:59 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " dupliGroup "  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PyObject  * pyob = NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										BPy_Group  * pygrp = NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Group  * group ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  ! PyArg_Parse (  value ,  " O " ,  & pyob )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  (  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															" expected a group "  )  ) ; 	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( pyob = = Py_None )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											object - > dup_group =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											pygrp =  ( BPy_Group  * ) pyob ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											object - > dup_group =  pygrp - > group ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2005-06-17 05:10:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* SECOND, handle all the attributes that passes the value as a tuple to another function */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-06-17 05:10:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* Put the value(s) in a tuple. For some variables, we want to */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* pass the values to a function, and these functions only accept */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* PyTuples. */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									valtuple  =  Py_BuildValue (  " (O) " ,  value  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! valtuple  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnIntError (  PyExc_MemoryError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-18 19:44:44 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												" Object_setAttr: couldn't create PyTuple "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-06-17 05:10:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* Call the setFunctions to handle it */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  StringEqual (  name ,  " loc "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										result  =  Object_setLocation (  obj ,  valtuple  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if (  StringEqual (  name ,  " dloc "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										result  =  Object_setDeltaLocation (  obj ,  valtuple  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if (  StringEqual (  name ,  " rot "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										result  =  Object_setEuler (  obj ,  valtuple  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if (  StringEqual (  name ,  " track "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										result  =  Object_makeTrack (  obj ,  valtuple  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if (  StringEqual (  name ,  " drawType "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										result  =  Object_setDrawType (  obj ,  valtuple  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if (  StringEqual (  name ,  " drawMode "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										result  =  Object_setDrawMode (  obj ,  valtuple  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if (  StringEqual (  name ,  " name "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										result  =  Object_setName (  obj ,  valtuple  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if (  StringEqual (  name ,  " sel "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										result  =  Object_Select (  obj ,  valtuple  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-06 22:29:49 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  if (  StringEqual (  name ,  " effects "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnIntError (  PyExc_AttributeError ,  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												" effects is not writable "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-06-17 05:10:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  {  /* if it turns out here, it's not an attribute*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_DECREF ( valtuple ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnIntError (  PyExc_KeyError ,  " attribute not found "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* valtuple won't be returned to the caller, so we need to DECREF it */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Py_DECREF ( valtuple ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  result  ! =  Py_None  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  - 1 ; 	/* error return */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Py_None was incref'ed by the called Scene_set* function. We probably
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  don ' t  need  to  decref  Py_None  ( ! ) ,  but  since  Python / C  API  manual  tells  us 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  to  treat  it  like  any  other  PyObject  regarding  ref  counting  . . .  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Py_DECREF (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  0 ; 		/* normal return */ 
							 
						 
					
						
							
								
									
										
										
										
											2003-03-15 19:14:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Function:	Object_compare						 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Description: This is a callback function for the BPy_Object type. It	 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*		compares two Object_Type objects. Only the "==" and "!="  */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*		comparisons are meaninful. Returns 0 for equality and -1 if  */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*		they don't point to the same Blender Object struct.	 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*		In Python it becomes 1 if they are equal, 0 otherwise.	 */  
						 
					
						
							
								
									
										
										
										
											2003-06-28 07:38:21 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  int  Object_compare (  BPy_Object  *  a ,  BPy_Object  *  b  )  
						 
					
						
							
								
									
										
										
										
											2003-06-28 07:38:21 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Object  * pa  =  a - > object ,  * pb  =  b - > object ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  pa  = =  pb  )  ?  0  :  - 1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-28 07:38:21 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Function:	Object_repr						 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* Description: This is a callback function for the BPy_Object type. It	 */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*		builds a meaninful string to represent object objects.	 */  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************/  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Object_repr (  BPy_Object  *  self  )  
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  PyString_FromFormat (  " [Object  \" %s \" ] " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												    self - > object - > id . name  +  2  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-17 13:46:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2005-03-12 11:38:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getPIStrength (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > pd ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   if ( ! setupPI ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													" particle deflection could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 attr  =  PyFloat_FromDouble (  (  double  )  self - > object - > pd - > f_strength  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->pd->f_strength attribute "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setPIStrength (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    float  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > pd ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   if ( ! setupPI ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													" particle deflection could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " f " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected float argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( value  >  1000.0f  | |  value  <  - 1000.0f ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" acceptable values are between 1000.0 and -1000.0 "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > pd - > f_strength  =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getPIFalloff (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > pd ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   if ( ! setupPI ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													" particle deflection could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    attr  =  PyFloat_FromDouble (  (  double  )  self - > object - > pd - > f_power  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->pd->f_power attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setPIFalloff (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    float  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > pd ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   if ( ! setupPI ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													" particle deflection could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " f " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected float argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( value  >  10.0f  | |  value  <  0.0f ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" acceptable values are between 10.0 and 0.0 "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > pd - > f_power  =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getPIMaxDist (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > pd ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   if ( ! setupPI ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													" particle deflection could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    attr  =  PyFloat_FromDouble (  (  double  )  self - > object - > pd - > maxdist  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->pd->f_maxdist attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setPIMaxDist (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    float  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > pd ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   if ( ! setupPI ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													" particle deflection could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " f " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected float argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( value  >  1000.0f  | |  value  <  0.0f ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" acceptable values are between 1000.0 and 0.0 "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > pd - > maxdist  =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getPIUseMaxDist (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{    
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 	PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > pd ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   if ( ! setupPI ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													" particle deflection could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }      
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     attr  =  PyInt_FromLong (  (  long  )  self - > object - > pd - > flag  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->pd->flag attribute "  )  ) ;    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setPIUseMaxDist (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > pd ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   if ( ! setupPI ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													" particle deflection could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " i " ,  & (  value  )  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
																		" expected int argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > pd - > flag  =  ( short ) value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getPIType (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > pd ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   if ( ! setupPI ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													" particle deflection could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    attr   =  PyInt_FromLong (  (  long  )  self - > object - > pd - > forcefield  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->pd->forcefield attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setPIType (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > pd ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   if ( ! setupPI ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													" particle deflection could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " i " ,  & (  value  )  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
																		" expected int argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > pd - > forcefield  =  ( short ) value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getPIPerm (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > pd ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   if ( ! setupPI ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													" particle deflection could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    attr  =  PyFloat_FromDouble (  (  double  )  self - > object - > pd - > pdef_perm  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->pd->pdef_perm attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setPIPerm (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    float  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > pd ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   if ( ! setupPI ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													" particle deflection could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " f " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected float argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( value  >  1.0f  | |  value  <  0.0f ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" acceptable values are between 1.0 and 0.0 "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > pd - > pdef_perm  =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getPIRandomDamp (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > pd ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   if ( ! setupPI ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													" particle deflection could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    attr  =  PyFloat_FromDouble (  (  double  )  self - > object - > pd - > pdef_rdamp  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->pd->pdef_rdamp attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setPIRandomDamp (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    float  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > pd ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   if ( ! setupPI ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													" particle deflection could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " f " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected float argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( value  >  1.0f  | |  value  <  0.0f ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" acceptable values are between 1.0 and 0.0 "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > pd - > pdef_rdamp  =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getPISurfaceDamp (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > pd ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   if ( ! setupPI ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													" particle deflection could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    attr  =  PyFloat_FromDouble (  (  double  )  self - > object - > pd - > pdef_damp  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->pd->pdef_rdamp attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setPISurfaceDamp (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    float  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > pd ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   if ( ! setupPI ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													" particle deflection could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " f " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected float argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( value  >  1.0f  | |  value  <  0.0f ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" acceptable values are between 1.0 and 0.0 "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > pd - > pdef_damp  =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getPIDeflection (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{    
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 	PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > pd ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   if ( ! setupPI ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													" particle deflection could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }      
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     attr  =  PyInt_FromLong (  (  long  )  self - > object - > pd - > deflect  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->pd->deflect attribute "  )  ) ;    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setPIDeflection (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > pd ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupPI ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													" particle deflection could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " i " ,  & (  value  )  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
																		" expected int argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > pd - > deflect  =  ( short ) value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*  SOFTBODY FUNCTIONS */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-05-17 07:17:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								PyObject  * Object_isSB ( BPy_Object  * self )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( self - > object - > soft ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_incr_ret_True ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  return  EXPP_incr_ret_False ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								PyObject  * Object_getSBMass (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    attr  =  PyFloat_FromDouble (  (  double  )  self - > object - > soft - > nodemass  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->soft->nodemass attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setSBMass (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    float  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " f " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected float argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( value  >  50.0f  | |  value  <  0.0f ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" acceptable values are between 0.0 and 50.0 "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > soft - > nodemass  =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getSBGravity (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    attr  =  PyFloat_FromDouble (  (  double  )  self - > object - > soft - > grav  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->soft->grav attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setSBGravity (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    float  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " f " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected float argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( value  >  10.0f  | |  value  <  0.0f ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" acceptable values are between 0.0 and 10.0 "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > soft - > grav  =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getSBFriction (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    attr  =  PyFloat_FromDouble (  (  double  )  self - > object - > soft - > mediafrict  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->soft->mediafrict attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setSBFriction (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    float  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " f " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected float argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( value  >  10.0f  | |  value  <  0.0f ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" acceptable values are between 0.0 and 10.0 "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > soft - > mediafrict  =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getSBErrorLimit (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    attr  =  PyFloat_FromDouble (  (  double  )  self - > object - > soft - > rklimit  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->soft->rklimit attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setSBErrorLimit (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    float  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " f " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected float argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( value  >  1.0f  | |  value  <  0.01f ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" acceptable values are between 0.01 and 1.0 "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > soft - > rklimit  =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getSBGoalSpring (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    attr  =  PyFloat_FromDouble (  (  double  )  self - > object - > soft - > goalspring  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->soft->goalspring attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setSBGoalSpring (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    float  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer)  "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " f " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected float argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( value  >  0.999f  | |  value  <  0.00f ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" acceptable values are between 0.00 and 0.999 "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > soft - > goalspring  =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getSBGoalFriction (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    attr  =  PyFloat_FromDouble (  (  double  )  self - > object - > soft - > goalfrict  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->soft->goalfrict attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setSBGoalFriction (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    float  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " f " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected float argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( value  >  10.0f  | |  value  <  0.00f ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" acceptable values are between 0.00 and 10.0 "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > soft - > goalfrict  =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getSBMinGoal (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    attr  =  PyFloat_FromDouble (  (  double  )  self - > object - > soft - > mingoal  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->soft->mingoal attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setSBMinGoal (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    float  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " f " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected float argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( value  >  1.0f  | |  value  <  0.00f ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" acceptable values are between 0.00 and 1.0 "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > soft - > mingoal  =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getSBMaxGoal (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    attr  =  PyFloat_FromDouble (  (  double  )  self - > object - > soft - > maxgoal  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->soft->maxgoal attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setSBMaxGoal (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    float  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " f " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected float argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( value  >  1.0f  | |  value  <  0.00f ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" acceptable values are between 0.00 and 1.0 "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > soft - > maxgoal  =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getSBInnerSpring (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    attr  =  PyFloat_FromDouble (  (  double  )  self - > object - > soft - > inspring  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->soft->inspring attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setSBInnerSpring (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    float  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " f " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected float argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( value  >  0.999f  | |  value  <  0.00f ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" acceptable values are between 0.00 and 0.999 "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > soft - > inspring  =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getSBInnerSpringFriction (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    attr  =  PyFloat_FromDouble (  (  double  )  self - > object - > soft - > infrict  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->soft->infrict attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setSBInnerSpringFriction (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    float  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " f " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected float argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( value  >  10.0f  | |  value  <  0.00f ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" acceptable values are between 0.00 and 10.0 "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > soft - > infrict  =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getSBDefaultGoal (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    attr  =  PyFloat_FromDouble (  (  double  )  self - > object - > soft - > defgoal  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->soft->defgoal attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setSBDefaultGoal (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    float  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " f " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected float argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( value  >  1.0f  | |  value  <  0.00f ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" acceptable values are between 0.00 and 1.0 "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									self - > object - > soft - > defgoal  =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getSBUseGoal (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2005-05-17 07:17:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    /*short flag =  self->object->softflag;*/ 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    PyObject  * attr  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }        
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if ( self - > object - > softflag  &  OB_SB_GOAL ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           attr  =  PyInt_FromLong ( 1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else {   attr  =  PyInt_FromLong ( 0 ) ;   } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->softflag attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setSBUseGoal (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    short  value ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " h " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected integer argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( value ) {  self - > object - > softflag  | =  OB_SB_GOAL ;  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else {  self - > object - > softflag  & =  ~ OB_SB_GOAL ;  }  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getSBUseEdges (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2005-05-17 07:17:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    /*short flag =  self->object->softflag;*/ 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    PyObject  * attr  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if ( self - > object - > softflag  &  OB_SB_EDGES ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           attr  =  PyInt_FromLong ( 1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else {   attr  =  PyInt_FromLong ( 0 ) ;   } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->softflag attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setSBUseEdges (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    short  value ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " h " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected integer argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( value ) {  self - > object - > softflag  | =  OB_SB_EDGES ;  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else {  self - > object - > softflag  & =  ~ OB_SB_EDGES ;  }  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_getSBStiffQuads (  BPy_Object  *  self  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2005-05-17 07:17:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    /*short flag =  self->object->softflag;*/ 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    PyObject  * attr  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }    
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( self - > object - > softflag  &  OB_SB_QUADS ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								           attr  =  PyInt_FromLong ( 1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else {   attr  =  PyInt_FromLong ( 0 ) ;   } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  attr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  attr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" couldn't get Object->softflag attribute "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * Object_setSBStiffQuads (  BPy_Object  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    short  value ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( ! self - > object - > soft ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								       if ( ! setupSB ( self - > object ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	   return  (  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													" softbody could not be accessed (null pointer) "  )  ) ;     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 17:56:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " h " ,  & value  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  (  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected integer argument "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if ( value ) {  self - > object - > softflag  | =  OB_SB_QUADS ;  } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else {  self - > object - > softflag  & =  ~ OB_SB_QUADS ;  }  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_incr_ret (  Py_None  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								int  setupSB ( Object *  ob ) {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ob - > soft =  sbNew ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ob - > softflag  | =  OB_SB_GOAL | OB_SB_EDGES ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-16 15:33:38 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( ob - > soft ) { 	
							 
						 
					
						
							
								
									
										
										
										
											2005-06-17 05:10:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    	ob - > soft - > nodemass    =  1.0f ; 		
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	ob - > soft - > grav        =  0.0f ; 			
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	ob - > soft - > mediafrict  =  0.5f ; 	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	ob - > soft - > rklimit     =  0.1f ; 		
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	ob - > soft - > goalspring  =  0.5f ; 	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	ob - > soft - > goalfrict   =  0.0f ; 	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	ob - > soft - > mingoal     =  0.0f ; 		
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	ob - > soft - > maxgoal     =  1.0f ; 		
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	ob - > soft - > inspring    =  0.5f ; 	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	ob - > soft - > infrict     =  0.5f ; 	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    	ob - > soft - > defgoal     =  0.7f ; 		
							 
						 
					
						
							
								
									
										
										
										
											2005-04-16 15:33:38 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									    return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  { 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   return  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-16 15:33:38 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:11:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								int  setupPI ( Object *  ob ) {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( ob - > pd = = NULL )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										ob - > pd =  MEM_callocN ( sizeof ( PartDeflect ) ,  " PartDeflect " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										/* and if needed, init here */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-16 15:33:38 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if ( ob - > pd ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ob - > pd - > deflect       = 0 ; 		
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ob - > pd - > forcefield    = 0 ; 	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ob - > pd - > flag          = 0 ; 	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ob - > pd - > pdef_damp     = 0 ; 		
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ob - > pd - > pdef_rdamp    = 0 ; 		
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ob - > pd - > pdef_perm     = 0 ; 	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ob - > pd - > f_strength    = 0 ; 	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ob - > pd - > f_power       = 0 ; 	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ob - > pd - > maxdist       = 0 ; 	       
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else {  
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									   return  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-16 15:33:38 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2005-04-14 20:41:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2005-09-29 07:05:00 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  scan  list  of  Objects  looking  for  matching  obdata . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  if  found ,  set  OB_RECALC_DATA  flag . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  call  this  from  a  bpy  type  update ( )  method . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								void  Object_updateDag (  void  * data  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Object  * ob ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! data ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									for (  ob =  G . main - > object . first ;  ob ;  ob =  ob - > id . next ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  ob - > data  = =  data ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											ob - > recalc  | =  OB_RECALC_DATA ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}