2011-02-23 10:52:22 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/*
 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								 *  $ Id $ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  * * * * *  BEGIN  GPL  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 . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  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 , 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-12 13:34:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								 *  Inc . ,  51  Franklin  Street ,  Fifth  Floor ,  Boston ,  MA  02110 - 1301 ,  USA . 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  Contributor ( s ) :  Blender  Foundation  ( 2008 ) . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  * * * * *  END  GPL  LICENSE  BLOCK  * * * * * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-27 20:20:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/** \file blender/makesrna/intern/rna_access.c
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *   \ ingroup  RNA 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  <stdlib.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-13 06:30:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <stddef.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  <string.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  <ctype.h> 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "MEM_guardedalloc.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-01-01 15:52:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "DNA_ID.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-08 17:23:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "DNA_scene_types.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-01-01 15:52:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "DNA_windowmanager_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-11 18:28:00 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "BLI_blenlib.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2011-01-07 18:36:47 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "BLI_utildefines.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-11 18:28:00 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "BLI_dynstr.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-19 23:05:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "BLI_ghash.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-11 18:28:00 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-01-27 10:43:14 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "BKE_animsys.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-18 19:48:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "BKE_context.h" 
 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "BKE_idprop.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-08 17:23:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "BKE_main.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-18 19:48:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "BKE_report.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2011-01-07 19:18:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-01-01 15:52:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "WM_api.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-17 18:44:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  "RNA_access.h" 
 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "RNA_define.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 16:53:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* flush updates */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "DNA_object_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "BKE_depsgraph.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "WM_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "rna_internal.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-03 17:58:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const  PointerRNA  PointerRNA_NULL =  { { NULL } } ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-11-23 14:38:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-19 23:05:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* Init/Exit */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-13 15:02:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_init ( void ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-19 23:05:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									StructRNA  * srna ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for ( srna = BLENDER_RNA . structs . first ;  srna ;  srna = srna - > cont . next )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( ! srna - > cont . prophash )  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-05-07 07:54:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											srna - > cont . prophash =  BLI_ghash_new ( BLI_ghashutil_strhash ,  BLI_ghashutil_strcmp ,  " RNA_init gh " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-19 23:05:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											for ( prop = srna - > cont . properties . first ;  prop ;  prop = prop - > next ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if ( ! ( prop - > flag  &  PROP_BUILTIN ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													BLI_ghash_insert ( srna - > cont . prophash ,  ( void * ) prop - > identifier ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-13 15:02:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_exit ( void ) 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-19 23:05:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									StructRNA  * srna ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												== RNA Property Updates get called by Animation System now ==
This fixes bug #26764 and several others like it, where modifier
properties (and others, but most visibly modifiers) would not do
anything when animated or driven, as modifier properties require the
RNA update calls to tag the modifiers to get recalculated.
While just adding a call to RNA_property_update() could have gotten
this working (as per the Campbell's patch attached in the report, and
also my own attempt #25881). However, on production rigs, the
performance cost of this is untenatable (on my own tests, without
these updates, I was getting ~5fps on such a rig, but only 0.9fps or
possibly even worse with the updates added).
Hence, this commit adds a property-update caching system to the RNA
level, which aims to reduce to the number of times that the update
functions end up needing to get called.
While this is much faster than without the caching, I also added an
optimisation for pose bones (which are numerous in production rigs) so
that their property updates are skipped, since they are useless to the
animsys (they only tag the depsgraph for updating). This gets things
moving at a more acceptable framerate.
											 
										 
										
											2011-07-24 04:34:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_property_update_cache_free ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-06-19 23:05:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									for ( srna = BLENDER_RNA . structs . first ;  srna ;  srna = srna - > cont . next )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( srna - > cont . prophash )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											BLI_ghash_free ( srna - > cont . prophash ,  NULL ,  NULL ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											srna - > cont . prophash =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									RNA_free ( & BLENDER_RNA ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* Pointer */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_main_pointer_create ( struct  Main  * main ,  PointerRNA  * r_ptr ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									r_ptr - > id . data =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-09-02 04:53:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									r_ptr - > type =  & RNA_BlendData ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									r_ptr - > data =  main ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-01-08 15:33:34 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_id_pointer_create ( ID  * id ,  PointerRNA  * r_ptr ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									StructRNA  * type ,  * idtype =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-01-08 15:33:34 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( id )  { 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-03 17:58:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										PointerRNA  tmp =  { { NULL } } ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-01-08 15:33:34 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										tmp . data =  id ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										idtype =  rna_ID_refine ( & tmp ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-11 02:07:40 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										while ( idtype - > refine )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											type =  idtype - > refine ( & tmp ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( type  = =  idtype ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												idtype =  type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2009-01-08 15:33:34 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-11 02:07:40 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									r_ptr - > id . data =  id ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									r_ptr - > type =  idtype ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									r_ptr - > data =  id ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-01-08 15:33:34 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_pointer_create ( ID  * id ,  StructRNA  * type ,  void  * data ,  PointerRNA  * r_ptr ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2011-01-10 03:47:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								#if 0  /* UNUSED */
 
							 
						 
					
						
							
								
									
										
										
										
											2009-01-08 15:33:34 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									StructRNA  * idtype =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( id )  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-10-31 15:39:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										PointerRNA  tmp =  { { 0 } } ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-01-08 15:33:34 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										tmp . data =  id ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										idtype =  rna_ID_refine ( & tmp ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2011-01-10 03:47:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# endif 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-01-08 15:33:34 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									r_ptr - > id . data =  id ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									r_ptr - > type =  type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									r_ptr - > data =  data ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-02 23:53:40 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( data )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										while ( r_ptr - > type  & &  r_ptr - > type - > refine )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											StructRNA  * rtype =  r_ptr - > type - > refine ( r_ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( rtype  = =  r_ptr - > type ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												r_ptr - > type =  rtype ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-12-16 20:03:28 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  void  rna_pointer_inherit_id ( StructRNA  * type ,  PointerRNA  * parent ,  PointerRNA  * ptr ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-16 20:03:28 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( type  & &  type - > flag  &  STRUCT_ID )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										ptr - > id . data =  ptr - > data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										ptr - > id . data =  parent - > id . data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-12-15 13:46:50 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_blender_rna_pointer_create ( PointerRNA  * r_ptr ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									r_ptr - > id . data =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									r_ptr - > type =  & RNA_BlenderRNA ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									r_ptr - > data =  & BLENDER_RNA ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-03-19 19:03:38 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PointerRNA  rna_pointer_inherit_refine ( PointerRNA  * ptr ,  StructRNA  * type ,  void  * data ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( data )  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-11-23 08:44:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										PointerRNA  result ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-19 19:03:38 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										result . data =  data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										result . type =  type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										rna_pointer_inherit_id ( type ,  ptr ,  & result ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										while ( result . type - > refine )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											type =  result . type - > refine ( & result ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( type  = =  result . type ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												result . type =  type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2010-11-23 08:44:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  result ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  PointerRNA_NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-19 19:03:38 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-01-17 20:06:34 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/**/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_pointer_recast ( PointerRNA  * ptr ,  PointerRNA  * r_ptr ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								#if 0  // works but this case if covered by more general code below.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( RNA_struct_is_ID ( ptr - > type ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* simple case */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_id_pointer_create ( ptr - > id . data ,  r_ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# endif 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										StructRNA  * base ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										PointerRNA  t_ptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* r_ptr =  * ptr ;  /* initialize as the same incase cant recast */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										for ( base = ptr - > type - > base ;  base ;  base = base - > base )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											t_ptr =  rna_pointer_inherit_refine ( ptr ,  base ,  ptr - > data ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( t_ptr . type  & &  t_ptr . type  ! =  ptr - > type )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												* r_ptr =  t_ptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-17 18:44:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* ID Properties */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* return a UI local ID prop definition for this prop */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								IDProperty  * rna_idproperty_ui ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for ( idprop =  ( ( IDProperty  * ) prop ) - > prev ;  idprop ;  idprop =  idprop - > prev )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( strcmp ( RNA_IDP_UI ,  idprop - > name ) = = 0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( idprop = = NULL )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										for ( idprop =  ( ( IDProperty  * ) prop ) - > next ;  idprop ;  idprop =  idprop - > next )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( strcmp ( RNA_IDP_UI ,  idprop - > name ) = = 0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-07 05:05:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( idprop )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  IDP_GetPropertyTypeFromGroup ( idprop ,  ( ( IDProperty  * ) prop ) - > name ,  IDP_GROUP ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-19 10:16:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								IDProperty  * RNA_struct_idprops ( PointerRNA  * ptr ,  int  create ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-20 09:52:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-20 17:18:47 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									StructRNA  * type =  ptr - > type ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-05-20 17:18:47 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( type  & &  type - > idproperties ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  type - > idproperties ( ptr ,  create ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-05-20 09:52:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  NULL ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-19 10:16:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_struct_idprops_check ( StructRNA  * srna ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-16 19:03:40 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-24 11:40:14 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  ( srna  & &  srna - > idproperties )  ?  1  :  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-16 19:03:40 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  IDProperty  * rna_idproperty_find ( PointerRNA  * ptr ,  const  char  * name ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-19 10:16:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									IDProperty  * group =  RNA_struct_idprops ( ptr ,  0 ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-13 06:30:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( group ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  IDP_GetPropertyFromGroup ( group ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  int  rna_ensure_property_array_length ( PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop - > magic  = =  RNA_MAGIC )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  arraylen [ RNA_MAX_ARRAY_DIMENSION ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-04 22:30:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  ( prop - > getlength  & &  ptr - > data ) ?  prop - > getlength ( ptr ,  arraylen ) :  prop - > totarraylength ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										IDProperty  * idprop =  ( IDProperty * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( idprop - > type  = =  IDP_ARRAY ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  idprop - > len ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  int  rna_ensure_property_array_check ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 10:01:20 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop - > magic  = =  RNA_MAGIC )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  ( prop - > getlength  | |  prop - > totarraylength )  ?  1 : 0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										IDProperty  * idprop =  ( IDProperty * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  idprop - > type  = =  IDP_ARRAY  ?  1 : 0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  void  rna_ensure_property_multi_array_length ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  length [ ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop - > magic  = =  RNA_MAGIC )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( prop - > getlength ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											prop - > getlength ( ptr ,  length ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											memcpy ( length ,  prop - > arraylength ,  prop - > arraydimension * sizeof ( int ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										IDProperty  * idprop =  ( IDProperty * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( idprop - > type  = =  IDP_ARRAY ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											length [ 0 ] =  idprop - > len ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											length [ 0 ] =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  int  rna_idproperty_verify_valid ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  IDProperty  * idprop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-21 19:14:38 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* this verifies if the idproperty actually matches the property
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 *  description  and  otherwise  removes  it .  this  is  to  ensure  that 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 *  rna  property  access  is  type  safe ,  e . g .  if  you  defined  the  rna 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 *  to  have  a  certain  array  length  you  can  count  on  that  staying  so  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									switch ( idprop - > type )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-31 13:16:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										case  IDP_IDPARRAY : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( prop - > type  ! =  PROP_COLLECTION ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-21 19:14:38 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										case  IDP_ARRAY : 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if ( rna_ensure_property_array_length ( ptr ,  prop )  ! =  idprop - > len ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-21 19:14:38 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( idprop - > subtype  = =  IDP_FLOAT  & &  prop - > type  ! =  PROP_FLOAT ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( idprop - > subtype  = =  IDP_INT  & &  ! ELEM3 ( prop - > type ,  PROP_BOOLEAN ,  PROP_INT ,  PROP_ENUM ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  IDP_INT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( ! ELEM3 ( prop - > type ,  PROP_BOOLEAN ,  PROP_INT ,  PROP_ENUM ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  IDP_FLOAT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  IDP_DOUBLE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( prop - > type  ! =  PROP_FLOAT ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  IDP_STRING : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( prop - > type  ! =  PROP_STRING ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  IDP_GROUP : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( prop - > type  ! =  PROP_POINTER ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  PropertyRNA  * typemap [ IDP_NUMTYPES ]  = 
							 
						 
					
						
							
								
									
										
										
										
											2011-02-16 02:51:56 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									{ ( PropertyRNA * ) & rna_PropertyGroupItem_string , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 ( PropertyRNA * ) & rna_PropertyGroupItem_int , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 ( PropertyRNA * ) & rna_PropertyGroupItem_float , 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									 NULL ,  NULL ,  NULL , 
							 
						 
					
						
							
								
									
										
										
										
											2011-02-16 02:51:56 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									 ( PropertyRNA * ) & rna_PropertyGroupItem_group ,  NULL , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 ( PropertyRNA * ) & rna_PropertyGroupItem_double , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 ( PropertyRNA * ) & rna_PropertyGroupItem_idp_array } ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  PropertyRNA  * arraytypemap [ IDP_NUMTYPES ]  = 
							 
						 
					
						
							
								
									
										
										
										
											2011-02-16 02:51:56 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									{ NULL ,  ( PropertyRNA * ) & rna_PropertyGroupItem_int_array , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 ( PropertyRNA * ) & rna_PropertyGroupItem_float_array , 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									 NULL ,  NULL ,  NULL , 
							 
						 
					
						
							
								
									
										
										
										
											2011-02-16 02:51:56 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									 ( PropertyRNA * ) & rna_PropertyGroupItem_collection ,  NULL , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 ( PropertyRNA * ) & rna_PropertyGroupItem_double_array } ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-17 18:44:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								IDProperty  * rna_idproperty_check ( PropertyRNA  * * prop ,  PointerRNA  * ptr ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* This is quite a hack, but avoids some complexity in the API. we
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 *  pass  IDProperty  structs  as  PropertyRNA  pointers  to  the  outside . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 *  We  store  some  bytes  in  PropertyRNA  structs  that  allows  us  to 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 *  distinguish  it  from  IDProperty  structs .  If  it  is  an  ID  property , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 *  we  look  up  an  IDP  PropertyRNA  based  on  the  type ,  and  set  the  data 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 *  pointer  to  the  IDProperty .  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( ( * prop ) - > magic  = =  RNA_MAGIC )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-21 19:14:38 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( ( * prop ) - > flag  &  PROP_IDPROPERTY )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDProperty  * idprop =  rna_idproperty_find ( ptr ,  ( * prop ) - > identifier ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if ( idprop  & &  ! rna_idproperty_verify_valid ( ptr ,  * prop ,  idprop ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-19 10:16:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												IDProperty  * group =  RNA_struct_idprops ( ptr ,  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-21 19:14:38 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												IDP_RemFromGroup ( group ,  idprop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												IDP_FreeProperty ( idprop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												MEM_freeN ( idprop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  idprop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-17 18:44:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										IDProperty  * idprop =  ( IDProperty * ) ( * prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-17 18:44:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( idprop - > type  = =  IDP_ARRAY ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											* prop =  arraytypemap [ ( int ) ( idprop - > subtype ) ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											* prop =  typemap [ ( int ) ( idprop - > type ) ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  idprop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  PropertyRNA  * rna_ensure_property ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* the quick version if we don't need the idproperty */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop - > magic  = =  RNA_MAGIC ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										IDProperty  * idprop =  ( IDProperty * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( idprop - > type  = =  IDP_ARRAY ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  arraytypemap [ ( int ) ( idprop - > subtype ) ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  typemap [ ( int ) ( idprop - > type ) ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  const  char  * rna_ensure_property_identifier ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop - > magic  = =  RNA_MAGIC ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  prop - > identifier ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  ( ( IDProperty * ) prop ) - > name ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-10-27 02:54:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  const  char  * rna_ensure_property_description ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop - > magic  = =  RNA_MAGIC ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  prop - > description ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* attempt to get the local ID values */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										IDProperty  * idp_ui =  rna_idproperty_ui ( prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-07 05:05:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( idp_ui )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDProperty  * item =  IDP_GetPropertyTypeFromGroup ( idp_ui ,  " description " ,  IDP_STRING ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-19 18:22:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if ( item ) 
							 
						 
					
						
							
								
									
										
										
										
											2011-02-07 05:05:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												return  IDP_String ( item ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-10-27 02:54:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  ( ( IDProperty * ) prop ) - > name ;  /* XXX - not correct */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-27 02:54:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  const  char  * rna_ensure_property_name ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop - > magic  = =  RNA_MAGIC ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  prop - > name ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  ( ( IDProperty * ) prop ) - > name ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* Structs */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-09-05 21:01:50 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								StructRNA  * RNA_struct_find ( const  char  * identifier ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									StructRNA  * type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( identifier )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										for  ( type  =  BLENDER_RNA . structs . first ;  type ;  type  =  type - > cont . next ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( strcmp ( type - > identifier ,  identifier ) = = 0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const  char  * RNA_struct_identifier ( StructRNA  * type ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  type - > identifier ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const  char  * RNA_struct_ui_name ( StructRNA  * type ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  type - > name ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-03 23:16:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_struct_ui_icon ( StructRNA  * type ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( type ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  type - > icon ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  ICON_DOT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const  char  * RNA_struct_ui_description ( StructRNA  * type ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-19 04:06:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  type - > description ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-19 04:06:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PropertyRNA  * RNA_struct_name_property ( StructRNA  * type ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  type - > nameproperty ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PropertyRNA  * RNA_struct_iterator_property ( StructRNA  * type ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  type - > iteratorproperty ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-07-10 04:25:49 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								StructRNA  * RNA_struct_base ( StructRNA  * type ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  type - > base ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_struct_is_ID ( StructRNA  * type ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-29 15:43:53 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  ( type - > flag  &  STRUCT_ID )  ! =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-29 15:43:53 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-19 10:16:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_struct_idprops_register_check ( StructRNA  * type ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  ( type - > flag  &  STRUCT_NO_IDPROPERTIES )  = =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-04 17:36:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* remove an id-property */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int  RNA_struct_idprops_unset ( PointerRNA  * ptr ,  const  char  * identifier ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * group =  RNA_struct_idprops ( ptr ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( group )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										IDProperty  * idp =  IDP_GetPropertyFromGroup ( group ,  identifier ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( idp )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDP_RemFromGroup ( group ,  idp ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDP_FreeProperty ( idp ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											MEM_freeN ( idp ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_struct_is_a ( StructRNA  * type ,  StructRNA  * srna ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-14 23:17:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									StructRNA  * base ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( ! type ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-14 23:17:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* ptr->type is always maximally refined */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									for ( base = type ;  base ;  base = base - > base ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( base  = =  srna ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-14 23:17:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PropertyRNA  * RNA_struct_find_property ( PointerRNA  * ptr ,  const  char  * identifier ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2010-11-26 17:25:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( identifier [ 0 ] = = ' [ '  & &  identifier [ 1 ] = = ' " ' )  {  // "  (dummy comment to avoid confusing some function lists in text editors)
 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 20:46:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* id prop lookup, not so common */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										PropertyRNA  * r_prop =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										PointerRNA  r_ptr ;  /* only support single level props */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( RNA_path_resolve ( ptr ,  identifier ,  & r_ptr ,  & r_prop )  & &  r_ptr . type = = ptr - > type  & &  r_ptr . data = = ptr - > data ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  r_prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* most common case */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										PropertyRNA  * iterprop =  RNA_struct_iterator_property ( ptr - > type ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										PointerRNA  propptr ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 20:46:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( RNA_property_collection_lookup_string ( ptr ,  iterprop ,  identifier ,  & propptr ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  propptr . data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-19 23:05:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  NULL ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-05-11 05:18:49 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* Find the property which uses the given nested struct */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								PropertyRNA  * RNA_struct_find_nested ( PointerRNA  * ptr ,  StructRNA  * srna ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-24 21:27:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-11 05:18:49 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-24 21:27:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									RNA_STRUCT_BEGIN ( ptr ,  iprop )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-11 05:18:49 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* This assumes that there can only be one user of this nested struct */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-24 21:27:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( RNA_property_pointer_type ( ptr ,  iprop )  = =  srna )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											prop =  iprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-11 05:18:49 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-24 21:27:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									RNA_PROP_END ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-11 05:18:49 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-24 09:27:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_struct_contains_property ( PointerRNA  * ptr ,  PropertyRNA  * prop_test ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* note, prop_test could be freed memory, only use for comparison */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* validate the RNA is ok */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * iterprop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  found =  FALSE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									iterprop =  RNA_struct_iterator_property ( ptr - > type ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_PROP_BEGIN ( ptr ,  itemptr ,  iterprop )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* PropertyRNA *prop= itemptr.data; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( prop_test  = =  ( PropertyRNA  * ) itemptr . data )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											found =  TRUE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_PROP_END ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  found ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-01-25 06:54:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* low level direct access to type->properties, note this ignores parent classes so should be used with care */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								const  struct  ListBase  * RNA_struct_type_properties ( StructRNA  * srna ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-31 13:16:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  & srna - > cont . properties ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-01-25 06:54:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PropertyRNA  * RNA_struct_type_find_property ( StructRNA  * srna ,  const  char  * identifier ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  BLI_findstring_ptr ( & srna - > cont . properties ,  identifier ,  offsetof ( PropertyRNA ,  identifier ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								FunctionRNA  * RNA_struct_find_function ( PointerRNA  * ptr ,  const  char  * identifier ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-19 16:31:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# if 1 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									FunctionRNA  * func ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									StructRNA  * type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for ( type =  ptr - > type ;  type ;  type =  type - > base )  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-13 14:42:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										func =  ( FunctionRNA  * ) BLI_findstring_ptr ( & type - > functions ,  identifier ,  offsetof ( FunctionRNA ,  identifier ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-13 06:30:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( func )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  func ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-19 16:31:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* funcitonal but slow */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# else 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									PointerRNA  tptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * iterprop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									FunctionRNA  * func ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_pointer_create ( NULL ,  & RNA_Struct ,  ptr - > type ,  & tptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									iterprop =  RNA_struct_find_property ( & tptr ,  " functions " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									func =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-24 21:27:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									RNA_PROP_BEGIN ( & tptr ,  funcptr ,  iterprop )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( strcmp ( identifier ,  RNA_function_identifier ( funcptr . data ) )  = =  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											func =  funcptr . data ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-24 21:27:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									RNA_PROP_END ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  func ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-19 16:31:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# endif 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-01-25 07:31:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const  struct  ListBase  * RNA_struct_type_functions ( StructRNA  * srna ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  & srna - > functions ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								StructRegisterFunc  RNA_struct_register ( StructRNA  * type ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  type - > reg ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								StructUnregisterFunc  RNA_struct_unregister ( StructRNA  * type ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									do  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( type - > unreg ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  type - > unreg ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									}  while ( ( type = type - > base ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-18 11:21:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  * * RNA_struct_instance ( PointerRNA  * ptr ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									StructRNA  * type =  ptr - > type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									do  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( type - > instance ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  type - > instance ( ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									}  while ( ( type = type - > base ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  * RNA_struct_py_type_get ( StructRNA  * srna ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  srna - > py_type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_struct_py_type_set ( StructRNA  * srna ,  void  * py_type ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									srna - > py_type =  py_type ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-31 13:16:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  * RNA_struct_blender_type_get ( StructRNA  * srna ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  srna - > blender_type ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_struct_blender_type_set ( StructRNA  * srna ,  void  * blender_type ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									srna - > blender_type =  blender_type ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-24 14:03:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								char  * RNA_struct_name_get_alloc ( PointerRNA  * ptr ,  char  * fixedbuf ,  int  fixedlen ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * nameprop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( ptr - > data  & &  ( nameprop  =  RNA_struct_name_property ( ptr - > type ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  RNA_property_string_get_alloc ( ptr ,  nameprop ,  fixedbuf ,  fixedlen ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* Property Information */ 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-17 18:44:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const  char  * RNA_property_identifier ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  rna_ensure_property_identifier ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-10-27 02:54:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const  char  * RNA_property_description ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  rna_ensure_property_description ( prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PropertyType  RNA_property_type ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 01:43:50 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  rna_ensure_property ( prop ) - > type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 01:43:50 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PropertySubType  RNA_property_subtype ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  rna_ensure_property ( prop ) - > subtype ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 01:43:50 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
  mass, rotation, time, velocity, acceleration). These are not used
  yet anywhere.
* Centralized code that decides the name of array items based on
  subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
  later together with another change.
											 
										 
										
											2009-08-10 21:31:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PropertyUnit  RNA_property_unit ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  RNA_SUBTYPE_UNIT ( rna_ensure_property ( prop ) - > subtype ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_flag ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  rna_ensure_property ( prop ) - > flag ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-17 18:44:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-06-06 17:50:20 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  * RNA_property_py_data_get ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  prop - > py_data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
  Mesh.add_vertices([(x, y, z), (x, y, z), ...])
  Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
											 
										 
										
											2009-08-25 17:06:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_array_length ( PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
											
												Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
  Mesh.add_vertices([(x, y, z), (x, y, z), ...])
  Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
											 
										 
										
											2009-08-25 17:06:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  rna_ensure_property_array_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_array_check ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 10:01:20 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  rna_ensure_property_array_check ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 10:01:20 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* used by BPY to make an array from the python object */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int  RNA_property_array_dimension ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  length [ ] ) 
							 
						 
					
						
							
								
									
										
										
											
												Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
  Mesh.add_vertices([(x, y, z), (x, y, z), ...])
  Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
											 
										 
										
											2009-08-25 17:06:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									PropertyRNA  * rprop =  rna_ensure_property ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
											
												Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
  Mesh.add_vertices([(x, y, z), (x, y, z), ...])
  Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
											 
										 
										
											2009-08-25 17:06:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-01-03 11:50:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( length ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											rna_ensure_property_multi_array_length ( ptr ,  prop ,  length ) ; 
							 
						 
					
						
							
								
									
										
										
											
												Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
  Mesh.add_vertices([(x, y, z), (x, y, z), ...])
  Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
											 
										 
										
											2009-08-25 17:06:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  rprop - > arraydimension ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-06 15:13:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* Return the size of Nth dimension. */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_multi_array_length ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  dim ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-06 15:13:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  len [ RNA_MAX_ARRAY_DIMENSION ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-06 15:13:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									rna_ensure_property_multi_array_length ( ptr ,  prop ,  len ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-06 15:13:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  len [ dim ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-06 15:13:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
  mass, rotation, time, velocity, acceleration). These are not used
  yet anywhere.
* Centralized code that decides the name of array items based on
  subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
  later together with another change.
											 
										 
										
											2009-08-10 21:31:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								char  RNA_property_array_item_char ( PropertyRNA  * prop ,  int  index ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									const  char  * vectoritem =  " XYZW " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									const  char  * quatitem =  " WXYZ " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									const  char  * coloritem =  " RGBA " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertySubType  subtype =  rna_ensure_property ( prop ) - > subtype ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* get string to use for array index */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-28 10:19:20 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( ( index  <  4 )  & &  ELEM ( subtype ,  PROP_QUATERNION ,  PROP_AXISANGLE ) ) 
							 
						 
					
						
							
								
									
										
										
											
												RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
  mass, rotation, time, velocity, acceleration). These are not used
  yet anywhere.
* Centralized code that decides the name of array items based on
  subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
  later together with another change.
											 
										 
										
											2009-08-10 21:31:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  quatitem [ index ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-04-11 00:49:08 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( ( index  <  4 )  & &  ELEM8 ( subtype ,  PROP_TRANSLATION ,  PROP_DIRECTION ,  PROP_XYZ ,  PROP_XYZ_LENGTH ,  PROP_EULER ,  PROP_VELOCITY ,  PROP_ACCELERATION ,  PROP_COORDS ) ) 
							 
						 
					
						
							
								
									
										
										
											
												RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
  mass, rotation, time, velocity, acceleration). These are not used
  yet anywhere.
* Centralized code that decides the name of array items based on
  subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
  later together with another change.
											 
										 
										
											2009-08-10 21:31:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  vectoritem [ index ] ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												Changes to Color Management
After testing and feedback, I've decided to slightly modify the way color 
management works internally. While the previous method worked well for 
rendering, was a smaller transition and had some advantages over this
new method, it was a bit more ambiguous, and was making things difficult 
for other areas such as compositing.
This implementation now considers all color data (with only a couple of 
exceptions such as brush colors) to be stored in linear RGB color space, 
rather than sRGB as previously. This brings it in line with Nuke, which also 
operates this way, quite successfully. Color swatches, pickers, color ramp 
display are now gamma corrected to display gamma so you can see what 
you're doing, but the numbers themselves are considered linear. This 
makes understanding blending modes more clear (a 0.5 value on overlay 
will not change the result now) as well as making color swatches act more 
predictably in the compositor, however bringing over color values from 
applications like photoshop or gimp, that operate in a gamma space, 
will give identical results.
This commit will convert over existing files saved by earlier 2.5 versions to 
work generally the same, though there may be some slight differences with 
things like textures. Now that we're set on changing other areas of shading, 
this won't be too disruptive overall.
I've made a diagram explaining the pipeline here:
http://mke3.net/blender/devel/2.5/25_linear_workflow_pipeline.png
and some docs here:
http://www.blender.org/development/release-logs/blender-250/color-management/
											 
										 
										
											2009-12-02 07:56:34 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if  ( ( index  <  4 )  & &  ELEM ( subtype ,  PROP_COLOR ,  PROP_COLOR_GAMMA ) ) 
							 
						 
					
						
							
								
									
										
										
											
												RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
  mass, rotation, time, velocity, acceleration). These are not used
  yet anywhere.
* Centralized code that decides the name of array items based on
  subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
  later together with another change.
											 
										 
										
											2009-08-10 21:31:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  coloritem [ index ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  ' \0 ' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int  RNA_property_array_item_index ( PropertyRNA  * prop ,  char  name ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertySubType  subtype =  rna_ensure_property ( prop ) - > subtype ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* get index based on string name/alias */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* maybe a function to find char index in string would be better than all the switches */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( ELEM ( subtype ,  PROP_QUATERNION ,  PROP_AXISANGLE ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										switch  ( name )  { 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 11:51:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											case  ' w ' : 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												return  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 11:51:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											case  ' x ' : 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												return  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 11:51:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											case  ' y ' : 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												return  2 ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 11:51:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											case  ' z ' : 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												return  3 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( ELEM6 ( subtype ,  PROP_TRANSLATION ,  PROP_DIRECTION ,  PROP_XYZ ,  PROP_EULER ,  PROP_VELOCITY ,  PROP_ACCELERATION ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										switch  ( name )  { 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 11:51:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											case  ' x ' : 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												return  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 11:51:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											case  ' y ' : 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												return  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 11:51:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											case  ' z ' : 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												return  2 ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 11:51:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											case  ' w ' : 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												return  3 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												Changes to Color Management
After testing and feedback, I've decided to slightly modify the way color 
management works internally. While the previous method worked well for 
rendering, was a smaller transition and had some advantages over this
new method, it was a bit more ambiguous, and was making things difficult 
for other areas such as compositing.
This implementation now considers all color data (with only a couple of 
exceptions such as brush colors) to be stored in linear RGB color space, 
rather than sRGB as previously. This brings it in line with Nuke, which also 
operates this way, quite successfully. Color swatches, pickers, color ramp 
display are now gamma corrected to display gamma so you can see what 
you're doing, but the numbers themselves are considered linear. This 
makes understanding blending modes more clear (a 0.5 value on overlay 
will not change the result now) as well as making color swatches act more 
predictably in the compositor, however bringing over color values from 
applications like photoshop or gimp, that operate in a gamma space, 
will give identical results.
This commit will convert over existing files saved by earlier 2.5 versions to 
work generally the same, though there may be some slight differences with 
things like textures. Now that we're set on changing other areas of shading, 
this won't be too disruptive overall.
I've made a diagram explaining the pipeline here:
http://mke3.net/blender/devel/2.5/25_linear_workflow_pipeline.png
and some docs here:
http://www.blender.org/development/release-logs/blender-250/color-management/
											 
										 
										
											2009-12-02 07:56:34 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if  ( ELEM ( subtype ,  PROP_COLOR ,  PROP_COLOR_GAMMA ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										switch  ( name )  { 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 11:51:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											case  ' r ' : 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												return  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 11:51:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											case  ' g ' : 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												return  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 11:51:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											case  ' b ' : 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												return  2 ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-30 11:51:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											case  ' a ' : 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												return  3 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  - 1 ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones.
* Subtypes now have an associated type of units (length, area, volume,
  mass, rotation, time, velocity, acceleration). These are not used
  yet anywhere.
* Centralized code that decides the name of array items based on
  subtype (XYZ, RGB), was copied in 3 places.
* RNA_def_float etc functions still need to be update, will do this
  later together with another change.
											 
										 
										
											2009-08-10 21:31:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-03 06:51:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_int_range ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  * hardmin ,  int  * hardmax ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									IntPropertyRNA  * iprop =  ( IntPropertyRNA * ) rna_ensure_property ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( prop - > magic  ! =  RNA_MAGIC )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* attempt to get the local ID values */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										IDProperty  * idp_ui =  rna_idproperty_ui ( prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-07 05:05:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( idp_ui )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDProperty  * item ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											item =  IDP_GetPropertyTypeFromGroup ( idp_ui ,  " min " ,  IDP_INT ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											* hardmin =  item  ?  IDP_Int ( item )  :  INT_MIN ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-07 05:05:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											item =  IDP_GetPropertyTypeFromGroup ( idp_ui ,  " max " ,  IDP_INT ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											* hardmax =  item  ?  IDP_Int ( item )  :  INT_MAX ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 12:12:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( iprop - > range )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										iprop - > range ( ptr ,  hardmin ,  hardmax ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* hardmin =  iprop - > hardmin ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* hardmax =  iprop - > hardmax ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_int_ui_range ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  * softmin ,  int  * softmax ,  int  * step ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									IntPropertyRNA  * iprop =  ( IntPropertyRNA * ) rna_ensure_property ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 12:12:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  hardmin ,  hardmax ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-17 18:44:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( prop - > magic  ! =  RNA_MAGIC )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* attempt to get the local ID values */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										IDProperty  * idp_ui =  rna_idproperty_ui ( prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-07 05:05:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( idp_ui )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDProperty  * item ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-07 05:05:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											item =  IDP_GetPropertyTypeFromGroup ( idp_ui ,  " soft_min " ,  IDP_INT ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											* softmin =  item  ?  IDP_Int ( item )  :  INT_MIN ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-07 05:05:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											item =  IDP_GetPropertyTypeFromGroup ( idp_ui ,  " soft_max " ,  IDP_INT ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											* softmax =  item  ?  IDP_Int ( item )  :  INT_MAX ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											item =  IDP_GetPropertyTypeFromGroup ( idp_ui ,  " step " ,  IDP_INT ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											* step =  item  ?  IDP_Int ( item )  :  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 12:12:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( iprop - > range )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										iprop - > range ( ptr ,  & hardmin ,  & hardmax ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* softmin =  MAX2 ( iprop - > softmin ,  hardmin ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* softmax =  MIN2 ( iprop - > softmax ,  hardmax ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* softmin =  iprop - > softmin ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* softmax =  iprop - > softmax ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									* step =  iprop - > step ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_float_range ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  float  * hardmin ,  float  * hardmax ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									FloatPropertyRNA  * fprop =  ( FloatPropertyRNA * ) rna_ensure_property ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( prop - > magic  ! =  RNA_MAGIC )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* attempt to get the local ID values */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										IDProperty  * idp_ui =  rna_idproperty_ui ( prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-07 05:05:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( idp_ui )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDProperty  * item ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											item =  IDP_GetPropertyTypeFromGroup ( idp_ui ,  " min " ,  IDP_DOUBLE ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-27 17:22:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											* hardmin =  item  ?  ( float ) IDP_Double ( item )  :  FLT_MIN ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-07 05:05:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											item =  IDP_GetPropertyTypeFromGroup ( idp_ui ,  " max " ,  IDP_DOUBLE ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-27 17:22:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											* hardmax =  item  ?  ( float ) IDP_Double ( item )  :  FLT_MAX ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 12:12:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( fprop - > range )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										fprop - > range ( ptr ,  hardmin ,  hardmax ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* hardmin =  fprop - > hardmin ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* hardmax =  fprop - > hardmax ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_float_ui_range ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  float  * softmin ,  float  * softmax ,  float  * step ,  float  * precision ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									FloatPropertyRNA  * fprop =  ( FloatPropertyRNA * ) rna_ensure_property ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 12:12:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									float  hardmin ,  hardmax ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-17 18:44:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( prop - > magic  ! =  RNA_MAGIC )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* attempt to get the local ID values */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										IDProperty  * idp_ui =  rna_idproperty_ui ( prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-07 05:05:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( idp_ui )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDProperty  * item ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											item =  IDP_GetPropertyTypeFromGroup ( idp_ui ,  " soft_min " ,  IDP_DOUBLE ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-27 17:22:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											* softmin =  item  ?  ( float ) IDP_Double ( item )  :  FLT_MIN ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-07 05:05:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											item =  IDP_GetPropertyTypeFromGroup ( idp_ui ,  " soft_max " ,  IDP_DOUBLE ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-27 17:22:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											* softmax =  item  ?  ( float ) IDP_Double ( item )  :  FLT_MAX ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-07 05:05:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											item =  IDP_GetPropertyTypeFromGroup ( idp_ui ,  " step " ,  IDP_DOUBLE ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-27 17:22:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											* step =  item  ?  ( float ) IDP_Double ( item )  :  1.0f ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-07 05:05:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											item =  IDP_GetPropertyTypeFromGroup ( idp_ui ,  " precision " ,  IDP_DOUBLE ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-27 17:22:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											* precision =  item  ?  ( float ) IDP_Double ( item )  :  3.0f ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 20:01:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 12:12:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( fprop - > range )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										fprop - > range ( ptr ,  & hardmin ,  & hardmax ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* softmin =  MAX2 ( fprop - > softmin ,  hardmin ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* softmax =  MIN2 ( fprop - > softmax ,  hardmax ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* softmin =  fprop - > softmin ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* softmax =  fprop - > softmax ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									* step =  fprop - > step ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 02:06:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									* precision =  ( float ) fprop - > precision ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-02-21 14:48:28 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_float_clamp ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  float  * value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									float  min ,  max ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_property_float_range ( ptr ,  prop ,  & min ,  & max ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( * value  <  min )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* value =  min ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( * value  >  max )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* value =  max ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int  RNA_property_int_clamp ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  * value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  min ,  max ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_property_int_range ( ptr ,  prop ,  & min ,  & max ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( * value  <  min )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* value =  min ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( * value  >  max )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* value =  max ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-06-12 15:49:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* this is the max length including \0 terminator.
 
							 
						 
					
						
							
								
									
										
										
										
											2010-06-12 17:30:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								 *  ' 0 '  used  when  their  is  no  maximum  */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_string_maxlength ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									StringPropertyRNA  * sprop =  ( StringPropertyRNA * ) rna_ensure_property ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  sprop - > maxlength ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-07 13:09:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								StructRNA  * RNA_property_pointer_type ( PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-13 13:38:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									prop =  rna_ensure_property ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-13 13:38:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-03-30 17:31:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( prop - > type  = =  PROP_POINTER )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										PointerPropertyRNA  * pprop =  ( PointerPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-07 13:09:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( pprop - > typef ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  pprop - > typef ( ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  if ( pprop - > type ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-30 17:31:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											return  pprop - > type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( prop - > type  = =  PROP_COLLECTION )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										CollectionPropertyRNA  * cprop =  ( CollectionPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-13 16:08:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( cprop - > item_type ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  cprop - > item_type ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-30 17:31:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-13 13:38:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  & RNA_UnknownType ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-03 06:51:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_pointer_poll ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  PointerRNA  * value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									prop =  rna_ensure_property ( prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop - > type  = =  PROP_POINTER )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										PointerPropertyRNA  * pprop =  ( PointerPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( pprop - > poll ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  pprop - > poll ( ptr ,  * value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									printf ( " RNA_property_pointer_poll %s: is not a pointer property. \n " ,  prop - > identifier ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-04 10:25:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* Reuse for dynamic types  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								EnumPropertyItem  DummyRNA_NULL_items [ ]  =  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{ 0 ,  NULL ,  0 ,  NULL ,  NULL } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-01-27 21:19:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* Reuse for dynamic types with default value */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								EnumPropertyItem  DummyRNA_DEFAULT_items [ ]  =  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{ 0 ,  " DEFAULT " ,  0 ,  " Default " ,  " " } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{ 0 ,  NULL ,  0 ,  NULL ,  NULL } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA
* Enums can now be dynamically created in the _itemf callback,
  using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
  for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
  for operators. This doesn't fit design well at all, needed to do
  some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
  _itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
  (unselected, deselect), to make them consistent with other ops.
											 
										 
										
											2009-07-10 19:56:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_enum_items ( bContext  * C ,  PointerRNA  * ptr ,  PropertyRNA  * prop ,  EnumPropertyItem  * * item ,  int  * totitem ,  int  * free ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									EnumPropertyRNA  * eprop =  ( EnumPropertyRNA * ) rna_ensure_property ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA
* Enums can now be dynamically created in the _itemf callback,
  using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
  for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
  for operators. This doesn't fit design well at all, needed to do
  some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
  _itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
  (unselected, deselect), to make them consistent with other ops.
											 
										 
										
											2009-07-10 19:56:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									* free =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-01-27 21:19:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( eprop - > itemf  & &  ( C  ! =  NULL  | |  ( prop - > flag  &  PROP_ENUM_NO_CONTEXT ) ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 19:33:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										int  tot =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-27 21:19:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( prop - > flag  &  PROP_ENUM_NO_CONTEXT ) 
							 
						 
					
						
							
								
									
										
										
										
											2011-05-26 13:38:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											* item =  eprop - > itemf ( NULL ,  ptr ,  prop ,  free ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-27 21:19:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										else 
							 
						 
					
						
							
								
									
										
										
										
											2011-05-26 13:38:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											* item =  eprop - > itemf ( C ,  ptr ,  prop ,  free ) ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA
* Enums can now be dynamically created in the _itemf callback,
  using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
  for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
  for operators. This doesn't fit design well at all, needed to do
  some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
  _itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
  (unselected, deselect), to make them consistent with other ops.
											 
										 
										
											2009-07-10 19:56:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-07-11 13:32:20 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( totitem )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 19:33:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if ( * item )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												for (  ;  ( * item ) [ tot ] . identifier ;  tot + + ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-07-11 13:32:20 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											* totitem =  tot ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-28 23:23:47 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* item =  eprop - > item ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-23 12:36:15 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( totitem ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											* totitem =  eprop - > totitem ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-28 23:23:47 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA
* Enums can now be dynamically created in the _itemf callback,
  using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
  for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
  for operators. This doesn't fit design well at all, needed to do
  some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
  _itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
  (unselected, deselect), to make them consistent with other ops.
											 
										 
										
											2009-07-10 19:56:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_enum_value ( bContext  * C ,  PointerRNA  * ptr ,  PropertyRNA  * prop ,  const  char  * identifier ,  int  * value ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 14:36:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 	
							 
						 
					
						
							
								
									
										
										
										
											2009-12-13 12:26:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									EnumPropertyItem  * item ,  * item_array ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-25 23:59:12 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  free ,  found ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-05-18 09:26:07 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-13 12:26:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									RNA_property_enum_items ( C ,  ptr ,  prop ,  & item_array ,  NULL ,  & free ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-05-18 09:26:07 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( item_array )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										for ( item =  item_array ;  item - > identifier ;  item + + )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( item - > identifier [ 0 ]  & &  strcmp ( item - > identifier ,  identifier ) = = 0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												* value  =  item - > value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 14:36:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-18 09:26:07 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										found =  ( item - > identifier  ! =  NULL ) ;  /* could be alloc'd, assign before free */ 
							 
						 
					
						
							
								
									
										
										
											
												RNA
* Enums can now be dynamically created in the _itemf callback,
  using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
  for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
  for operators. This doesn't fit design well at all, needed to do
  some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
  _itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
  (unselected, deselect), to make them consistent with other ops.
											 
										 
										
											2009-07-10 19:56:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-18 09:26:07 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( free )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											MEM_freeN ( item_array ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										found =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-25 23:59:12 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  found ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 14:36:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA
* Enums can now be dynamically created in the _itemf callback,
  using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
  for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
  for operators. This doesn't fit design well at all, needed to do
  some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
  _itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
  (unselected, deselect), to make them consistent with other ops.
											 
										 
										
											2009-07-10 19:56:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_enum_identifier ( EnumPropertyItem  * item ,  const  int  value ,  const  char  * * identifier ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-21 14:30:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for  ( ;  item - > identifier ;  item + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-10 11:36:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( item - > identifier [ 0 ]  & &  item - > value = = value )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-21 14:30:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											* identifier  =  item - > identifier ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-07 00:16:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_enum_bitflag_identifiers ( EnumPropertyItem  * item ,  const  int  value ,  const  char  * * identifier ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  index =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for  ( ;  item - > identifier ;  item + + )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( item - > identifier [ 0 ]  & &  item - > value  &  value )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											identifier [ index + + ]  =  item - > identifier ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									identifier [ index ] =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  index ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA
* Enums can now be dynamically created in the _itemf callback,
  using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
  for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
  for operators. This doesn't fit design well at all, needed to do
  some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
  _itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
  (unselected, deselect), to make them consistent with other ops.
											 
										 
										
											2009-07-10 19:56:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_enum_name ( EnumPropertyItem  * item ,  const  int  value ,  const  char  * * name ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-21 14:30:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for  ( ;  item - > identifier ;  item + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-10 11:36:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( item - > identifier [ 0 ]  & &  item - > value = = value )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-21 14:30:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											* name  =  item - > name ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-06-14 10:33:26 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_enum_description ( EnumPropertyItem  * item ,  const  int  value ,  const  char  * * description ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for  ( ;  item - > identifier ;  item + + )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( item - > identifier [ 0 ]  & &  item - > value = = value )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											* description  =  item - > description ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA
* Enums can now be dynamically created in the _itemf callback,
  using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
  for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
  for operators. This doesn't fit design well at all, needed to do
  some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
  _itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
  (unselected, deselect), to make them consistent with other ops.
											 
										 
										
											2009-07-10 19:56:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_enum_identifier ( bContext  * C ,  PointerRNA  * ptr ,  PropertyRNA  * prop ,  const  int  value ,  const  char  * * identifier ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 14:36:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 	
							 
						 
					
						
							
								
									
										
										
											
												RNA
* Enums can now be dynamically created in the _itemf callback,
  using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
  for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
  for operators. This doesn't fit design well at all, needed to do
  some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
  _itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
  (unselected, deselect), to make them consistent with other ops.
											 
										 
										
											2009-07-10 19:56:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									EnumPropertyItem  * item =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  result ,  free ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 14:36:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
											
												RNA
* Enums can now be dynamically created in the _itemf callback,
  using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
  for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
  for operators. This doesn't fit design well at all, needed to do
  some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
  _itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
  (unselected, deselect), to make them consistent with other ops.
											 
										 
										
											2009-07-10 19:56:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									RNA_property_enum_items ( C ,  ptr ,  prop ,  & item ,  NULL ,  & free ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 19:33:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( item )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										result =  RNA_enum_identifier ( item ,  value ,  identifier ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( free ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											MEM_freeN ( item ) ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA
* Enums can now be dynamically created in the _itemf callback,
  using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
  for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
  for operators. This doesn't fit design well at all, needed to do
  some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
  _itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
  (unselected, deselect), to make them consistent with other ops.
											 
										 
										
											2009-07-10 19:56:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 19:33:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  result ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-02 14:36:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-05-10 05:46:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_enum_name ( bContext  * C ,  PointerRNA  * ptr ,  PropertyRNA  * prop ,  const  int  value ,  const  char  * * name ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									EnumPropertyItem  * item =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  result ,  free ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_property_enum_items ( C ,  ptr ,  prop ,  & item ,  NULL ,  & free ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( item )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										result =  RNA_enum_name ( item ,  value ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( free ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											MEM_freeN ( item ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  result ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-07 00:16:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_enum_bitflag_identifiers ( bContext  * C ,  PointerRNA  * ptr ,  PropertyRNA  * prop ,  const  int  value ,  const  char  * * identifier ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									EnumPropertyItem  * item =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  result ,  free ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_property_enum_items ( C ,  ptr ,  prop ,  & item ,  NULL ,  & free ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( item )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										result =  RNA_enum_bitflag_identifiers ( item ,  value ,  identifier ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( free ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											MEM_freeN ( item ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  result ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const  char  * RNA_property_ui_name ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  rna_ensure_property_name ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const  char  * RNA_property_ui_description ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-19 18:22:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  rna_ensure_property_description ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-16 00:52:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_ui_icon ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  rna_ensure_property ( prop ) - > icon ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_editable ( PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-23 11:19:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ID  * id =  ptr - > id . data ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 12:12:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  flag ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									prop =  rna_ensure_property ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-23 11:19:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									flag =  prop - > editable  ?  prop - > editable ( ptr )  :  prop - > flag ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  ( flag  &  PROP_EDITABLE )  & &  ( ! id  | |  ! id - > lib  | |  ( prop - > flag  &  PROP_LIB_EXCEPTION ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-17 18:44:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-02-23 11:19:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_editable_flag ( PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  flag ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 12:12:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-02-23 11:19:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									prop =  rna_ensure_property ( prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									flag =  prop - > editable  ?  prop - > editable ( ptr )  :  prop - > flag ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  ( flag  &  PROP_EDITABLE ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-25 12:00:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* same as RNA_property_editable(), except this checks individual items in an array */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int  RNA_property_editable_index ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  index ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ID  * id ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  flag ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									prop =  rna_ensure_property ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-12 17:08:28 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									flag =  prop - > flag ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-25 12:00:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2010-01-12 17:08:28 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( prop - > editable ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										flag  & =  prop - > editable ( ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( prop - > itemeditable ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										flag  & =  prop - > itemeditable ( ptr ,  index ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-25 12:00:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									id =  ptr - > id . data ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-12 17:08:28 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  ( flag  &  PROP_EDITABLE )  & &  ( ! id  | |  ! id - > lib  | |  ( prop - > flag  &  PROP_LIB_EXCEPTION ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-25 12:00:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-01-17 13:54:56 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_animateable ( PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-27 10:43:14 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									/* check that base ID-block can support animation data */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( ! id_type_can_have_animdata ( ptr - > id . data ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									prop =  rna_ensure_property ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-17 18:44:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-02-02 00:02:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ! ( prop - > flag  &  PROP_ANIMATABLE ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-01-17 13:54:56 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-01-12 17:08:28 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  ( prop - > flag  &  PROP_EDITABLE ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-01-17 13:54:56 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-31 02:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_animated ( PointerRNA  * UNUSED ( ptr ) ,  PropertyRNA  * UNUSED ( prop ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-01-17 13:54:56 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* would need to ask animation system */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-12-13 11:39:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* this function is to check if its possible to create a valid path from the ID
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  its  slow  so  dont  call  in  a  loop  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int  RNA_property_path_from_ID_check ( PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									char  * path =  RNA_path_from_ID_to_property ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  ret =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( path )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										PointerRNA  id_ptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										PointerRNA  r_ptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										PropertyRNA  * r_prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_id_pointer_create ( ptr - > id . data ,  & id_ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_path_resolve ( & id_ptr ,  path ,  & r_ptr ,  & r_prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										ret =  ( prop  = =  r_prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										MEM_freeN ( path ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  ret ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-08 17:23:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  void  rna_property_update ( bContext  * C ,  Main  * bmain ,  Scene  * scene ,  PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 16:53:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  is_rna  =  ( prop - > magic  = =  RNA_MAGIC ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									prop =  rna_ensure_property ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-17 18:44:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 16:53:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( is_rna )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-08 17:23:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( prop - > update )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											/* ideally no context would be needed for update, but there's some
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											   parts  of  the  code  that  need  it  still ,  so  we  have  this  exception  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( prop - > flag  &  PROP_CONTEXT_UPDATE )  { 
							 
						 
					
						
							
								
									
										
										
										
											2011-06-06 17:50:20 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if ( C )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if ( prop - > flag  &  PROP_CONTEXT_PROPERTY_UPDATE )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														( ( ContextPropUpdateFunc ) prop - > update ) ( C ,  ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														( ( ContextUpdateFunc ) prop - > update ) ( C ,  ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-08 17:23:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												prop - > update ( bmain ,  scene ,  ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 16:53:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( prop - > noteflag ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-08 17:23:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											WM_main_add_notifier ( prop - > noteflag ,  ptr - > id . data ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 16:53:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2011-07-28 15:51:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( ! is_rna  | |  ( prop - > flag  &  PROP_IDPROPERTY ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 16:53:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* WARNING! This is so property drivers update the display!
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										 *  not  especially  nice   */ 
							 
						 
					
						
							
								
									
										
										
										
											2010-12-17 15:51:42 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										DAG_id_tag_update ( ptr - > id . data ,  OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-08 17:23:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										WM_main_add_notifier ( NC_WINDOW ,  NULL ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 16:53:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-08 17:23:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-10-25 21:57:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* must keep in sync with 'rna_property_update'
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  note ,  its  possible  this  returns  a  false  positive  in  the  case  of  PROP_CONTEXT_UPDATE 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  but  this  isnt  likely  to  be  a  performance  problem .  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int  RNA_property_update_check ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  ( prop - > magic  ! =  RNA_MAGIC  | |  prop - > update  | |  prop - > noteflag ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-08 17:23:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_update ( bContext  * C ,  PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									rna_property_update ( C ,  CTX_data_main ( C ) ,  CTX_data_scene ( C ) ,  ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_property_update_main ( Main  * bmain ,  Scene  * scene ,  PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									rna_property_update ( NULL ,  bmain ,  scene ,  ptr ,  prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												== RNA Property Updates get called by Animation System now ==
This fixes bug #26764 and several others like it, where modifier
properties (and others, but most visibly modifiers) would not do
anything when animated or driven, as modifier properties require the
RNA update calls to tag the modifiers to get recalculated.
While just adding a call to RNA_property_update() could have gotten
this working (as per the Campbell's patch attached in the report, and
also my own attempt #25881). However, on production rigs, the
performance cost of this is untenatable (on my own tests, without
these updates, I was getting ~5fps on such a rig, but only 0.9fps or
possibly even worse with the updates added).
Hence, this commit adds a property-update caching system to the RNA
level, which aims to reduce to the number of times that the update
functions end up needing to get called.
While this is much faster than without the caching, I also added an
optimisation for pose bones (which are numerous in production rigs) so
that their property updates are skipped, since they are useless to the
animsys (they only tag the depsgraph for updating). This gets things
moving at a more acceptable framerate.
											 
										 
										
											2011-07-24 04:34:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* RNA Updates Cache ------------------------ */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* Overview of RNA Update cache system:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  RNA  Update  calls  need  to  be  cached  in  order  to  maintain  reasonable  performance 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  of  the  animation  system  ( i . e .  maintaining  a  somewhat  interactive  framerate ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  while  still  allowing  updates  to  be  called  ( necessary  in  particular  for  modifier 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  property  updates  to  actually  work ) . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  The  cache  is  structured  with  a  dual - layer  structure 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  -  L1  =  PointerRNA  used  as  key ;  id . data  is  used  ( it  should  always  be  defined , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 * 		 and  most  updates  end  up  using  just  that  anyways ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  -  L2  =  Update  functions  to  be  called  on  those  PointerRNA ' s 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* cache element */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								typedef  struct  tRnaUpdateCacheElem  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									struct  tRnaUpdateCacheElem  * next ,  * prev ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PointerRNA  ptr ;  	/* L1 key - id as primary, data secondary/ignored? */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ListBase  L2Funcs ; 	/* L2 functions (LinkData<RnaUpdateFuncRef>) */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}  tRnaUpdateCacheElem ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* cache global (tRnaUpdateCacheElem's) - only accessible using these API calls */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  ListBase  rna_updates_cache  =  { NULL ,  NULL } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* ........................... */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_property_update_cache_add ( PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									tRnaUpdateCacheElem  * uce  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									UpdateFunc  fn  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									LinkData  * ld ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									short  is_rna  =  ( prop - > magic  = =  RNA_MAGIC ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* sanity check */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( ELEM ( NULL ,  ptr ,  prop ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									prop =  rna_ensure_property ( prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* we can only handle update calls with no context args for now (makes animsys updates easier) */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( ( is_rna  = =  0 )  | |  ( prop - > update  = =  NULL )  | |  ( prop - > flag  &  PROP_CONTEXT_UPDATE ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									fn  =  prop - > update ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* find cache element for which key matches... */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for  ( uce  =  rna_updates_cache . first ;  uce ;  uce  =  uce - > next )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* just match by id only for now, since most update calls that we'll encounter only really care about this */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										// TODO: later, the cache might need to have some nesting on L1 to cope better with these problems + some tagging to indicate we need this
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( uce - > ptr . id . data  = =  ptr - > id . data ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( uce  = =  NULL )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* create new instance */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uce  =  MEM_callocN ( sizeof ( tRnaUpdateCacheElem ) ,  " tRnaUpdateCacheElem " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BLI_addtail ( & rna_updates_cache ,  uce ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* copy pointer */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_pointer_create ( ptr - > id . data ,  ptr - > type ,  ptr - > data ,  & uce - > ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* check on the update func */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for  ( ld  =  uce - > L2Funcs . first ;  ld ;  ld  =  ld - > next )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* stop on match - function already cached */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( fn  = =  ld - > data ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* else... if still here, we need to add it */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BLI_addtail ( & uce - > L2Funcs ,  BLI_genericNodeN ( fn ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_property_update_cache_flush ( Main  * bmain ,  Scene  * scene ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									tRnaUpdateCacheElem  * uce ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									// TODO: should we check that bmain and scene are valid? The above stuff doesn't!
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* execute the cached updates */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for  ( uce  =  rna_updates_cache . first ;  uce ;  uce  =  uce - > next )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										LinkData  * ld ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										for  ( ld  =  uce - > L2Funcs . first ;  ld ;  ld  =  ld - > next )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											UpdateFunc  fn  =  ( UpdateFunc ) ld - > data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											fn ( bmain ,  scene ,  & uce - > ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_property_update_cache_free ( void ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									tRnaUpdateCacheElem  * uce ,  * ucn ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for  ( uce  =  rna_updates_cache . first ;  uce ;  uce  =  ucn )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										ucn  =  uce - > next ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* free L2 cache */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BLI_freelistN ( & uce - > L2Funcs ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* remove self */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BLI_freelinkN ( & rna_updates_cache ,  uce ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* ---------------------------------------------------------------------- */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-17 18:44:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* Property Data */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_boolean_get ( PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BooleanPropertyRNA  * bprop =  ( BooleanPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_BOOLEAN ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  = =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  IDP_Int ( idprop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( bprop - > get ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  bprop - > get ( ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  bprop - > defaultvalue ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_boolean_set ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  value ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BooleanPropertyRNA  * bprop =  ( BooleanPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_BOOLEAN ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  = =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-02 16:07:49 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									/* just incase other values are passed */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( value )  value =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										IDP_Int ( idprop ) =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( bprop - > set ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										bprop - > set ( ptr ,  value ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-23 13:24:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( prop - > flag  &  PROP_EDITABLE )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-20 09:52:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDPropertyTemplate  val  =  { 0 } ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDProperty  * group ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										val . i =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-19 10:16:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										group =  RNA_struct_idprops ( ptr ,  1 ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( group ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDP_AddToGroup ( group ,  IDP_New ( IDP_INT ,  val ,  ( char * ) prop - > identifier ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_boolean_get_array ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  * values ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BooleanPropertyRNA  * bprop =  ( BooleanPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_BOOLEAN ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  ! =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-03-07 15:23:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( prop - > arraydimension  = =  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-07 15:23:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											values [ 0 ] =  RNA_property_boolean_get ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											memcpy ( values ,  IDP_Array ( idprop ) ,  sizeof ( int ) * idprop - > len ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( prop - > arraydimension  = =  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-07 15:23:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										values [ 0 ] =  RNA_property_boolean_get ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( bprop - > getarray ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										bprop - > getarray ( ptr ,  values ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-01-15 04:22:23 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( bprop - > defaultarray ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										memcpy ( values ,  bprop - > defaultarray ,  sizeof ( int ) * prop - > totarraylength ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-01-15 04:22:23 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										memset ( values ,  0 ,  sizeof ( int ) * prop - > totarraylength ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int  RNA_property_boolean_get_index ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  index ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  tmp [ RNA_MAX_ARRAY_LENGTH ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  len =  rna_ensure_property_array_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_BOOLEAN ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  ! =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( len  < =  RNA_MAX_ARRAY_LENGTH )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_boolean_get_array ( ptr ,  prop ,  tmp ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  tmp [ index ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  * tmparray ,  value ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										tmparray =  MEM_callocN ( sizeof ( int ) * len ,  " RNA_property_boolean_get_index " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_boolean_get_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										value =  tmparray [ index ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										MEM_freeN ( tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_boolean_set_array ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  const  int  * values ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BooleanPropertyRNA  * bprop =  ( BooleanPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_BOOLEAN ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  ! =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-03-12 15:28:00 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( prop - > arraydimension  = =  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-12 15:28:00 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											IDP_Int ( idprop ) =  values [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											memcpy ( IDP_Array ( idprop ) ,  values ,  sizeof ( int ) * idprop - > len ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( prop - > arraydimension  = =  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-12 15:28:00 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										RNA_property_boolean_set ( ptr ,  prop ,  values [ 0 ] ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( bprop - > setarray ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										bprop - > setarray ( ptr ,  values ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-23 13:24:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( prop - > flag  &  PROP_EDITABLE )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-20 09:52:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDPropertyTemplate  val  =  { 0 } ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDProperty  * group ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										val . array . len =  prop - > totarraylength ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										val . array . type =  IDP_INT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-19 10:16:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										group =  RNA_struct_idprops ( ptr ,  1 ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( group )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											idprop =  IDP_New ( IDP_ARRAY ,  val ,  ( char * ) prop - > identifier ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDP_AddToGroup ( group ,  idprop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											memcpy ( IDP_Array ( idprop ) ,  values ,  sizeof ( int ) * idprop - > len ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_boolean_set_index ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  index ,  int  value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  tmp [ RNA_MAX_ARRAY_LENGTH ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  len =  rna_ensure_property_array_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_BOOLEAN ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  ! =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( len  < =  RNA_MAX_ARRAY_LENGTH )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_boolean_get_array ( ptr ,  prop ,  tmp ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tmp [ index ] =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_boolean_set_array ( ptr ,  prop ,  tmp ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  * tmparray ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										tmparray =  MEM_callocN ( sizeof ( int ) * len ,  " RNA_property_boolean_get_index " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_boolean_get_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tmparray [ index ] =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_boolean_set_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										MEM_freeN ( tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-31 02:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_boolean_get_default ( PointerRNA  * UNUSED ( ptr ) ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-17 10:47:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BooleanPropertyRNA  * bprop =  ( BooleanPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_BOOLEAN ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  = =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-17 10:47:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  bprop - > defaultvalue ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-31 02:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_boolean_get_default_array ( PointerRNA  * UNUSED ( ptr ) ,  PropertyRNA  * prop ,  int  * values ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-17 10:47:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BooleanPropertyRNA  * bprop =  ( BooleanPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_BOOLEAN ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  ! =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-17 10:47:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( prop - > arraydimension  = =  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										values [ 0 ] =  bprop - > defaultvalue ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( bprop - > defaultarray ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										memcpy ( values ,  bprop - > defaultarray ,  sizeof ( int ) * prop - > totarraylength ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										memset ( values ,  0 ,  sizeof ( int ) * prop - > totarraylength ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int  RNA_property_boolean_get_default_index ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  index ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  tmp [ RNA_MAX_ARRAY_LENGTH ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  len =  rna_ensure_property_array_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_BOOLEAN ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  ! =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-17 10:47:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( len  < =  RNA_MAX_ARRAY_LENGTH )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_boolean_get_default_array ( ptr ,  prop ,  tmp ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  tmp [ index ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  * tmparray ,  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tmparray =  MEM_callocN ( sizeof ( int ) * len ,  " RNA_property_boolean_get_default_index " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_boolean_get_default_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										value =  tmparray [ index ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										MEM_freeN ( tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_int_get ( PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									IntPropertyRNA  * iprop =  ( IntPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_INT ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  = =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  IDP_Int ( idprop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( iprop - > get ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  iprop - > get ( ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  iprop - > defaultvalue ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_int_set ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  value ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									IntPropertyRNA  * iprop =  ( IntPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_INT ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  = =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-06-23 06:13:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									/* useful to check on bad values but set function should clamp */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* BLI_assert(RNA_property_int_clamp(ptr, prop, &value) == 0); */ 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										IDP_Int ( idprop ) =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( iprop - > set ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										iprop - > set ( ptr ,  value ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-23 13:24:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( prop - > flag  &  PROP_EDITABLE )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-20 09:52:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDPropertyTemplate  val  =  { 0 } ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDProperty  * group ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										val . i =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-19 10:16:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										group =  RNA_struct_idprops ( ptr ,  1 ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( group ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDP_AddToGroup ( group ,  IDP_New ( IDP_INT ,  val ,  ( char * ) prop - > identifier ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_int_get_array ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  * values ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									IntPropertyRNA  * iprop =  ( IntPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_INT ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  ! =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-03-07 15:23:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( prop - > arraydimension  = =  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-07 15:23:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											values [ 0 ] =  RNA_property_int_get ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											memcpy ( values ,  IDP_Array ( idprop ) ,  sizeof ( int ) * idprop - > len ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( prop - > arraydimension  = =  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-07 15:23:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										values [ 0 ] =  RNA_property_int_get ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( iprop - > getarray ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										iprop - > getarray ( ptr ,  values ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-01-15 04:22:23 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( iprop - > defaultarray ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										memcpy ( values ,  iprop - > defaultarray ,  sizeof ( int ) * prop - > totarraylength ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-01-15 04:22:23 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										memset ( values ,  0 ,  sizeof ( int ) * prop - > totarraylength ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-06-16 06:47:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_int_get_array_range ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  values [ 2 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									const  int  array_len =  RNA_property_array_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( array_len  < =  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										values [ 0 ] =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										values [ 1 ] =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if  ( array_len  = =  1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_int_get_array ( ptr ,  prop ,  values ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										values [ 1 ] =  values [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  arr_stack [ 32 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  * arr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( array_len  >  32 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											arr =  MEM_mallocN ( sizeof ( int )  *  array_len ,  " RNA_property_int_get_array_range " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											arr =  arr_stack ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_int_get_array ( ptr ,  prop ,  arr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										values [ 0 ] =  values [ 1 ] =  arr [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										for ( i =  1 ;  i  <  array_len ;  i + + )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											values [ 0 ] =  MIN2 ( values [ 0 ] ,  arr [ i ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											values [ 1 ] =  MAX2 ( values [ 1 ] ,  arr [ i ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( arr  ! =  arr_stack )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											MEM_freeN ( arr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_int_get_index ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  index ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  tmp [ RNA_MAX_ARRAY_LENGTH ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  len =  rna_ensure_property_array_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_INT ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  ! =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( len  < =  RNA_MAX_ARRAY_LENGTH )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_int_get_array ( ptr ,  prop ,  tmp ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  tmp [ index ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  * tmparray ,  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tmparray =  MEM_callocN ( sizeof ( int ) * len ,  " RNA_property_int_get_index " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_int_get_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										value =  tmparray [ index ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										MEM_freeN ( tmparray ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_int_set_array ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  const  int  * values ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									IntPropertyRNA  * iprop =  ( IntPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_INT ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  ! =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-03-12 15:28:00 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( prop - > arraydimension  = =  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-12 15:28:00 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											IDP_Int ( idprop ) =  values [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											memcpy ( IDP_Array ( idprop ) ,  values ,  sizeof ( int ) * idprop - > len ) ; \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( prop - > arraydimension  = =  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-12 15:28:00 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										RNA_property_int_set ( ptr ,  prop ,  values [ 0 ] ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( iprop - > setarray ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										iprop - > setarray ( ptr ,  values ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-23 13:24:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( prop - > flag  &  PROP_EDITABLE )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-20 09:52:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDPropertyTemplate  val  =  { 0 } ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDProperty  * group ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										val . array . len =  prop - > totarraylength ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										val . array . type =  IDP_INT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-19 10:16:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										group =  RNA_struct_idprops ( ptr ,  1 ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( group )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											idprop =  IDP_New ( IDP_ARRAY ,  val ,  ( char * ) prop - > identifier ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDP_AddToGroup ( group ,  idprop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											memcpy ( IDP_Array ( idprop ) ,  values ,  sizeof ( int ) * idprop - > len ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_int_set_index ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  index ,  int  value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  tmp [ RNA_MAX_ARRAY_LENGTH ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  len =  rna_ensure_property_array_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_INT ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  ! =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( len  < =  RNA_MAX_ARRAY_LENGTH )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_int_get_array ( ptr ,  prop ,  tmp ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tmp [ index ] =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_int_set_array ( ptr ,  prop ,  tmp ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  * tmparray ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tmparray =  MEM_callocN ( sizeof ( int ) * len ,  " RNA_property_int_get_index " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_int_get_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tmparray [ index ] =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_int_set_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										MEM_freeN ( tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-31 02:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_int_get_default ( PointerRNA  * UNUSED ( ptr ) ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-17 10:47:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IntPropertyRNA  * iprop =  ( IntPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  iprop - > defaultvalue ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-31 02:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_int_get_default_array ( PointerRNA  * UNUSED ( ptr ) ,  PropertyRNA  * prop ,  int  * values ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-17 10:47:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IntPropertyRNA  * iprop =  ( IntPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_INT ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  ! =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-17 10:47:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( prop - > arraydimension  = =  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										values [ 0 ] =  iprop - > defaultvalue ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( iprop - > defaultarray ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										memcpy ( values ,  iprop - > defaultarray ,  sizeof ( int ) * prop - > totarraylength ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										memset ( values ,  0 ,  sizeof ( int ) * prop - > totarraylength ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int  RNA_property_int_get_default_index ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  index ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  tmp [ RNA_MAX_ARRAY_LENGTH ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  len =  rna_ensure_property_array_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( len  < =  RNA_MAX_ARRAY_LENGTH )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_int_get_default_array ( ptr ,  prop ,  tmp ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  tmp [ index ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  * tmparray ,  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tmparray =  MEM_callocN ( sizeof ( int ) * len ,  " RNA_property_int_get_default_index " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_int_get_default_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										value =  tmparray [ index ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										MEM_freeN ( tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								float  RNA_property_float_get ( PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									FloatPropertyRNA  * fprop =  ( FloatPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_FLOAT ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  = =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( idprop - > type  = =  IDP_FLOAT ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  IDP_Float ( idprop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  ( float ) IDP_Double ( idprop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( fprop - > get ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  fprop - > get ( ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  fprop - > defaultvalue ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_float_set ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  float  value ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									FloatPropertyRNA  * fprop =  ( FloatPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_FLOAT ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  = =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-06-23 06:13:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									/* useful to check on bad values but set function should clamp */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* BLI_assert(RNA_property_float_clamp(ptr, prop, &value) == 0); */ 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( idprop - > type  = =  IDP_FLOAT ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDP_Float ( idprop ) =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDP_Double ( idprop ) =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( fprop - > set )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										fprop - > set ( ptr ,  value ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-23 13:24:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( prop - > flag  &  PROP_EDITABLE )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-20 09:52:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDPropertyTemplate  val  =  { 0 } ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDProperty  * group ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										val . f =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-19 10:16:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										group =  RNA_struct_idprops ( ptr ,  1 ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( group ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDP_AddToGroup ( group ,  IDP_New ( IDP_FLOAT ,  val ,  ( char * ) prop - > identifier ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_float_get_array ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  float  * values ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									FloatPropertyRNA  * fprop =  ( FloatPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  i ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_FLOAT ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  ! =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( prop - > arraydimension  = =  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-07 15:23:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											values [ 0 ] =  RNA_property_float_get ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  if ( idprop - > subtype  = =  IDP_FLOAT )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											memcpy ( values ,  IDP_Array ( idprop ) ,  sizeof ( float ) * idprop - > len ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											for ( i = 0 ;  i < idprop - > len ;  i + + ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												values [ i ] =   ( float ) ( ( ( double * ) IDP_Array ( idprop ) ) [ i ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( prop - > arraydimension  = =  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-07 15:23:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										values [ 0 ] =  RNA_property_float_get ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( fprop - > getarray ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										fprop - > getarray ( ptr ,  values ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-01-15 04:22:23 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( fprop - > defaultarray ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										memcpy ( values ,  fprop - > defaultarray ,  sizeof ( float ) * prop - > totarraylength ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-01-15 04:22:23 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										memset ( values ,  0 ,  sizeof ( float ) * prop - > totarraylength ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-06-16 06:47:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_float_get_array_range ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  float  values [ 2 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									const  int  array_len =  RNA_property_array_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( array_len  < =  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										values [ 0 ] =  0.0f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										values [ 1 ] =  0.0f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if  ( array_len  = =  1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_float_get_array ( ptr ,  prop ,  values ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										values [ 1 ] =  values [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										float  arr_stack [ 32 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										float  * arr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( array_len  >  32 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											arr =  MEM_mallocN ( sizeof ( float )  *  array_len ,  " RNA_property_float_get_array_range " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											arr =  arr_stack ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_float_get_array ( ptr ,  prop ,  arr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										values [ 0 ] =  values [ 1 ] =  arr [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										for ( i =  1 ;  i  <  array_len ;  i + + )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											values [ 0 ] =  MIN2 ( values [ 0 ] ,  arr [ i ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											values [ 1 ] =  MAX2 ( values [ 1 ] ,  arr [ i ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( arr  ! =  arr_stack )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											MEM_freeN ( arr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								float  RNA_property_float_get_index ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  index ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									float  tmp [ RNA_MAX_ARRAY_LENGTH ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  len =  rna_ensure_property_array_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_FLOAT ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  ! =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( len  < =  RNA_MAX_ARRAY_LENGTH )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_float_get_array ( ptr ,  prop ,  tmp ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  tmp [ index ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										float  * tmparray ,  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tmparray =  MEM_callocN ( sizeof ( float ) * len ,  " RNA_property_float_get_index " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_float_get_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										value =  tmparray [ index ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										MEM_freeN ( tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_float_set_array ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  const  float  * values ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									FloatPropertyRNA  * fprop =  ( FloatPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  i ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_FLOAT ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  ! =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-11 18:30:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( prop - > arraydimension  = =  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( idprop - > type  = =  IDP_FLOAT ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												IDP_Float ( idprop ) =  values [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												IDP_Double ( idprop ) =  values [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-12 15:28:00 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										else  if ( idprop - > subtype  = =  IDP_FLOAT )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											memcpy ( IDP_Array ( idprop ) ,  values ,  sizeof ( float ) * idprop - > len ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											for ( i = 0 ;  i < idprop - > len ;  i + + ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												( ( double * ) IDP_Array ( idprop ) ) [ i ] =  values [ i ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( prop - > arraydimension  = =  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-12 15:28:00 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										RNA_property_float_set ( ptr ,  prop ,  values [ 0 ] ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( fprop - > setarray )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										fprop - > setarray ( ptr ,  values ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-23 13:24:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( prop - > flag  &  PROP_EDITABLE )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-20 09:52:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDPropertyTemplate  val  =  { 0 } ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDProperty  * group ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										val . array . len =  prop - > totarraylength ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										val . array . type =  IDP_FLOAT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-19 10:16:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										group =  RNA_struct_idprops ( ptr ,  1 ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( group )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											idprop =  IDP_New ( IDP_ARRAY ,  val ,  ( char * ) prop - > identifier ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDP_AddToGroup ( group ,  idprop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											memcpy ( IDP_Array ( idprop ) ,  values ,  sizeof ( float ) * idprop - > len ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_float_set_index ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  index ,  float  value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									float  tmp [ RNA_MAX_ARRAY_LENGTH ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  len =  rna_ensure_property_array_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_FLOAT ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  ! =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-09 19:40:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( len  < =  RNA_MAX_ARRAY_LENGTH )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_float_get_array ( ptr ,  prop ,  tmp ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tmp [ index ] =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_float_set_array ( ptr ,  prop ,  tmp ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										float  * tmparray ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tmparray =  MEM_callocN ( sizeof ( float ) * len ,  " RNA_property_float_get_index " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_float_get_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tmparray [ index ] =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_float_set_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										MEM_freeN ( tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-31 02:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								float  RNA_property_float_get_default ( PointerRNA  * UNUSED ( ptr ) ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-17 10:47:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									FloatPropertyRNA  * fprop =  ( FloatPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_FLOAT ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  = =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-17 10:47:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  fprop - > defaultvalue ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-31 02:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_float_get_default_array ( PointerRNA  * UNUSED ( ptr ) ,  PropertyRNA  * prop ,  float  * values ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-17 10:47:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									FloatPropertyRNA  * fprop =  ( FloatPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_FLOAT ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  ! =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-17 10:47:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( prop - > arraydimension  = =  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										values [ 0 ] =  fprop - > defaultvalue ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( fprop - > defaultarray ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										memcpy ( values ,  fprop - > defaultarray ,  sizeof ( float ) * prop - > totarraylength ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										memset ( values ,  0 ,  sizeof ( float ) * prop - > totarraylength ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								float  RNA_property_float_get_default_index ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  index ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									float  tmp [ RNA_MAX_ARRAY_LENGTH ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  len =  rna_ensure_property_array_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_FLOAT ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-14 10:28:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_array_check ( prop )  ! =  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-17 10:47:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( len  < =  RNA_MAX_ARRAY_LENGTH )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_float_get_default_array ( ptr ,  prop ,  tmp ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  tmp [ index ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										float  * tmparray ,  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tmparray =  MEM_callocN ( sizeof ( float ) * len ,  " RNA_property_float_get_default_index " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_float_get_default_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										value =  tmparray [ index ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										MEM_freeN ( tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_string_get ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  char  * value ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									StringPropertyRNA  * sprop =  ( StringPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_STRING ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										strcpy ( value ,  IDP_String ( idprop ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( sprop - > get ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										sprop - > get ( ptr ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										strcpy ( value ,  sprop - > defaultvalue ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								char  * RNA_property_string_get_alloc ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  char  * fixedbuf ,  int  fixedlen ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-11 15:03:26 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									char  * buf ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  length ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_STRING ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									length =  RNA_property_string_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-11 15:03:26 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( length + 1  <  fixedlen ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										buf =  fixedbuf ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-28 09:28:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										buf =  MEM_mallocN ( sizeof ( char ) * ( length + 1 ) ,  " RNA_string_get_alloc " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-11 15:03:26 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-09-02 10:43:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# ifndef NDEBUG 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* safety check to ensure the string is actually set */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									buf [ length ] =  255 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# endif 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									RNA_property_string_get ( ptr ,  prop ,  buf ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-11 15:03:26 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-09-02 10:43:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# ifndef NDEBUG 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BLI_assert ( buf [ length ]  = =  ' \0 ' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# endif 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-11 15:03:26 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  buf ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-09 18:03:44 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* this is the length without \0 terminator */ 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_string_length ( PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									StringPropertyRNA  * sprop =  ( StringPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_STRING ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  strlen ( IDP_String ( idprop ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( sprop - > length ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  sprop - > length ( ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  strlen ( sprop - > defaultvalue ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_string_set ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  const  char  * value ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									StringPropertyRNA  * sprop =  ( StringPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_STRING ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2010-06-12 17:30:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDP_AssignString ( idprop ,  ( char * ) value ,  RNA_property_string_maxlength ( prop )  -  1 ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( sprop - > set ) 
							 
						 
					
						
							
								
									
										
										
										
											2010-06-12 17:30:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										sprop - > set ( ptr ,  value ) ;  /* set function needs to clamp its self */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-23 13:24:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( prop - > flag  &  PROP_EDITABLE )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-25 14:17:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDProperty  * group ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-19 10:16:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										group =  RNA_struct_idprops ( ptr ,  1 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-25 14:17:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( group ) 
							 
						 
					
						
							
								
									
										
										
										
											2010-06-12 17:30:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											IDP_AddToGroup ( group ,  IDP_NewString ( ( char * ) value ,  ( char * ) prop - > identifier ,  RNA_property_string_maxlength ( prop )  -  1 ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-25 14:17:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-31 02:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_string_get_default ( PointerRNA  * UNUSED ( ptr ) ,  PropertyRNA  * prop ,  char  * value ) 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-08 09:22:17 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									StringPropertyRNA  * sprop =  ( StringPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_STRING ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-02-08 09:22:17 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									strcpy ( value ,  sprop - > defaultvalue ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								char  * RNA_property_string_get_default_alloc ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  char  * fixedbuf ,  int  fixedlen ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									char  * buf ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  length ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_STRING ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-02-08 09:22:17 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									length =  RNA_property_string_default_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( length + 1  <  fixedlen ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										buf =  fixedbuf ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										buf =  MEM_callocN ( sizeof ( char ) * ( length + 1 ) ,  " RNA_string_get_alloc " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_property_string_get_default ( ptr ,  prop ,  buf ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  buf ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* this is the length without \0 terminator */ 
							 
						 
					
						
							
								
									
										
										
										
											2011-05-31 02:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_string_default_length ( PointerRNA  * UNUSED ( ptr ) ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-08 09:22:17 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									StringPropertyRNA  * sprop =  ( StringPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_STRING ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-02-08 09:22:17 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  strlen ( sprop - > defaultvalue ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_enum_get ( PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									EnumPropertyRNA  * eprop =  ( EnumPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_ENUM ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  IDP_Int ( idprop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( eprop - > get ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  eprop - > get ( ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  eprop - > defaultvalue ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_enum_set ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  value ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									EnumPropertyRNA  * eprop =  ( EnumPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_ENUM ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										IDP_Int ( idprop ) =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( eprop - > set )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 14:34:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										eprop - > set ( ptr ,  value ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-23 13:24:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( prop - > flag  &  PROP_EDITABLE )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-20 09:52:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDPropertyTemplate  val  =  { 0 } ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDProperty  * group ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										val . i =  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-19 10:16:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										group =  RNA_struct_idprops ( ptr ,  1 ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( group ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDP_AddToGroup ( group ,  IDP_New ( IDP_INT ,  val ,  ( char * ) prop - > identifier ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-31 02:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_enum_get_default ( PointerRNA  * UNUSED ( ptr ) ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-17 10:47:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									EnumPropertyRNA  * eprop =  ( EnumPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_ENUM ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-17 10:47:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  eprop - > defaultvalue ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-26 16:07:28 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  * RNA_property_enum_py_data_get ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									EnumPropertyRNA  * eprop =  ( EnumPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_ENUM ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  eprop - > py_data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-17 10:47:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PointerRNA  RNA_property_pointer_get ( PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PointerPropertyRNA  * pprop =  ( PointerPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_POINTER ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										pprop =  ( PointerPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* for groups, data is idprop itself */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-23 13:24:48 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  rna_pointer_inherit_refine ( ptr ,  pprop - > type ,  idprop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( pprop - > get )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  pprop - > get ( ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
											
												2.5: RNA, defining enums, pointers and collections properties is now
possible from python, but it's still work in progress.
Pointers and collections are restricted to types derived from
IDPropertyGroup (same as for operators), because RNA knows how to
allocate/deallocate those.
Collections have .add() and .remove(number) functions that can be
used. The remove function should be fixed to take an other argument
than a number.
With the IDPropertyGroup restriction, pointers are more like nested
structs. They don't have add(), remove() yet, not sure where to put
them. Currently the pointer / nested struct is automatically allocated
in the get() function, this needs to be fixed, rule is that RNA get()
will not change any data for thread safety.
Also, it is only possible to add properties to structs after they have
been registered, which needs to be improved as well.
Example code:
http://www.pasteall.org/7201/python
											 
										 
										
											2009-08-18 01:29:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( prop - > flag  &  PROP_IDPROPERTY )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* XXX temporary hack to add it automatically, reading should
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										   never  do  any  write  ops ,  to  ensure  thread  safety  etc  . .  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_pointer_add ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  RNA_property_pointer_get ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-11-23 08:44:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  PointerRNA_NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_pointer_set ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  PointerRNA  ptr_value ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2011-01-10 03:47:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									/*IDProperty *idprop;*/ 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-16 18:04:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_POINTER ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-01-10 03:47:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( /*idprop=*/  rna_idproperty_check ( & prop ,  ptr ) ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-16 18:04:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* not supported */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										PointerPropertyRNA  * pprop =  ( PointerPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-02-22 08:27:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( 		pprop - > set  & & 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												! ( ( prop - > flag  &  PROP_NEVER_NULL )  & &  ptr_value . data  = =  NULL )  & & 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												! ( ( prop - > flag  &  PROP_ID_SELF_CHECK )  & &  ptr - > id . data  = =  ptr_value . id . data ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										)  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-16 18:04:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											pprop - > set ( ptr ,  ptr_value ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-02-22 08:27:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-16 18:04:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-01-11 22:32:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PointerRNA  RNA_property_pointer_get_default ( PointerRNA  * UNUSED ( ptr ) ,  PropertyRNA  * UNUSED ( prop ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									//PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop;
 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									// BLI_assert(RNA_property_type(prop) == PROP_POINTER);
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-01-11 22:32:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  PointerRNA_NULL ;  // FIXME: there has to be a way...
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_pointer_add ( PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2011-01-10 03:47:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									/*IDProperty *idprop;*/ 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_POINTER ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-01-10 03:47:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( /*idprop=*/ rna_idproperty_check ( & prop ,  ptr ) ) )  { 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* already exists */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( prop - > flag  &  PROP_IDPROPERTY )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-20 09:52:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDPropertyTemplate  val  =  { 0 } ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDProperty  * group ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										val . i =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-19 10:16:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										group =  RNA_struct_idprops ( ptr ,  1 ) ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( group ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDP_AddToGroup ( group ,  IDP_New ( IDP_GROUP ,  val ,  ( char * ) prop - > identifier ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_property_pointer_add %s.%s: only supported for id properties. \n " ,  ptr - > type - > identifier ,  prop - > identifier ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-05-28 23:23:47 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_pointer_remove ( PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ,  * group ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_POINTER ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-05-28 23:23:47 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-19 10:16:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										group =  RNA_struct_idprops ( ptr ,  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-28 23:23:47 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( group )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDP_RemFromGroup ( group ,  idprop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDP_FreeProperty ( idprop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											MEM_freeN ( idprop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_property_pointer_remove %s.%s: only supported for id properties. \n " ,  ptr - > type - > identifier ,  prop - > identifier ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  void  rna_property_collection_get_idp ( CollectionPropertyIterator  * iter ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									CollectionPropertyRNA  * cprop =  ( CollectionPropertyRNA * ) iter - > prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-12-31 13:16:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									iter - > ptr . data =  rna_iterator_array_get ( iter ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-13 16:08:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									iter - > ptr . type =  cprop - > item_type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									rna_pointer_inherit_id ( cprop - > item_type ,  & iter - > parent ,  & iter - > ptr ) ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_collection_begin ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  CollectionPropertyIterator  * iter ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_COLLECTION ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									memset ( iter ,  0 ,  sizeof ( * iter ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) )  | |  ( prop - > flag  &  PROP_IDPROPERTY ) )  { 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										iter - > parent =  * ptr ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										iter - > prop =  prop ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( idprop ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 19:33:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											rna_iterator_array_begin ( iter ,  IDP_IDPArray ( idprop ) ,  sizeof ( IDProperty ) ,  idprop - > len ,  0 ,  NULL ) ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										else 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 19:33:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											rna_iterator_array_begin ( iter ,  NULL ,  sizeof ( IDProperty ) ,  0 ,  0 ,  NULL ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 17:05:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( iter - > valid ) 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											rna_property_collection_get_idp ( iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										iter - > idprop =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										CollectionPropertyRNA  * cprop =  ( CollectionPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										cprop - > begin ( iter ,  ptr ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_collection_next ( CollectionPropertyIterator  * iter ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2010-09-24 00:39:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									CollectionPropertyRNA  * cprop =  ( CollectionPropertyRNA * ) rna_ensure_property ( iter - > prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( iter - > idprop )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										rna_iterator_array_next ( iter ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( iter - > valid ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											rna_property_collection_get_idp ( iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										cprop - > next ( iter ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_collection_end ( CollectionPropertyIterator  * iter ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2010-09-24 00:39:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									CollectionPropertyRNA  * cprop =  ( CollectionPropertyRNA * ) rna_ensure_property ( iter - > prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( iter - > idprop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										rna_iterator_array_end ( iter ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 17:05:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										cprop - > end ( iter ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_collection_length ( PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									CollectionPropertyRNA  * cprop =  ( CollectionPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_COLLECTION ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  idprop - > len ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( cprop - > length )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  cprop - > length ( ptr ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										CollectionPropertyIterator  iter ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  length =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										RNA_property_collection_begin ( ptr ,  prop ,  & iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										for ( ;  iter . valid ;  RNA_property_collection_next ( & iter ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											length + + ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										RNA_property_collection_end ( & iter ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  length ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_collection_add ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  PointerRNA  * r_ptr ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-11 16:28:53 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								//	CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_COLLECTION ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-20 09:52:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDPropertyTemplate  val  =  { 0 } ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-31 13:16:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDProperty  * item ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										item =  IDP_New ( IDP_GROUP ,  val ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										IDP_AppendArray ( idprop ,  item ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-03-02 11:35:28 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										// IDP_FreeProperty(item); // IDP_AppendArray does a shallow copy (memcpy), only free memory 
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-31 13:16:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										MEM_freeN ( item ) ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( prop - > flag  &  PROP_IDPROPERTY )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-31 13:16:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDProperty  * group ,  * item ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-20 09:52:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDPropertyTemplate  val  =  { 0 } ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-19 10:16:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										group =  RNA_struct_idprops ( ptr ,  1 ) ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( group )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-31 13:16:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											idprop =  IDP_NewIDPArray ( prop - > identifier ) ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											IDP_AddToGroup ( group ,  idprop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-31 13:16:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											item =  IDP_New ( IDP_GROUP ,  val ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDP_AppendArray ( idprop ,  item ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-03-02 11:35:28 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											// IDP_FreeProperty(item); // IDP_AppendArray does a shallow copy (memcpy), only free memory
 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-31 13:16:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											MEM_freeN ( item ) ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-11 16:28:53 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* py api calls directly */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								#if 0 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-18 19:48:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( cprop - > add ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( ! ( cprop - > add - > flag  &  FUNC_USE_CONTEXT ) )  {  /* XXX check for this somewhere else */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-17 02:31:28 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											ParameterList  params ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											RNA_parameter_list_create ( & params ,  ptr ,  cprop - > add ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											RNA_function_call ( NULL ,  NULL ,  ptr ,  cprop - > add ,  & params ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											RNA_parameter_list_free ( & params ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-18 19:48:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
											
												2.5: RNA, defining enums, pointers and collections properties is now
possible from python, but it's still work in progress.
Pointers and collections are restricted to types derived from
IDPropertyGroup (same as for operators), because RNA knows how to
allocate/deallocate those.
Collections have .add() and .remove(number) functions that can be
used. The remove function should be fixed to take an other argument
than a number.
With the IDPropertyGroup restriction, pointers are more like nested
structs. They don't have add(), remove() yet, not sure where to put
them. Currently the pointer / nested struct is automatically allocated
in the get() function, this needs to be fixed, rule is that RNA get()
will not change any data for thread safety.
Also, it is only possible to add properties to structs after they have
been registered, which needs to be improved as well.
Example code:
http://www.pasteall.org/7201/python
											 
										 
										
											2009-08-18 01:29:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									/*else
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_property_collection_add %s.%s: not implemented for this property. \n " ,  ptr - > type - > identifier ,  prop - > identifier ) ; */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-11 16:28:53 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# endif 
 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( r_ptr )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( idprop )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											CollectionPropertyRNA  * cprop =  ( CollectionPropertyRNA * ) prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-12-31 13:16:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											r_ptr - > data =  IDP_GetIndexArray ( idprop ,  idprop - > len - 1 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-13 16:08:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											r_ptr - > type =  cprop - > item_type ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											rna_pointer_inherit_id ( NULL ,  ptr ,  r_ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											memset ( r_ptr ,  0 ,  sizeof ( * r_ptr ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												2.5: RNA, defining enums, pointers and collections properties is now
possible from python, but it's still work in progress.
Pointers and collections are restricted to types derived from
IDPropertyGroup (same as for operators), because RNA knows how to
allocate/deallocate those.
Collections have .add() and .remove(number) functions that can be
used. The remove function should be fixed to take an other argument
than a number.
With the IDPropertyGroup restriction, pointers are more like nested
structs. They don't have add(), remove() yet, not sure where to put
them. Currently the pointer / nested struct is automatically allocated
in the get() function, this needs to be fixed, rule is that RNA get()
will not change any data for thread safety.
Also, it is only possible to add properties to structs after they have
been registered, which needs to be improved as well.
Example code:
http://www.pasteall.org/7201/python
											 
										 
										
											2009-08-18 01:29:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_collection_remove ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  key ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-28 23:23:47 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-11 16:28:53 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								//	CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;
 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-28 23:23:47 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_COLLECTION ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-05-28 23:23:47 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										IDProperty  tmp ,  * array ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  len ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										len =  idprop - > len ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										array =  IDP_IDPArray ( idprop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( key  > =  0  & &  key  <  len )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( key + 1  <  len )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												/* move element to be removed to the back */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												memcpy ( & tmp ,  & array [ key ] ,  sizeof ( IDProperty ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-07 19:58:17 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												memmove ( array + key ,  array + key + 1 ,  sizeof ( IDProperty ) * ( len - ( key + 1 ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-28 23:23:47 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												memcpy ( & array [ len - 1 ] ,  & tmp ,  sizeof ( IDProperty ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											IDP_ResizeIDPArray ( idprop ,  len - 1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
											
												2.5: RNA, defining enums, pointers and collections properties is now
possible from python, but it's still work in progress.
Pointers and collections are restricted to types derived from
IDPropertyGroup (same as for operators), because RNA knows how to
allocate/deallocate those.
Collections have .add() and .remove(number) functions that can be
used. The remove function should be fixed to take an other argument
than a number.
With the IDPropertyGroup restriction, pointers are more like nested
structs. They don't have add(), remove() yet, not sure where to put
them. Currently the pointer / nested struct is automatically allocated
in the get() function, this needs to be fixed, rule is that RNA get()
will not change any data for thread safety.
Also, it is only possible to add properties to structs after they have
been registered, which needs to be improved as well.
Example code:
http://www.pasteall.org/7201/python
											 
										 
										
											2009-08-18 01:29:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-28 23:23:47 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
											
												2.5: RNA, defining enums, pointers and collections properties is now
possible from python, but it's still work in progress.
Pointers and collections are restricted to types derived from
IDPropertyGroup (same as for operators), because RNA knows how to
allocate/deallocate those.
Collections have .add() and .remove(number) functions that can be
used. The remove function should be fixed to take an other argument
than a number.
With the IDPropertyGroup restriction, pointers are more like nested
structs. They don't have add(), remove() yet, not sure where to put
them. Currently the pointer / nested struct is automatically allocated
in the get() function, this needs to be fixed, rule is that RNA get()
will not change any data for thread safety.
Also, it is only possible to add properties to structs after they have
been registered, which needs to be improved as well.
Example code:
http://www.pasteall.org/7201/python
											 
										 
										
											2009-08-18 01:29:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( prop - > flag  &  PROP_IDPROPERTY ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-11 16:28:53 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* py api calls directly */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								#if 0 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-18 19:48:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( cprop - > remove ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( ! ( cprop - > remove - > flag  &  FUNC_USE_CONTEXT ) )  {  /* XXX check for this somewhere else */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-17 02:31:28 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											ParameterList  params ; 
							 
						 
					
						
							
								
									
										
										
											
												2.5: RNA, defining enums, pointers and collections properties is now
possible from python, but it's still work in progress.
Pointers and collections are restricted to types derived from
IDPropertyGroup (same as for operators), because RNA knows how to
allocate/deallocate those.
Collections have .add() and .remove(number) functions that can be
used. The remove function should be fixed to take an other argument
than a number.
With the IDPropertyGroup restriction, pointers are more like nested
structs. They don't have add(), remove() yet, not sure where to put
them. Currently the pointer / nested struct is automatically allocated
in the get() function, this needs to be fixed, rule is that RNA get()
will not change any data for thread safety.
Also, it is only possible to add properties to structs after they have
been registered, which needs to be improved as well.
Example code:
http://www.pasteall.org/7201/python
											 
										 
										
											2009-08-18 01:29:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											RNA_parameter_list_create ( & params ,  ptr ,  cprop - > remove ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-17 02:31:28 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											RNA_function_call ( NULL ,  NULL ,  ptr ,  cprop - > remove ,  & params ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											RNA_parameter_list_free ( & params ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-18 19:48:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
											
												2.5: RNA, defining enums, pointers and collections properties is now
possible from python, but it's still work in progress.
Pointers and collections are restricted to types derived from
IDPropertyGroup (same as for operators), because RNA knows how to
allocate/deallocate those.
Collections have .add() and .remove(number) functions that can be
used. The remove function should be fixed to take an other argument
than a number.
With the IDPropertyGroup restriction, pointers are more like nested
structs. They don't have add(), remove() yet, not sure where to put
them. Currently the pointer / nested struct is automatically allocated
in the get() function, this needs to be fixed, rule is that RNA get()
will not change any data for thread safety.
Also, it is only possible to add properties to structs after they have
been registered, which needs to be improved as well.
Example code:
http://www.pasteall.org/7201/python
											 
										 
										
											2009-08-18 01:29:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-18 19:48:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
											
												2.5: RNA, defining enums, pointers and collections properties is now
possible from python, but it's still work in progress.
Pointers and collections are restricted to types derived from
IDPropertyGroup (same as for operators), because RNA knows how to
allocate/deallocate those.
Collections have .add() and .remove(number) functions that can be
used. The remove function should be fixed to take an other argument
than a number.
With the IDPropertyGroup restriction, pointers are more like nested
structs. They don't have add(), remove() yet, not sure where to put
them. Currently the pointer / nested struct is automatically allocated
in the get() function, this needs to be fixed, rule is that RNA get()
will not change any data for thread safety.
Also, it is only possible to add properties to structs after they have
been registered, which needs to be improved as well.
Example code:
http://www.pasteall.org/7201/python
											 
										 
										
											2009-08-18 01:29:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									/*else
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_property_collection_remove %s.%s: only supported for id properties. \n " ,  ptr - > type - > identifier ,  prop - > identifier ) ; */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-11 16:28:53 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# endif 
 
							 
						 
					
						
							
								
									
										
										
											
												2.5: RNA, defining enums, pointers and collections properties is now
possible from python, but it's still work in progress.
Pointers and collections are restricted to types derived from
IDPropertyGroup (same as for operators), because RNA knows how to
allocate/deallocate those.
Collections have .add() and .remove(number) functions that can be
used. The remove function should be fixed to take an other argument
than a number.
With the IDPropertyGroup restriction, pointers are more like nested
structs. They don't have add(), remove() yet, not sure where to put
them. Currently the pointer / nested struct is automatically allocated
in the get() function, this needs to be fixed, rule is that RNA get()
will not change any data for thread safety.
Also, it is only possible to add properties to structs after they have
been registered, which needs to be improved as well.
Example code:
http://www.pasteall.org/7201/python
											 
										 
										
											2009-08-18 01:29:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-28 23:23:47 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-03-10 20:54:14 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_collection_move ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  key ,  int  pos ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_COLLECTION ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-03-10 20:54:14 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										IDProperty  tmp ,  * array ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  len ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										len =  idprop - > len ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										array =  IDP_IDPArray ( idprop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( key  > =  0  & &  key  <  len  & &  pos  > =  0  & &  pos  <  len  & &  key  ! =  pos )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											memcpy ( & tmp ,  & array [ key ] ,  sizeof ( IDProperty ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( pos  <  key ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												memmove ( array + pos + 1 ,  array + pos ,  sizeof ( IDProperty ) * ( key  -  pos ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												memmove ( array + key ,  array + key + 1 ,  sizeof ( IDProperty ) * ( pos  -  key ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											memcpy ( & array [ pos ] ,  & tmp ,  sizeof ( IDProperty ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( prop - > flag  &  PROP_IDPROPERTY ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_property_collection_clear ( PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * idprop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_COLLECTION ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ( idprop = rna_idproperty_check ( & prop ,  ptr ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-31 13:16:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										IDP_ResizeIDPArray ( idprop ,  0 ) ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-10-27 10:14:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_collection_lookup_index ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  PointerRNA  * t_ptr ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									CollectionPropertyIterator  iter ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  index =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_COLLECTION ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-10-27 10:14:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									RNA_property_collection_begin ( ptr ,  prop ,  & iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for ( index = 0 ;  iter . valid ;  RNA_property_collection_next ( & iter ) ,  index + + )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( iter . ptr . data  = =  t_ptr - > data ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_property_collection_end ( & iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* did we find it? */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( iter . valid ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  index ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_collection_lookup_int ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  key ,  PointerRNA  * r_ptr ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2010-09-24 00:39:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									CollectionPropertyRNA  * cprop =  ( CollectionPropertyRNA * ) rna_ensure_property ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_COLLECTION ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									if ( cprop - > lookupint )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* we have a callback defined, use it */ 
							 
						 
					
						
							
								
									
										
										
										
											2011-01-05 14:49:08 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  cprop - > lookupint ( ptr ,  key ,  r_ptr ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* no callback defined, just iterate and find the nth item */ 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										CollectionPropertyIterator  iter ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										int  i ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										RNA_property_collection_begin ( ptr ,  prop ,  & iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										for ( i = 0 ;  iter . valid ;  RNA_property_collection_next ( & iter ) ,  i + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if ( i  = =  key )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 17:05:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												* r_ptr =  iter . ptr ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
												break ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										RNA_property_collection_end ( & iter ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( ! iter . valid ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											memset ( r_ptr ,  0 ,  sizeof ( * r_ptr ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  iter . valid ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_collection_lookup_string ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  const  char  * key ,  PointerRNA  * r_ptr ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2010-09-24 00:39:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									CollectionPropertyRNA  * cprop =  ( CollectionPropertyRNA * ) rna_ensure_property ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_COLLECTION ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									if ( cprop - > lookupstring )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* we have a callback defined, use it */ 
							 
						 
					
						
							
								
									
										
										
										
											2011-01-05 14:49:08 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  cprop - > lookupstring ( ptr ,  key ,  r_ptr ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* no callback defined, compare with name properties if they exist */ 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										CollectionPropertyIterator  iter ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-11 18:28:00 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										PropertyRNA  * nameprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										char  name [ 256 ] ,  * nameptr ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-29 15:43:53 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										int  found =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										RNA_property_collection_begin ( ptr ,  prop ,  & iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										for ( ;  iter . valid ;  RNA_property_collection_next ( & iter ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 17:05:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if ( iter . ptr . data  & &  iter . ptr . type - > nameproperty )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												nameprop =  iter . ptr . type - > nameproperty ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-29 15:43:53 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												nameptr =  RNA_property_string_get_alloc ( & iter . ptr ,  nameprop ,  name ,  sizeof ( name ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if ( strcmp ( nameptr ,  key )  = =  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 17:05:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													* r_ptr =  iter . ptr ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													found =  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if ( ( char  * ) & name  ! =  nameptr ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													MEM_freeN ( nameptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if ( found ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													break ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										RNA_property_collection_end ( & iter ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( ! iter . valid ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											memset ( r_ptr ,  0 ,  sizeof ( * r_ptr ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  iter . valid ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-13 16:08:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_collection_type_get ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  PointerRNA  * r_ptr ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-03 16:07:29 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_COLLECTION ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-13 16:08:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									* r_ptr =  * ptr ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 14:10:29 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  ( ( r_ptr - > type  =  prop - > srna )  ?  1 : 0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-11 16:28:53 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA
Implementation of RNA side of foreach_get/foreach_set,
Campbell will do python code.
Three functions for efficiently setting some property for all
items in a collection. RNA_property_collection_raw_array gives
access to the properties as an array with length, stride, and
type specified, if this is possible, i.e. not when it uses a
ListBase, or if a manual get/set function is implemented.
Two other functions take a C array pointer and get/set it
using the a collection + property name, using efficient array
access if possible, and otherwise using slower RNA iterator.
RNA_property_collection_raw_get
RNA_property_collection_raw_set
The number of type conversion required here got a bit out of
hand, it could be more efficient still if checking for more
cases, but function is already long enough.
Example: http://www.pasteall.org/6362/c
											 
										 
										
											2009-06-29 19:15:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_collection_raw_array ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  PropertyRNA  * itemprop ,  RawArray  * array ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									CollectionPropertyIterator  iter ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ArrayIterator  * internal ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									char  * arrayp ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-03-22 12:56:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( RNA_property_type ( prop )  = =  PROP_COLLECTION ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA
Implementation of RNA side of foreach_get/foreach_set,
Campbell will do python code.
Three functions for efficiently setting some property for all
items in a collection. RNA_property_collection_raw_array gives
access to the properties as an array with length, stride, and
type specified, if this is possible, i.e. not when it uses a
ListBase, or if a manual get/set function is implemented.
Two other functions take a C array pointer and get/set it
using the a collection + property name, using efficient array
access if possible, and otherwise using slower RNA iterator.
RNA_property_collection_raw_get
RNA_property_collection_raw_set
The number of type conversion required here got a bit out of
hand, it could be more efficient still if checking for more
cases, but function is already long enough.
Example: http://www.pasteall.org/6362/c
											 
										 
										
											2009-06-29 19:15:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ! ( prop - > flag  &  PROP_RAW_ARRAY )  | |  ! ( itemprop - > flag  &  PROP_RAW_ACCESS ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_property_collection_begin ( ptr ,  prop ,  & iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( iter . valid )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* get data from array iterator and item property */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										internal =  iter . internal ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										arrayp =  ( iter . valid ) ?  iter . ptr . data :  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( internal - > skip  | |  ! RNA_property_editable ( & iter . ptr ,  itemprop ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											/* we might skip some items, so it's not a proper array */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											RNA_property_collection_end ( & iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										array - > array =  arrayp  +  itemprop - > rawoffset ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										array - > stride =  internal - > itemsize ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										array - > len =  ( ( char * ) internal - > endptr  -  arrayp ) / internal - > itemsize ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										array - > type =  itemprop - > rawtype ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										memset ( array ,  0 ,  sizeof ( RawArray ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_property_collection_end ( & iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define RAW_GET(dtype, var, raw, a) \ 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									switch ( raw . type )  {  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_RAW_CHAR :  var  =  ( dtype ) ( ( char * ) raw . array ) [ a ] ;  break ;  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_RAW_SHORT :  var  =  ( dtype ) ( ( short * ) raw . array ) [ a ] ;  break ;  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_RAW_INT :  var  =  ( dtype ) ( ( int * ) raw . array ) [ a ] ;  break ;  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_RAW_FLOAT :  var  =  ( dtype ) ( ( float * ) raw . array ) [ a ] ;  break ;  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_RAW_DOUBLE :  var  =  ( dtype ) ( ( double * ) raw . array ) [ a ] ;  break ;  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										default :  var  =  ( dtype ) 0 ;  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									}  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define RAW_SET(dtype, raw, a, var) \ 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									switch ( raw . type )  {  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_RAW_CHAR :  ( ( char * ) raw . array ) [ a ]  =  ( char ) var ;  break ;  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_RAW_SHORT :  ( ( short * ) raw . array ) [ a ]  =  ( short ) var ;  break ;  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_RAW_INT :  ( ( int * ) raw . array ) [ a ]  =  ( int ) var ;  break ;  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_RAW_FLOAT :  ( ( float * ) raw . array ) [ a ]  =  ( float ) var ;  break ;  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_RAW_DOUBLE :  ( ( double * ) raw . array ) [ a ]  =  ( double ) var ;  break ;  \
							 
						 
					
						
							
								
									
										
										
										
											2010-01-12 19:47:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										default :  break ;  \
							 
						 
					
						
							
								
									
										
										
											
												RNA
Implementation of RNA side of foreach_get/foreach_set,
Campbell will do python code.
Three functions for efficiently setting some property for all
items in a collection. RNA_property_collection_raw_array gives
access to the properties as an array with length, stride, and
type specified, if this is possible, i.e. not when it uses a
ListBase, or if a manual get/set function is implemented.
Two other functions take a C array pointer and get/set it
using the a collection + property name, using efficient array
access if possible, and otherwise using slower RNA iterator.
RNA_property_collection_raw_get
RNA_property_collection_raw_set
The number of type conversion required here got a bit out of
hand, it could be more efficient still if checking for more
cases, but function is already long enough.
Example: http://www.pasteall.org/6362/c
											 
										 
										
											2009-06-29 19:15:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									}  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-30 12:52:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_raw_type_sizeof ( RawPropertyType  type ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									switch ( type )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_RAW_CHAR :  return  sizeof ( char ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_RAW_SHORT :  return  sizeof ( short ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_RAW_INT :  return  sizeof ( int ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_RAW_FLOAT :  return  sizeof ( float ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_RAW_DOUBLE :  return  sizeof ( double ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-30 19:10:14 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										default :  return  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-30 12:52:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-01 23:53:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  int  rna_raw_access ( ReportList  * reports ,  PointerRNA  * ptr ,  PropertyRNA  * prop ,  const  char  * propname ,  void  * inarray ,  RawPropertyType  intype ,  int  inlen ,  int  set ) 
							 
						 
					
						
							
								
									
										
										
											
												RNA
Implementation of RNA side of foreach_get/foreach_set,
Campbell will do python code.
Three functions for efficiently setting some property for all
items in a collection. RNA_property_collection_raw_array gives
access to the properties as an array with length, stride, and
type specified, if this is possible, i.e. not when it uses a
ListBase, or if a manual get/set function is implemented.
Two other functions take a C array pointer and get/set it
using the a collection + property name, using efficient array
access if possible, and otherwise using slower RNA iterator.
RNA_property_collection_raw_get
RNA_property_collection_raw_set
The number of type conversion required here got a bit out of
hand, it could be more efficient still if checking for more
cases, but function is already long enough.
Example: http://www.pasteall.org/6362/c
											 
										 
										
											2009-06-29 19:15:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									StructRNA  * ptype ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PointerRNA  itemptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * itemprop ,  * iprop ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-16 04:45:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									PropertyType  itemtype = 0 ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA
Implementation of RNA side of foreach_get/foreach_set,
Campbell will do python code.
Three functions for efficiently setting some property for all
items in a collection. RNA_property_collection_raw_array gives
access to the properties as an array with length, stride, and
type specified, if this is possible, i.e. not when it uses a
ListBase, or if a manual get/set function is implemented.
Two other functions take a C array pointer and get/set it
using the a collection + property name, using efficient array
access if possible, and otherwise using slower RNA iterator.
RNA_property_collection_raw_get
RNA_property_collection_raw_set
The number of type conversion required here got a bit out of
hand, it could be more efficient still if checking for more
cases, but function is already long enough.
Example: http://www.pasteall.org/6362/c
											 
										 
										
											2009-06-29 19:15:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									RawArray  in ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  itemlen =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* initialize in array, stride assumed 0 in following code */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									in . array =  inarray ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									in . type =  intype ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									in . len =  inlen ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									in . stride =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ptype =  RNA_property_pointer_type ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* try to get item property pointer */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_pointer_create ( NULL ,  ptype ,  NULL ,  & itemptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									itemprop =  RNA_struct_find_property ( & itemptr ,  propname ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( itemprop )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* we have item property pointer */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RawArray  out ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* check type */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										itemtype =  RNA_property_type ( itemprop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( ! ELEM3 ( itemtype ,  PROP_BOOLEAN ,  PROP_INT ,  PROP_FLOAT ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											BKE_report ( reports ,  RPT_ERROR ,  " Only boolean, int and float properties supported. " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* check item array */ 
							 
						 
					
						
							
								
									
										
										
											
												Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
  Mesh.add_vertices([(x, y, z), (x, y, z), ...])
  Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
											 
										 
										
											2009-08-25 17:06:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										itemlen =  RNA_property_array_length ( & itemptr ,  itemprop ) ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA
Implementation of RNA side of foreach_get/foreach_set,
Campbell will do python code.
Three functions for efficiently setting some property for all
items in a collection. RNA_property_collection_raw_array gives
access to the properties as an array with length, stride, and
type specified, if this is possible, i.e. not when it uses a
ListBase, or if a manual get/set function is implemented.
Two other functions take a C array pointer and get/set it
using the a collection + property name, using efficient array
access if possible, and otherwise using slower RNA iterator.
RNA_property_collection_raw_get
RNA_property_collection_raw_set
The number of type conversion required here got a bit out of
hand, it could be more efficient still if checking for more
cases, but function is already long enough.
Example: http://www.pasteall.org/6362/c
											 
										 
										
											2009-06-29 19:15:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* try to access as raw array */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( RNA_property_collection_raw_array ( ptr ,  prop ,  itemprop ,  & out ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-04 22:30:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											int  arraylen  =  ( itemlen  = =  0 )  ?  1  :  itemlen ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( in . len  ! =  arraylen * out . len )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												BKE_reportf ( reports ,  RPT_ERROR ,  " Array length mismatch (expected %d, got %d). " ,  out . len * arraylen ,  in . len ) ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA
Implementation of RNA side of foreach_get/foreach_set,
Campbell will do python code.
Three functions for efficiently setting some property for all
items in a collection. RNA_property_collection_raw_array gives
access to the properties as an array with length, stride, and
type specified, if this is possible, i.e. not when it uses a
ListBase, or if a manual get/set function is implemented.
Two other functions take a C array pointer and get/set it
using the a collection + property name, using efficient array
access if possible, and otherwise using slower RNA iterator.
RNA_property_collection_raw_get
RNA_property_collection_raw_set
The number of type conversion required here got a bit out of
hand, it could be more efficient still if checking for more
cases, but function is already long enough.
Example: http://www.pasteall.org/6362/c
											 
										 
										
											2009-06-29 19:15:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											/* matching raw types */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( out . type  = =  in . type )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												void  * inp =  in . array ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												void  * outp =  out . array ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												int  a ,  size ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-01-04 22:30:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												size =  RNA_raw_type_sizeof ( out . type )  *  arraylen ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA
Implementation of RNA side of foreach_get/foreach_set,
Campbell will do python code.
Three functions for efficiently setting some property for all
items in a collection. RNA_property_collection_raw_array gives
access to the properties as an array with length, stride, and
type specified, if this is possible, i.e. not when it uses a
ListBase, or if a manual get/set function is implemented.
Two other functions take a C array pointer and get/set it
using the a collection + property name, using efficient array
access if possible, and otherwise using slower RNA iterator.
RNA_property_collection_raw_get
RNA_property_collection_raw_set
The number of type conversion required here got a bit out of
hand, it could be more efficient still if checking for more
cases, but function is already long enough.
Example: http://www.pasteall.org/6362/c
											 
										 
										
											2009-06-29 19:15:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												for ( a = 0 ;  a < out . len ;  a + + )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if ( set )  memcpy ( outp ,  inp ,  size ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													else  memcpy ( inp ,  outp ,  size ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													inp =  ( char * ) inp  +  size ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													outp =  ( char * ) outp  +  out . stride ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											/* could also be faster with non-matching types,
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											 *  for  now  we  just  do  slower  loop  . .  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										void  * tmparray =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  tmplen =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  err =  0 ,  j ,  a =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-04 22:30:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										int  needconv  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( ( ( itemtype  = =  PROP_BOOLEAN  | |  itemtype  = =  PROP_INT )  & &  in . type  = =  PROP_RAW_INT )  | | 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											( itemtype  = =  PROP_FLOAT  & &  in . type  = =  PROP_RAW_FLOAT ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											/* avoid creating temporary buffer if the data type match */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											needconv  =  0 ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA
Implementation of RNA side of foreach_get/foreach_set,
Campbell will do python code.
Three functions for efficiently setting some property for all
items in a collection. RNA_property_collection_raw_array gives
access to the properties as an array with length, stride, and
type specified, if this is possible, i.e. not when it uses a
ListBase, or if a manual get/set function is implemented.
Two other functions take a C array pointer and get/set it
using the a collection + property name, using efficient array
access if possible, and otherwise using slower RNA iterator.
RNA_property_collection_raw_get
RNA_property_collection_raw_set
The number of type conversion required here got a bit out of
hand, it could be more efficient still if checking for more
cases, but function is already long enough.
Example: http://www.pasteall.org/6362/c
											 
										 
										
											2009-06-29 19:15:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* no item property pointer, can still be id property, or
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										 *  property  of  a  type  derived  from  the  collection  pointer  type  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_PROP_BEGIN ( ptr ,  itemptr ,  prop )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( itemptr . data )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if ( itemprop )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													/* we got the property already */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													iprop =  itemprop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													/* not yet, look it up and verify if it is valid */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													iprop =  RNA_struct_find_property ( & itemptr ,  propname ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if ( iprop )  { 
							 
						 
					
						
							
								
									
										
										
											
												Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
  Mesh.add_vertices([(x, y, z), (x, y, z), ...])
  Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
											 
										 
										
											2009-08-25 17:06:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														itemlen =  RNA_property_array_length ( & itemptr ,  iprop ) ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA
Implementation of RNA side of foreach_get/foreach_set,
Campbell will do python code.
Three functions for efficiently setting some property for all
items in a collection. RNA_property_collection_raw_array gives
access to the properties as an array with length, stride, and
type specified, if this is possible, i.e. not when it uses a
ListBase, or if a manual get/set function is implemented.
Two other functions take a C array pointer and get/set it
using the a collection + property name, using efficient array
access if possible, and otherwise using slower RNA iterator.
RNA_property_collection_raw_get
RNA_property_collection_raw_set
The number of type conversion required here got a bit out of
hand, it could be more efficient still if checking for more
cases, but function is already long enough.
Example: http://www.pasteall.org/6362/c
											 
										 
										
											2009-06-29 19:15:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														itemtype =  RNA_property_type ( iprop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														BKE_reportf ( reports ,  RPT_ERROR ,  " Property named %s not found. " ,  propname ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														err =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if ( ! ELEM3 ( itemtype ,  PROP_BOOLEAN ,  PROP_INT ,  PROP_FLOAT ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														BKE_report ( reports ,  RPT_ERROR ,  " Only boolean, int and float properties supported. " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														err =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												/* editable check */ 
							 
						 
					
						
							
								
									
										
										
										
											2011-07-01 08:48:00 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if ( ! set  | |  RNA_property_editable ( & itemptr ,  iprop ) )  { 
							 
						 
					
						
							
								
									
										
										
											
												RNA
Implementation of RNA side of foreach_get/foreach_set,
Campbell will do python code.
Three functions for efficiently setting some property for all
items in a collection. RNA_property_collection_raw_array gives
access to the properties as an array with length, stride, and
type specified, if this is possible, i.e. not when it uses a
ListBase, or if a manual get/set function is implemented.
Two other functions take a C array pointer and get/set it
using the a collection + property name, using efficient array
access if possible, and otherwise using slower RNA iterator.
RNA_property_collection_raw_get
RNA_property_collection_raw_set
The number of type conversion required here got a bit out of
hand, it could be more efficient still if checking for more
cases, but function is already long enough.
Example: http://www.pasteall.org/6362/c
											 
										 
										
											2009-06-29 19:15:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if ( a + itemlen  >  in . len )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														BKE_reportf ( reports ,  RPT_ERROR ,  " Array length mismatch (got %d, expected more). " ,  in . len ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														err =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if ( itemlen  = =  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														/* handle conversions */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														if ( set )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															switch ( itemtype )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																case  PROP_BOOLEAN :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	int  b ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RAW_GET ( int ,  b ,  in ,  a ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RNA_property_boolean_set ( & itemptr ,  iprop ,  b ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																case  PROP_INT :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	int  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RAW_GET ( int ,  i ,  in ,  a ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RNA_property_int_set ( & itemptr ,  iprop ,  i ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																case  PROP_FLOAT :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	float  f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RAW_GET ( float ,  f ,  in ,  a ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RNA_property_float_set ( & itemptr ,  iprop ,  f ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															switch ( itemtype )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																case  PROP_BOOLEAN :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	int  b =  RNA_property_boolean_get ( & itemptr ,  iprop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RAW_SET ( int ,  in ,  a ,  b ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																case  PROP_INT :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	int  i =  RNA_property_int_get ( & itemptr ,  iprop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RAW_SET ( int ,  in ,  a ,  i ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																case  PROP_FLOAT :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	float  f =  RNA_property_float_get ( & itemptr ,  iprop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RAW_SET ( float ,  in ,  a ,  f ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														a + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-04 22:30:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													else  if  ( needconv  = =  1 )  { 
							 
						 
					
						
							
								
									
										
										
											
												RNA
Implementation of RNA side of foreach_get/foreach_set,
Campbell will do python code.
Three functions for efficiently setting some property for all
items in a collection. RNA_property_collection_raw_array gives
access to the properties as an array with length, stride, and
type specified, if this is possible, i.e. not when it uses a
ListBase, or if a manual get/set function is implemented.
Two other functions take a C array pointer and get/set it
using the a collection + property name, using efficient array
access if possible, and otherwise using slower RNA iterator.
RNA_property_collection_raw_get
RNA_property_collection_raw_set
The number of type conversion required here got a bit out of
hand, it could be more efficient still if checking for more
cases, but function is already long enough.
Example: http://www.pasteall.org/6362/c
											 
										 
										
											2009-06-29 19:15:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														/* allocate temporary array if needed */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														if ( tmparray  & &  tmplen  ! =  itemlen )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															MEM_freeN ( tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															tmparray =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														if ( ! tmparray )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															tmparray =  MEM_callocN ( sizeof ( float ) * itemlen ,  " RNA tmparray \n " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															tmplen =  itemlen ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														/* handle conversions */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														if ( set )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															switch ( itemtype )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																case  PROP_BOOLEAN :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	for ( j = 0 ;  j < itemlen ;  j + + ,  a + + ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																		RAW_GET ( int ,  ( ( int * ) tmparray ) [ j ] ,  in ,  a ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RNA_property_boolean_set_array ( & itemptr ,  iprop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																case  PROP_INT :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	for ( j = 0 ;  j < itemlen ;  j + + ,  a + + ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																		RAW_GET ( int ,  ( ( int * ) tmparray ) [ j ] ,  in ,  a ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RNA_property_int_set_array ( & itemptr ,  iprop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																case  PROP_FLOAT :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	for ( j = 0 ;  j < itemlen ;  j + + ,  a + + ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																		RAW_GET ( float ,  ( ( float * ) tmparray ) [ j ] ,  in ,  a ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RNA_property_float_set_array ( & itemptr ,  iprop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															switch ( itemtype )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																case  PROP_BOOLEAN :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RNA_property_boolean_get_array ( & itemptr ,  iprop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	for ( j = 0 ;  j < itemlen ;  j + + ,  a + + ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																		RAW_SET ( int ,  in ,  a ,  ( ( int * ) tmparray ) [ j ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																case  PROP_INT :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RNA_property_int_get_array ( & itemptr ,  iprop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	for ( j = 0 ;  j < itemlen ;  j + + ,  a + + ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																		RAW_SET ( int ,  in ,  a ,  ( ( int * ) tmparray ) [ j ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																case  PROP_FLOAT :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RNA_property_float_get_array ( & itemptr ,  iprop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	for ( j = 0 ;  j < itemlen ;  j + + ,  a + + ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																		RAW_SET ( float ,  in ,  a ,  ( ( float * ) tmparray ) [ j ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-04 22:30:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														if ( set )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															switch ( itemtype )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																case  PROP_BOOLEAN :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RNA_property_boolean_set_array ( & itemptr ,  iprop ,  & ( ( int * ) in . array ) [ a ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	a  + =  itemlen ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																case  PROP_INT :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RNA_property_int_set_array ( & itemptr ,  iprop ,  & ( ( int * ) in . array ) [ a ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	a  + =  itemlen ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																case  PROP_FLOAT :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RNA_property_float_set_array ( & itemptr ,  iprop ,  & ( ( float * ) in . array ) [ a ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	a  + =  itemlen ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															switch ( itemtype )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																case  PROP_BOOLEAN :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RNA_property_boolean_get_array ( & itemptr ,  iprop ,  & ( ( int * ) in . array ) [ a ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	a  + =  itemlen ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																case  PROP_INT :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RNA_property_int_get_array ( & itemptr ,  iprop ,  & ( ( int * ) in . array ) [ a ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	a  + =  itemlen ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																case  PROP_FLOAT :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	RNA_property_float_get_array ( & itemptr ,  iprop ,  & ( ( float * ) in . array ) [ a ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	a  + =  itemlen ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
											
												RNA
Implementation of RNA side of foreach_get/foreach_set,
Campbell will do python code.
Three functions for efficiently setting some property for all
items in a collection. RNA_property_collection_raw_array gives
access to the properties as an array with length, stride, and
type specified, if this is possible, i.e. not when it uses a
ListBase, or if a manual get/set function is implemented.
Two other functions take a C array pointer and get/set it
using the a collection + property name, using efficient array
access if possible, and otherwise using slower RNA iterator.
RNA_property_collection_raw_get
RNA_property_collection_raw_set
The number of type conversion required here got a bit out of
hand, it could be more efficient still if checking for more
cases, but function is already long enough.
Example: http://www.pasteall.org/6362/c
											 
										 
										
											2009-06-29 19:15:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_PROP_END ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( tmparray ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											MEM_freeN ( tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  ! err ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-30 12:52:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								RawPropertyType  RNA_property_raw_type ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-04 22:30:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( prop - > rawtype  = =  PROP_RAW_UNSET )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* this property has no raw access, yet we try to provide a raw type to help building the array */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										switch  ( prop - > type )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_BOOLEAN : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  PROP_RAW_INT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_INT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  PROP_RAW_INT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_FLOAT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  PROP_RAW_FLOAT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_ENUM : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  PROP_RAW_INT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-30 12:52:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  prop - > rawtype ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-01 23:53:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_collection_raw_get ( ReportList  * reports ,  PointerRNA  * ptr ,  PropertyRNA  * prop ,  const  char  * propname ,  void  * array ,  RawPropertyType  type ,  int  len ) 
							 
						 
					
						
							
								
									
										
										
											
												RNA
Implementation of RNA side of foreach_get/foreach_set,
Campbell will do python code.
Three functions for efficiently setting some property for all
items in a collection. RNA_property_collection_raw_array gives
access to the properties as an array with length, stride, and
type specified, if this is possible, i.e. not when it uses a
ListBase, or if a manual get/set function is implemented.
Two other functions take a C array pointer and get/set it
using the a collection + property name, using efficient array
access if possible, and otherwise using slower RNA iterator.
RNA_property_collection_raw_get
RNA_property_collection_raw_set
The number of type conversion required here got a bit out of
hand, it could be more efficient still if checking for more
cases, but function is already long enough.
Example: http://www.pasteall.org/6362/c
											 
										 
										
											2009-06-29 19:15:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  rna_raw_access ( reports ,  ptr ,  prop ,  propname ,  array ,  type ,  len ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-02-01 23:53:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_collection_raw_set ( ReportList  * reports ,  PointerRNA  * ptr ,  PropertyRNA  * prop ,  const  char  * propname ,  void  * array ,  RawPropertyType  type ,  int  len ) 
							 
						 
					
						
							
								
									
										
										
											
												RNA
Implementation of RNA side of foreach_get/foreach_set,
Campbell will do python code.
Three functions for efficiently setting some property for all
items in a collection. RNA_property_collection_raw_array gives
access to the properties as an array with length, stride, and
type specified, if this is possible, i.e. not when it uses a
ListBase, or if a manual get/set function is implemented.
Two other functions take a C array pointer and get/set it
using the a collection + property name, using efficient array
access if possible, and otherwise using slower RNA iterator.
RNA_property_collection_raw_get
RNA_property_collection_raw_set
The number of type conversion required here got a bit out of
hand, it could be more efficient still if checking for more
cases, but function is already long enough.
Example: http://www.pasteall.org/6362/c
											 
										 
										
											2009-06-29 19:15:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  rna_raw_access ( reports ,  ptr ,  prop ,  propname ,  array ,  type ,  len ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								/* Standard iterator functions */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 12:12:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  rna_iterator_listbase_begin ( CollectionPropertyIterator  * iter ,  ListBase  * lb ,  IteratorSkipFunc  skip ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-17 18:44:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ListBaseIterator  * internal ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									internal =  MEM_callocN ( sizeof ( ListBaseIterator ) ,  " ListBaseIterator " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-19 14:56:49 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									internal - > link =  ( lb ) ?  lb - > first :  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 12:12:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									internal - > skip =  skip ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-17 18:44:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									iter - > internal =  internal ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									iter - > valid =  ( internal - > link  ! =  NULL ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 12:12:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( skip  & &  iter - > valid  & &  skip ( iter ,  internal - > link ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										rna_iterator_listbase_next ( iter ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  rna_iterator_listbase_next ( CollectionPropertyIterator  * iter ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-17 18:44:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ListBaseIterator  * internal =  iter - > internal ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 12:12:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( internal - > skip )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										do  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											internal - > link =  internal - > link - > next ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											iter - > valid =  ( internal - > link  ! =  NULL ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}  while ( iter - > valid  & &  internal - > skip ( iter ,  internal - > link ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										internal - > link =  internal - > link - > next ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										iter - > valid =  ( internal - > link  ! =  NULL ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  * rna_iterator_listbase_get ( CollectionPropertyIterator  * iter ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-17 18:44:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ListBaseIterator  * internal =  iter - > internal ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  internal - > link ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  rna_iterator_listbase_end ( CollectionPropertyIterator  * iter ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									MEM_freeN ( iter - > internal ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-05 19:43:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									iter - > internal =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-03-14 22:30:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PointerRNA  rna_listbase_lookup_int ( PointerRNA  * ptr ,  StructRNA  * type ,  struct  ListBase  * lb ,  int  index ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									void  * data =  BLI_findlink ( lb ,  index ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  rna_pointer_inherit_refine ( ptr ,  type ,  data ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 19:33:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  rna_iterator_array_begin ( CollectionPropertyIterator  * iter ,  void  * ptr ,  int  itemsize ,  int  length ,  int  free_ptr ,  IteratorSkipFunc  skip ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ArrayIterator  * internal ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 12:12:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ptr  = =  NULL ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										length =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-11-29 00:18:26 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if  ( length  = =  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										ptr =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										itemsize =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 12:12:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									internal =  MEM_callocN ( sizeof ( ArrayIterator ) ,  " ArrayIterator " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									internal - > ptr =  ptr ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 19:33:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									internal - > free_ptr =  free_ptr  ?  ptr : NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-01 00:23:08 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									internal - > endptr =  ( ( char * ) ptr ) + length * itemsize ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									internal - > itemsize =  itemsize ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 12:12:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									internal - > skip =  skip ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-01-01 13:49:22 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									internal - > length =  length ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									iter - > internal =  internal ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									iter - > valid =  ( internal - > ptr  ! =  internal - > endptr ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 12:12:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( skip  & &  iter - > valid  & &  skip ( iter ,  internal - > ptr ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										rna_iterator_array_next ( iter ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  rna_iterator_array_next ( CollectionPropertyIterator  * iter ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ArrayIterator  * internal =  iter - > internal ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 12:12:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( internal - > skip )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										do  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											internal - > ptr  + =  internal - > itemsize ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											iter - > valid =  ( internal - > ptr  ! =  internal - > endptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}  while ( iter - > valid  & &  internal - > skip ( iter ,  internal - > ptr ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										internal - > ptr  + =  internal - > itemsize ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										iter - > valid =  ( internal - > ptr  ! =  internal - > endptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  * rna_iterator_array_get ( CollectionPropertyIterator  * iter ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ArrayIterator  * internal =  iter - > internal ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  internal - > ptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-26 22:24:26 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  * rna_iterator_array_dereference_get ( CollectionPropertyIterator  * iter ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ArrayIterator  * internal =  iter - > internal ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* for ** arrays */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  * ( void * * ) ( internal - > ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								void  rna_iterator_array_end ( CollectionPropertyIterator  * iter ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 19:33:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ArrayIterator  * internal =  iter - > internal ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-08-16 15:46:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( internal - > free_ptr )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-13 19:33:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										MEM_freeN ( internal - > free_ptr ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-08-16 15:46:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										internal - > free_ptr =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									MEM_freeN ( iter - > internal ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-05 19:43:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									iter - > internal =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-31 23:50:02 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-03-14 22:30:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PointerRNA  rna_array_lookup_int ( PointerRNA  * ptr ,  StructRNA  * type ,  void  * data ,  int  itemsize ,  int  length ,  int  index ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( index  <  0  | |  index  > =  length ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  PointerRNA_NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  rna_pointer_inherit_refine ( ptr ,  type ,  ( ( char * ) data )  +  index * itemsize ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* RNA Path - Experiment */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  char  * rna_path_token ( const  char  * * path ,  char  * fixedbuf ,  int  fixedlen ,  int  bracket ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									const  char  * p ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									char  * buf ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-09-22 09:49:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									char  quote =  ' \0 ' ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  i ,  j ,  len ,  escape ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									len =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( bracket )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* get data between [], check escaping ] with \] */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( * * path  = =  ' [ ' )  ( * path ) + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										p =  * path ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-09-22 09:49:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* 2 kinds of lookups now, quoted or unquoted */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										quote =  * p ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-06-13 13:54:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( quote  ! =  ' " ' )  /* " - this comment is hack for Aligorith's text editor's sanity */ 
							 
						 
					
						
							
								
									
										
										
										
											2010-09-22 09:49:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											quote =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( quote = = 0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											while ( * p  & &  ( * p  ! =  ' ] ' ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												len + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												p + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											escape =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											/* skip the first quote */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											len + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											p + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											while ( * p  & &  ( * p  ! =  quote  | |  escape ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												escape =  ( * p  = =  ' \\ ' ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												len + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												p + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											/* skip the last quoted char to get the ']' */ 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											len + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											p + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( * p  ! =  ' ] ' )  return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* get data until . or [ */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										p =  * path ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										while ( * p  & &  * p  ! =  ' . '  & &  * p  ! =  ' [ ' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											len + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											p + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* empty, return */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( len  = =  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* try to use fixed buffer if possible */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( len + 1  <  fixedlen ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										buf =  fixedbuf ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										buf =  MEM_callocN ( sizeof ( char ) * ( len + 1 ) ,  " rna_path_token " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* copy string, taking into account escaped ] */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-19 23:05:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( bracket )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										for ( p = * path ,  i = 0 ,  j = 0 ;  i < len ;  i + + ,  p + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-09-22 09:49:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if ( * p  = =  ' \\ '  & &  * ( p + 1 )  = =  quote ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-19 23:05:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											else  buf [ j + + ] =  * p ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-19 23:05:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										buf [ j ] =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										memcpy ( buf ,  * path ,  sizeof ( char ) * len ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										buf [ len ] =  ' \0 ' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* set path to start of next token */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( * p  = =  ' ] ' )  p + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( * p  = =  ' . ' )  p + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									* path =  p ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  buf ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 20:46:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  int  rna_token_strip_quotes ( char  * token ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( token [ 0 ] = = ' " ' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  len  =  strlen ( token ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( len  > =  2  & &  token [ len - 1 ] = = ' " ' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											/* strip away "" */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											token [ len - 1 ] =  ' \0 ' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												Bugfix #19663: Renaming named data doesn't fix F-Curves
RNA Paths used in F-Curve, Drivers, etc. now get renamed when some data that they use gets renamed. This only works when things like Bones, Constraints, Shape Keys, and Modifiers get renamed, but other cases can get added easily. 
The code here only performs simple string replacements, so there is the potential for problems when several sets of data with the same names are present. For example, if there are multiple armatures with bones that have the same names, renaming a bone on one armature (with a bone on another armature having the same name) will break all the drivers on the other one, even though they aren't really connected. However, I don't expect the aforementioned scenario to really be a problem in most production scenarios. 
											 
										 
										
											2009-10-20 03:44:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* Resolve the given RNA path to find the pointer+property indicated at the end of the path */ 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_path_resolve ( PointerRNA  * ptr ,  const  char  * path ,  PointerRNA  * r_ptr ,  PropertyRNA  * * r_prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  RNA_path_resolve_full ( ptr ,  path ,  r_ptr ,  r_prop ,  NULL ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int  RNA_path_resolve_full ( PointerRNA  * ptr ,  const  char  * path ,  PointerRNA  * r_ptr ,  PropertyRNA  * * r_prop ,  int  * index ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-19 23:05:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									PointerRNA  curptr ,  nextptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									char  fixedbuf [ 256 ] ,  * token ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-23 05:36:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  type ,  intkey ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									prop =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									curptr =  * ptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 20:46:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( path = = NULL  | |  * path = = ' \0 ' ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-07 09:23:29 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									while ( * path )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 20:46:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										int  use_id_prop  =  ( * path = = ' [ ' )  ?  1 : 0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* custom property lookup ?
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										 *  C . object [ " someprop " ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										 */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* look up property name in current struct */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 20:46:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										token =  rna_path_token ( & path ,  fixedbuf ,  sizeof ( fixedbuf ) ,  use_id_prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( ! token ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 20:46:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( use_id_prop )  {  /* look up property name in current struct */ 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-19 10:16:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											IDProperty  * group =  RNA_struct_idprops ( & curptr ,  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 13:02:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if ( group  & &  rna_token_strip_quotes ( token ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 20:46:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												prop =  ( PropertyRNA  * ) IDP_GetPropertyFromGroup ( group ,  token + 1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											prop =  RNA_struct_find_property ( & curptr ,  token ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( token  ! =  fixedbuf ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											MEM_freeN ( token ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( ! prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										type =  RNA_property_type ( prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* now look up the value of this property if it is a pointer or
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										 *  collection ,  otherwise  return  the  property  rna  so  that  the 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										 *  caller  can  read  the  value  of  the  property  itself  */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										switch  ( type )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_POINTER : 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											nextptr =  RNA_property_pointer_get ( & curptr ,  prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-30 09:18:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if ( nextptr . data )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												curptr =  nextptr ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-30 09:18:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												prop =  NULL ;  /* now we have a PointerRNA, the prop is our parent so forget it */ 
							 
						 
					
						
							
								
									
										
										
										
											2010-09-24 10:39:26 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if ( index )  * index =  - 1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-30 09:18:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_COLLECTION : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( * path )  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-23 05:36:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if ( * path  = =  ' [ ' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													/* resolve the lookup with [] brackets */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													token =  rna_path_token ( & path ,  fixedbuf ,  sizeof ( fixedbuf ) ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if ( ! token ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													/* check for "" to see if it is a string */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if ( rna_token_strip_quotes ( token ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														RNA_property_collection_lookup_string ( & curptr ,  prop ,  token + 1 ,  & nextptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														/* otherwise do int lookup */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														intkey =  atoi ( token ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-12-01 10:17:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														if ( intkey = = 0  & &  ( token [ 0 ]  ! =  ' 0 '  | |  token [ 1 ]  ! =  ' \0 ' ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															return  0 ;  /* we can be sure the fixedbuf was used in this case */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-23 05:36:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														RNA_property_collection_lookup_int ( & curptr ,  prop ,  intkey ,  & nextptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-23 05:36:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if ( token  ! =  fixedbuf )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														MEM_freeN ( token ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												else  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-23 05:36:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													PointerRNA  c_ptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													/* ensure we quit on invalid values */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													nextptr . data  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-23 05:36:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if ( RNA_property_collection_type_get ( & curptr ,  prop ,  & c_ptr ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														nextptr =  c_ptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-30 09:18:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if ( nextptr . data )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													curptr =  nextptr ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-30 09:18:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													prop =  NULL ;   /* now we have a PointerRNA, the prop is our parent so forget it */ 
							 
						 
					
						
							
								
									
										
										
										
											2010-09-24 10:39:26 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if ( index )  * index =  - 1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-30 09:18:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													return  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-23 05:36:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( index = = NULL ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												break ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											* index =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( * path )  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-12-13 02:33:14 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												int  index_arr [ RNA_MAX_ARRAY_DIMENSION ] =  { 0 } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												int  len [ RNA_MAX_ARRAY_DIMENSION ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												const  int  dim =  RNA_property_array_dimension ( & curptr ,  prop ,  len ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												int  i ,  temp_index ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-12-13 02:33:14 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												for ( i = 0 ;  i < dim ;  i + + )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													temp_index =  - 1 ;  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													/* multi index resolve */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if  ( * path = = ' [ ' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														token =  rna_path_token ( & path ,  fixedbuf ,  sizeof ( fixedbuf ) ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														if ( token = = NULL )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															/* invalid syntax blah[] */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														/* check for "" to see if it is a string */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														else  if ( rna_token_strip_quotes ( token ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															temp_index =  RNA_property_array_item_index ( prop ,  * ( token + 1 ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															/* otherwise do int lookup */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															temp_index =  atoi ( token ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															if ( temp_index = = 0  & &  ( token [ 0 ]  ! =  ' 0 '  | |  token [ 1 ]  ! =  ' \0 ' ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																if ( token  ! =  fixedbuf )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	MEM_freeN ( token ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2010-12-13 02:33:14 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													else  if ( dim = = 1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														/* location.x || scale.X, single dimension arrays only */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														token =  rna_path_token ( & path ,  fixedbuf ,  sizeof ( fixedbuf ) ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														if ( token = = NULL )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															/* invalid syntax blah.. */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															return  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-12-01 10:17:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2010-12-13 02:33:14 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														temp_index =  RNA_property_array_item_index ( prop ,  * token ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if ( token  ! =  fixedbuf )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														MEM_freeN ( token ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2010-12-13 02:33:14 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													/* out of range */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if ( temp_index  <  0  | |  temp_index  > =  len [ i ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													index_arr [ i ] =  temp_index ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													/* end multi index resolve */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												/* arrays always contain numbers so further values are not valid */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if ( * path )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													return  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												else  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-12-13 02:33:14 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													int  totdim =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													int  flat_index =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													for ( i = dim - 1 ;  i > = 0 ;  i - - )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														flat_index  + =  index_arr [ i ]  *  totdim ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														totdim  * =  len [ i ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-12-01 09:12:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-12-13 02:33:14 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													* index =  flat_index ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-26 11:13:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									* r_ptr =  curptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									* r_prop =  prop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 20:46:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-31 02:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								char  * RNA_path_append ( const  char  * path ,  PointerRNA  * UNUSED ( ptr ) ,  PropertyRNA  * prop ,  int  intkey ,  const  char  * strkey ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									DynStr  * dynstr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									const  char  * s ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									char  appendstr [ 128 ] ,  * result ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									dynstr =  BLI_dynstr_new ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 18:46:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									/* add .identifier */ 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( path )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BLI_dynstr_append ( dynstr ,  ( char * ) path ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( * path ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											BLI_dynstr_append ( dynstr ,  " . " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_dynstr_append ( dynstr ,  ( char * ) RNA_property_identifier ( prop ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( RNA_property_type ( prop )  = =  PROP_COLLECTION )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* add ["strkey"] or [intkey] */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BLI_dynstr_append ( dynstr ,  " [ " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( strkey )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											BLI_dynstr_append ( dynstr ,  " \" " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											for ( s = strkey ;  * s ;  s + + )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if ( * s  = =  ' [ ' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													appendstr [ 0 ] =  ' \\ ' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													appendstr [ 1 ] =  * s ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													appendstr [ 2 ] =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													appendstr [ 0 ] =  * s ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													appendstr [ 1 ] =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												BLI_dynstr_append ( dynstr ,  appendstr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											BLI_dynstr_append ( dynstr ,  " \" " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  { 
							 
						 
					
						
							
								
									
										
										
										
											2011-02-12 16:54:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											BLI_snprintf ( appendstr ,  sizeof ( appendstr ) ,  " %d " ,  intkey ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-07 02:58:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											BLI_dynstr_append ( dynstr ,  appendstr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BLI_dynstr_append ( dynstr ,  " ] " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									result =  BLI_dynstr_get_cstring ( dynstr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BLI_dynstr_free ( dynstr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  result ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								char  * RNA_path_back ( const  char  * path ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									char  fixedbuf [ 256 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									const  char  * previous ,  * current ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									char  * result ,  * token ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( ! path ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									previous =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									current =  path ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* parse token by token until the end, then we back up to the previous
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 *  position  and  strip  of  the  next  token  to  get  the  path  one  step  back  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									while ( * current )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										token =  rna_path_token ( & current ,  fixedbuf ,  sizeof ( fixedbuf ) ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( ! token ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( token  ! =  fixedbuf ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											MEM_freeN ( token ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* in case of collection we also need to strip off [] */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										token =  rna_path_token ( & current ,  fixedbuf ,  sizeof ( fixedbuf ) ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( token  & &  token  ! =  fixedbuf ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											MEM_freeN ( token ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( ! * current ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										previous =  current ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( ! previous ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* copy and strip off last token */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									i =  previous  -  path ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									result =  BLI_strdup ( path ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( i  >  0  & &  result [ i - 1 ]  = =  ' . ' )  i - - ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									result [ i ] =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  result ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-12-21 11:40:12 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* generic path search func
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  if  its  needed  this  could  also  reference  the  IDProperty  direct  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								typedef  struct  IDP_Chain  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									struct  IDP_Chain  * up ;  /* parent member, reverse and set to child for path conversion. */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									const  char  * name ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  index ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}  IDP_Chain ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  char  * rna_idp_path_create ( IDP_Chain  * child_link ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									DynStr  * dynstr =  BLI_dynstr_new ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									char  * path ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									short  first =  TRUE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  tot =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDP_Chain  * link =  child_link ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* reverse the list */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDP_Chain  * link_prev ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									link_prev =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									while ( link )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										IDP_Chain  * link_next =  link - > up ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										link - > up =  link_prev ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										link_prev =  link ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										link =  link_next ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tot + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for ( link =  link_prev ;  link ;  link =  link - > up )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* pass */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( link - > index  > =  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											BLI_dynstr_appendf ( dynstr ,  first  ?  " %s[%d] "  :  " .%s[%d] " ,  link - > name ,  link - > index ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											BLI_dynstr_appendf ( dynstr ,  first  ?  " %s "  :  " .%s " ,  link - > name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										first =  FALSE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									path =  BLI_dynstr_get_cstring ( dynstr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BLI_dynstr_free ( dynstr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( * path = = ' \0 ' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										MEM_freeN ( path ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										path =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  path ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  char  * rna_idp_path ( PointerRNA  * ptr ,  IDProperty  * haystack ,  IDProperty  * needle ,  IDP_Chain  * parent_link ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									char  * path =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDP_Chain  link ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * iter ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-01-09 15:12:08 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( haystack - > type  = =  IDP_GROUP ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-12-21 11:40:12 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									link . up =  parent_link ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									link . name =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									link . index =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for  ( i = 0 ,  iter =  haystack - > data . group . first ;  iter ;  iter =  iter - > next ,  i + + )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( needle  = =  iter )  {   /* found! */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											link . name =  iter - > name ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											path =  rna_idp_path_create ( & link ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( iter - > type  = =  IDP_GROUP )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												/* ensure this is RNA */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												PointerRNA  child_ptr =  RNA_pointer_get ( ptr ,  iter - > name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if ( child_ptr . type )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													link . name =  iter - > name ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if ( ( path =  rna_idp_path ( & child_ptr ,  iter ,  needle ,  & link ) ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else  if  ( iter - > type  = =  IDP_IDPARRAY )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  iter - > name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if ( prop  & &  prop - > type  = =  PROP_COLLECTION )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													IDProperty  * array =  IDP_IDPArray ( iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if ( needle  > =  array  & &  needle  <  ( iter - > len  +  array ) )  {  /* found! */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														link . name =  iter - > name ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														link . index =  ( int ) ( needle  -  array ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														path =  rna_idp_path_create ( & link ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														int  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														link . name =  iter - > name ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														for ( i =  0 ;  i  <  iter - > len ;  i + + ,  array + + )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															PointerRNA  child_ptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															if ( RNA_property_collection_lookup_int ( ptr ,  prop ,  i ,  & child_ptr ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																link . index =  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																if ( ( path =  rna_idp_path ( & child_ptr ,  array ,  needle ,  & link ) ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																	break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
																} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  path ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  char  * rna_path_from_ID_to_idpgroup ( PointerRNA  * ptr ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PointerRNA  id_ptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * haystack ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									IDProperty  * needle ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-01-09 15:12:08 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BLI_assert ( ptr - > id . data  ! =  NULL ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-02-01 23:53:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* TODO, Support Bones/PoseBones. no pointers stored to the bones from here, only the ID. See example in [#25746]
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 *  unless  this  is  added  only  way  to  find  this  is  to  also  search  all  bones  and  pose  bones  of  an  armature  or  object  */ 
							 
						 
					
						
							
								
									
										
										
										
											2010-12-21 11:40:12 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									RNA_id_pointer_create ( ptr - > id . data ,  & id_ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									haystack =  RNA_struct_idprops ( & id_ptr ,  FALSE ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-02-01 23:53:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( haystack )  {  /* can fail when called on bones */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										needle =  ptr - > data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  rna_idp_path ( & id_ptr ,  haystack ,  needle ,  NULL ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2010-12-21 11:40:12 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-17 10:14:56 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								char  * RNA_path_from_ID_to_struct ( PointerRNA  * ptr ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-25 20:29:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-17 10:14:56 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									char  * ptrpath = NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-25 20:29:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-17 10:14:56 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ! ptr - > id . data  | |  ! ptr - > data ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-25 20:29:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ! RNA_struct_is_ID ( ptr - > type ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-11 05:18:49 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( ptr - > type - > path )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											/* if type has a path to some ID, use it */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											ptrpath =  ptr - > type - > path ( ptr ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-11 02:26:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-27 21:58:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										else  if ( ptr - > type - > nested  & &  RNA_struct_is_ID ( ptr - > type - > nested ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-11 05:18:49 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											PointerRNA  parentptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											PropertyRNA  * userprop ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											/* find the property in the struct we're nested in that references this struct, and 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											 *  use  its  identifier  as  the  first  part  of  the  path  used . . . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											 */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-27 21:58:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											RNA_id_pointer_create ( ptr - > id . data ,  & parentptr ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-11 05:18:49 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											userprop =  RNA_struct_find_nested ( & parentptr ,  ptr - > type ) ;  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( userprop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												ptrpath =  BLI_strdup ( RNA_property_identifier ( userprop ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-11 02:26:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											else 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-11 05:18:49 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												return  NULL ;  // can't do anything about this case yet...
 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-11 02:26:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2011-02-16 02:51:56 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										else  if  ( RNA_struct_is_a ( ptr - > type ,  & RNA_PropertyGroup ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-12-21 11:40:12 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											/* special case, easier to deal with here then in ptr->type->path() */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  rna_path_from_ID_to_idpgroup ( ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-11 05:18:49 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-25 20:29:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-17 10:14:56 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  ptrpath ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								char  * RNA_path_from_ID_to_property ( PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 20:46:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  is_rna  =  ( prop - > magic  = =  RNA_MAGIC ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-17 10:14:56 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									const  char  * propname ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									char  * ptrpath ,  * path ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( ! ptr - > id . data  | |  ! ptr - > data  | |  ! prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* path from ID to the struct holding this property */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ptrpath =  RNA_path_from_ID_to_struct ( ptr ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-25 20:29:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									propname =  RNA_property_identifier ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-25 20:29:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( ptrpath )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 20:46:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										path =  BLI_sprintfN ( is_rna  ?  " %s.%s " : " %s[ \" %s \" ] " ,  ptrpath ,  propname ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 13:14:49 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										MEM_freeN ( ptrpath ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-25 20:29:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-17 20:46:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( is_rna ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											path =  BLI_strdup ( propname ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											path =  BLI_sprintfN ( " [ \" %s \" ] " ,  propname ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-03-25 20:29:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  path ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* Quick name based property access */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int  RNA_boolean_get ( PointerRNA  * ptr ,  const  char  * name ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  RNA_property_boolean_get ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_boolean_get: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_boolean_set ( PointerRNA  * ptr ,  const  char  * name ,  int  value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										RNA_property_boolean_set ( ptr ,  prop ,  value ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_boolean_set: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_boolean_get_array ( PointerRNA  * ptr ,  const  char  * name ,  int  * values ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_boolean_get_array ( ptr ,  prop ,  values ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_boolean_get_array: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_boolean_set_array ( PointerRNA  * ptr ,  const  char  * name ,  const  int  * values ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_boolean_set_array ( ptr ,  prop ,  values ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_boolean_set_array: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int  RNA_int_get ( PointerRNA  * ptr ,  const  char  * name ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  RNA_property_int_get ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_int_get: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_int_set ( PointerRNA  * ptr ,  const  char  * name ,  int  value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										RNA_property_int_set ( ptr ,  prop ,  value ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_int_set: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_int_get_array ( PointerRNA  * ptr ,  const  char  * name ,  int  * values ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_int_get_array ( ptr ,  prop ,  values ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_int_get_array: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_int_set_array ( PointerRNA  * ptr ,  const  char  * name ,  const  int  * values ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_int_set_array ( ptr ,  prop ,  values ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_int_set_array: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								float  RNA_float_get ( PointerRNA  * ptr ,  const  char  * name ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  RNA_property_float_get ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_float_get: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_float_set ( PointerRNA  * ptr ,  const  char  * name ,  float  value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										RNA_property_float_set ( ptr ,  prop ,  value ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_float_set: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_float_get_array ( PointerRNA  * ptr ,  const  char  * name ,  float  * values ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_float_get_array ( ptr ,  prop ,  values ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_float_get_array: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_float_set_array ( PointerRNA  * ptr ,  const  char  * name ,  const  float  * values ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_float_set_array ( ptr ,  prop ,  values ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_float_set_array: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int  RNA_enum_get ( PointerRNA  * ptr ,  const  char  * name ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  RNA_property_enum_get ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_enum_get: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_enum_set ( PointerRNA  * ptr ,  const  char  * name ,  int  value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										RNA_property_enum_set ( ptr ,  prop ,  value ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_enum_set: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-02-25 15:41:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_enum_set_identifier ( PointerRNA  * ptr ,  const  char  * name ,  const  char  * id ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( RNA_property_enum_value ( NULL ,  ptr ,  prop ,  id ,  & value ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											RNA_property_enum_set ( ptr ,  prop ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											printf ( " RNA_enum_set_identifier: %s.%s has no enum id '%s'. \n " ,  ptr - > type - > identifier ,  name ,  id ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									}  else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_enum_set_identifier: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA
* Enums can now be dynamically created in the _itemf callback,
  using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
  for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
  for operators. This doesn't fit design well at all, needed to do
  some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
  _itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
  (unselected, deselect), to make them consistent with other ops.
											 
										 
										
											2009-07-10 19:56:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_enum_is_equal ( bContext  * C ,  PointerRNA  * ptr ,  const  char  * name ,  const  char  * enumname ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-24 10:50:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA
* Enums can now be dynamically created in the _itemf callback,
  using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
  for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
  for operators. This doesn't fit design well at all, needed to do
  some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
  _itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
  (unselected, deselect), to make them consistent with other ops.
											 
										 
										
											2009-07-10 19:56:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									EnumPropertyItem  * item ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  free ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-24 10:50:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop )  { 
							 
						 
					
						
							
								
									
										
										
											
												RNA
* Enums can now be dynamically created in the _itemf callback,
  using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
  for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
  for operators. This doesn't fit design well at all, needed to do
  some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
  _itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
  (unselected, deselect), to make them consistent with other ops.
											 
										 
										
											2009-07-10 19:56:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										RNA_property_enum_items ( C ,  ptr ,  prop ,  & item ,  NULL ,  & free ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-24 10:50:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-23 12:36:15 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										for ( ;  item - > identifier ;  item + + ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( strcmp ( item - > identifier ,  enumname )  = =  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  ( item - > value  = =  RNA_property_enum_get ( ptr ,  prop ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-24 10:50:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA
* Enums can now be dynamically created in the _itemf callback,
  using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
  for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
  for operators. This doesn't fit design well at all, needed to do
  some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
  _itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
  (unselected, deselect), to make them consistent with other ops.
											 
										 
										
											2009-07-10 19:56:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( free ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											MEM_freeN ( item ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-12-24 10:50:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										printf ( " RNA_enum_is_equal: %s.%s item %s not found. \n " ,  ptr - > type - > identifier ,  name ,  enumname ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_enum_is_equal: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA
* Enums can now be dynamically created in the _itemf callback,
  using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
  for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
  for operators. This doesn't fit design well at all, needed to do
  some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
  _itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
  (unselected, deselect), to make them consistent with other ops.
											 
										 
										
											2009-07-10 19:56:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_enum_value_from_id ( EnumPropertyItem  * item ,  const  char  * identifier ,  int  * value ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-01 12:43:07 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for (  ;  item - > identifier ;  item + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( strcmp ( item - > identifier ,  identifier ) = = 0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-01 12:43:07 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											* value =  item - > value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA
* Enums can now be dynamically created in the _itemf callback,
  using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
  for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
  for operators. This doesn't fit design well at all, needed to do
  some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
  _itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
  (unselected, deselect), to make them consistent with other ops.
											 
										 
										
											2009-07-10 19:56:13 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int 	RNA_enum_id_from_value ( EnumPropertyItem  * item ,  int  value ,  const  char  * * identifier ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-01 12:43:07 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for (  ;  item - > identifier ;  item + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( item - > value = = value )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-01 12:43:07 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											* identifier =  item - > identifier ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-07-26 02:35:43 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_enum_icon_from_value ( EnumPropertyItem  * item ,  int  value ,  int  * icon ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for (  ;  item - > identifier ;  item + + )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( item - > value = = value )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											* icon  =  item - > icon ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_string_get ( PointerRNA  * ptr ,  const  char  * name ,  char  * value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-08-05 06:09:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( prop )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										RNA_property_string_get ( ptr ,  prop ,  value ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-05 06:09:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										printf ( " RNA_string_get: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-05 06:09:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										value [ 0 ] =  ' \0 ' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								char  * RNA_string_get_alloc ( PointerRNA  * ptr ,  const  char  * name ,  char  * fixedbuf ,  int  fixedlen ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  RNA_property_string_get_alloc ( ptr ,  prop ,  fixedbuf ,  fixedlen ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_string_get_alloc: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-03 17:58:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  NULL ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int  RNA_string_length ( PointerRNA  * ptr ,  const  char  * name ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  RNA_property_string_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_string_length: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_string_set ( PointerRNA  * ptr ,  const  char  * name ,  const  char  * value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-24 15:51:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										RNA_property_string_set ( ptr ,  prop ,  value ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_string_set: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PointerRNA  RNA_pointer_get ( PointerRNA  * ptr ,  const  char  * name ) 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( prop )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  RNA_property_pointer_get ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										printf ( " RNA_pointer_get: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-11-23 08:44:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  PointerRNA_NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-07-25 19:10:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_pointer_set ( PointerRNA  * ptr ,  const  char  * name ,  PointerRNA  ptr_value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_pointer_set ( ptr ,  prop ,  ptr_value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_pointer_set: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_pointer_add ( PointerRNA  * ptr ,  const  char  * name ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_pointer_add ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_pointer_set: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_collection_begin ( PointerRNA  * ptr ,  const  char  * name ,  CollectionPropertyIterator  * iter ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_collection_begin ( ptr ,  prop ,  iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_collection_begin: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_collection_add ( PointerRNA  * ptr ,  const  char  * name ,  PointerRNA  * r_value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_collection_add ( ptr ,  prop ,  r_value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_collection_add: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_collection_clear ( PointerRNA  * ptr ,  const  char  * name ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_collection_clear ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_collection_clear: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int  RNA_collection_length ( PointerRNA  * ptr ,  const  char  * name ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  RNA_property_collection_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " RNA_collection_length: %s.%s not found. \n " ,  ptr - > type - > identifier ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_is_set ( PointerRNA  * ptr ,  const  char  * name ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * prop =  RNA_struct_find_property ( ptr ,  name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( prop )  { 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
  or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
  to .py files as well to make creating distributable configurations
  easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
  keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
  added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
											 
										 
										
											2009-10-08 18:40:03 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( prop - > flag  &  PROP_IDPROPERTY ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  ( rna_idproperty_find ( ptr ,  name )  ! =  NULL ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-13 06:30:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* python raises an error */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* printf("RNA_property_is_set: %s.%s not found.\n", ptr->type->identifier, name); */ 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).
* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.
* Added quick functions to get/set properties based on names, to be
  used for operators.
* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .
* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
											 
										 
										
											2008-11-21 02:23:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-18 14:00:23 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_is_idprop ( PropertyRNA  * prop ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  ( prop - > magic ! = RNA_MAGIC ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* string representation of a property, python
 
							 
						 
					
						
							
								
									
										
										
										
											2011-05-18 09:07:15 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								 *  compatible  but  can  be  used  for  display  too , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  context  may  be  NULL  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								char  * RNA_pointer_as_string ( bContext  * C ,  PointerRNA  * ptr ) 
							 
						 
					
						
							
								
									
										
										
											
												PyRNA
- Support for python to convert a PyObject into a collection (uses a list of dicts - quite verbose :/)
- Operators can now take collection args when called from python.
- Support for printing operators that use collections (macro recording).
- Added RNA_pointer_as_string which prints all pointer prop values as a python dict.
Example that can run in the in test.py (F7 key)
bpy.ops.VIEW3D_OT_select_lasso(path=[{"loc":(0, 0), "time":0}, {"loc":(1000, 0), "time":0}, {"loc":(1000, 1000), "time":0}], type='SELECT')
for some reason lasso locations always print as 0,0. Need to look into why this is.
											 
										 
										
											2009-06-05 12:48:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									DynStr  * dynstr =  BLI_dynstr_new ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									char  * cstring ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									const  char  * propname ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  first_time  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BLI_dynstr_append ( dynstr ,  " { " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-06-24 21:27:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									RNA_STRUCT_BEGIN ( ptr ,  prop )  { 
							 
						 
					
						
							
								
									
										
										
											
												PyRNA
- Support for python to convert a PyObject into a collection (uses a list of dicts - quite verbose :/)
- Operators can now take collection args when called from python.
- Support for printing operators that use collections (macro recording).
- Added RNA_pointer_as_string which prints all pointer prop values as a python dict.
Example that can run in the in test.py (F7 key)
bpy.ops.VIEW3D_OT_select_lasso(path=[{"loc":(0, 0), "time":0}, {"loc":(1000, 0), "time":0}, {"loc":(1000, 1000), "time":0}], type='SELECT')
for some reason lasso locations always print as 0,0. Need to look into why this is.
											 
										 
										
											2009-06-05 12:48:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										propname  =  RNA_property_identifier ( prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( strcmp ( propname ,  " rna_type " ) = = 0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											continue ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( first_time = = 0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											BLI_dynstr_append ( dynstr ,  " ,  " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										first_time =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2011-05-18 09:07:15 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										cstring  =  RNA_property_as_string ( C ,  ptr ,  prop ) ; 
							 
						 
					
						
							
								
									
										
										
											
												PyRNA
- Support for python to convert a PyObject into a collection (uses a list of dicts - quite verbose :/)
- Operators can now take collection args when called from python.
- Support for printing operators that use collections (macro recording).
- Added RNA_pointer_as_string which prints all pointer prop values as a python dict.
Example that can run in the in test.py (F7 key)
bpy.ops.VIEW3D_OT_select_lasso(path=[{"loc":(0, 0), "time":0}, {"loc":(1000, 0), "time":0}, {"loc":(1000, 1000), "time":0}], type='SELECT')
for some reason lasso locations always print as 0,0. Need to look into why this is.
											 
										 
										
											2009-06-05 12:48:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										BLI_dynstr_appendf ( dynstr ,  " \" %s \" :%s " ,  propname ,  cstring ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										MEM_freeN ( cstring ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-24 21:27:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									RNA_STRUCT_END ; 
							 
						 
					
						
							
								
									
										
										
											
												PyRNA
- Support for python to convert a PyObject into a collection (uses a list of dicts - quite verbose :/)
- Operators can now take collection args when called from python.
- Support for printing operators that use collections (macro recording).
- Added RNA_pointer_as_string which prints all pointer prop values as a python dict.
Example that can run in the in test.py (F7 key)
bpy.ops.VIEW3D_OT_select_lasso(path=[{"loc":(0, 0), "time":0}, {"loc":(1000, 0), "time":0}, {"loc":(1000, 1000), "time":0}], type='SELECT')
for some reason lasso locations always print as 0,0. Need to look into why this is.
											 
										 
										
											2009-06-05 12:48:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BLI_dynstr_append ( dynstr ,  " } " ) ; 	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									cstring  =  BLI_dynstr_get_cstring ( dynstr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BLI_dynstr_free ( dynstr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  cstring ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-08-16 14:43:08 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								char  * RNA_property_as_string ( bContext  * C ,  PointerRNA  * ptr ,  PropertyRNA  * prop ) 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 03:56:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  type  =  RNA_property_type ( prop ) ; 
							 
						 
					
						
							
								
									
										
										
											
												Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
  Mesh.add_vertices([(x, y, z), (x, y, z), ...])
  Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
											 
										 
										
											2009-08-25 17:06:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  len  =  RNA_property_array_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 03:56:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									DynStr  * dynstr =  BLI_dynstr_new ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									char  * cstring ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* see if we can coorce into a python type - PropertyType */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									switch  ( type )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  PROP_BOOLEAN : 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( len = = 0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 03:56:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											BLI_dynstr_append ( dynstr ,  RNA_property_boolean_get ( ptr ,  prop )  ?  " True "  :  " False " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											BLI_dynstr_append ( dynstr ,  " ( " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											for ( i = 0 ;  i < len ;  i + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												BLI_dynstr_appendf ( dynstr ,  i ? " , %s " : " %s " ,  RNA_property_boolean_get_index ( ptr ,  prop ,  i )  ?  " True "  :  " False " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 03:56:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-19 00:49:44 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if ( len = = 1 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												BLI_dynstr_append ( dynstr ,  " , " ) ;  /* otherwise python wont see it as a tuple */ 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 03:56:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											BLI_dynstr_append ( dynstr ,  " ) " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  PROP_INT : 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( len = = 0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 03:56:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											BLI_dynstr_appendf ( dynstr ,  " %d " ,  RNA_property_int_get ( ptr ,  prop ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											BLI_dynstr_append ( dynstr ,  " ( " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											for ( i = 0 ;  i < len ;  i + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												BLI_dynstr_appendf ( dynstr ,  i ? " , %d " : " %d " ,  RNA_property_int_get_index ( ptr ,  prop ,  i ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 03:56:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-19 00:49:44 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if ( len = = 1 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												BLI_dynstr_append ( dynstr ,  " , " ) ;  /* otherwise python wont see it as a tuple */ 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 03:56:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											BLI_dynstr_append ( dynstr ,  " ) " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  PROP_FLOAT : 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( len = = 0 )  { 
							 
						 
					
						
							
								
									
										
										
											
												Made modal operators print their operator string after executing
(when in debug "-d" mode only)
copy & paste duplicate and transform operations can now be copied from user input and pasted into ./test.py and run with the Pkey (fixed some minor bugs preventing this)
Would be nice if the "mode" setting used a proper RNA Enum rather then an int. 
# example, duplicate and transform
bpyoperator.OBJECT_OT_add_duplicate(mode=1)
bpyoperator.TFM_OT_transform(mode=1, options=0, values=(-1.23989, 0.570745, 0, 0), constraint_orientation=0, constraint_mode=0, constraint_matrix=(0, 0, 0, 0, 0, 0, 0, 0, 0))
											 
										 
										
											2009-01-18 07:35:44 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											BLI_dynstr_appendf ( dynstr ,  " %g " ,  RNA_property_float_get ( ptr ,  prop ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 03:56:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											BLI_dynstr_append ( dynstr ,  " ( " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											for ( i = 0 ;  i < len ;  i + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-02 19:57:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												BLI_dynstr_appendf ( dynstr ,  i ? " , %g " : " %g " ,  RNA_property_float_get_index ( ptr ,  prop ,  i ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 03:56:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-19 00:49:44 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if ( len = = 1 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												BLI_dynstr_append ( dynstr ,  " , " ) ;  /* otherwise python wont see it as a tuple */ 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 03:56:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											BLI_dynstr_append ( dynstr ,  " ) " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  PROP_STRING : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{ 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-28 09:28:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										char  * buf_esc ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 03:56:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										char  * buf ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-28 09:28:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										int  length ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										length =  RNA_property_string_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										buf =  MEM_mallocN ( sizeof ( char ) * ( length + 1 ) ,  " RNA_property_as_string " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										buf_esc =  MEM_mallocN ( sizeof ( char ) * ( length * 2 + 1 ) ,  " RNA_property_as_string esc " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_string_get ( ptr ,  prop ,  buf ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-09-06 07:08:20 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										BLI_strescape ( buf_esc ,  buf ,  length * 2 + 1 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 03:56:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										MEM_freeN ( buf ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-28 09:28:41 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										BLI_dynstr_appendf ( dynstr ,  " \" %s \" " ,  buf_esc ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										MEM_freeN ( buf_esc ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 03:56:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  PROP_ENUM : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* string arrays dont exist */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										const  char  * identifier ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  val  =  RNA_property_enum_get ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-12-13 09:10:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( RNA_property_flag ( prop )  &  PROP_ENUM_FLAG )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											/* represent as a python set */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											EnumPropertyItem  * item =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											int  free ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											BLI_dynstr_append ( dynstr ,  " { " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											RNA_property_enum_items ( C ,  ptr ,  prop ,  & item ,  NULL ,  & free ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( item )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												short  is_first =  TRUE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												for  ( ;  item - > identifier ;  item + + )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if ( item - > identifier [ 0 ]  & &  item - > value  &  val )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														BLI_dynstr_appendf ( dynstr ,  is_first  ?  " '%s' "  :  " , '%s' " ,  item - > identifier ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														is_first =  FALSE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if ( free )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													MEM_freeN ( item ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											BLI_dynstr_append ( dynstr ,  " } " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  if ( RNA_property_enum_identifier ( C ,  ptr ,  prop ,  val ,  & identifier ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 03:56:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											BLI_dynstr_appendf ( dynstr ,  " '%s' " ,  identifier ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-12-04 11:44:56 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											BLI_dynstr_append ( dynstr ,  " '<UNKNOWN ENUM>' " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 03:56:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  PROP_POINTER : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{ 
							 
						 
					
						
							
								
									
										
										
										
											2010-11-09 05:58:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										PointerRNA  tptr =  RNA_property_pointer_get ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-05-18 09:07:15 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										cstring =  RNA_pointer_as_string ( C ,  & tptr ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-11-09 05:58:30 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										BLI_dynstr_append ( dynstr ,  cstring ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										MEM_freeN ( cstring ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 03:56:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  PROP_COLLECTION : 
							 
						 
					
						
							
								
									
										
										
											
												PyRNA
- Support for python to convert a PyObject into a collection (uses a list of dicts - quite verbose :/)
- Operators can now take collection args when called from python.
- Support for printing operators that use collections (macro recording).
- Added RNA_pointer_as_string which prints all pointer prop values as a python dict.
Example that can run in the in test.py (F7 key)
bpy.ops.VIEW3D_OT_select_lasso(path=[{"loc":(0, 0), "time":0}, {"loc":(1000, 0), "time":0}, {"loc":(1000, 1000), "time":0}], type='SELECT')
for some reason lasso locations always print as 0,0. Need to look into why this is.
											 
										 
										
											2009-06-05 12:48:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  first_time  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										CollectionPropertyIterator  collect_iter ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BLI_dynstr_append ( dynstr ,  " [ " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										for ( RNA_property_collection_begin ( ptr ,  prop ,  & collect_iter ) ;  collect_iter . valid ;  RNA_property_collection_next ( & collect_iter ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											PointerRNA  itemptr =  collect_iter . ptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( first_time = = 0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												BLI_dynstr_append ( dynstr ,  " ,  " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											first_time =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											/* now get every prop of the collection */ 
							 
						 
					
						
							
								
									
										
										
										
											2011-05-18 09:07:15 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											cstring =  RNA_pointer_as_string ( C ,  & itemptr ) ; 
							 
						 
					
						
							
								
									
										
										
											
												PyRNA
- Support for python to convert a PyObject into a collection (uses a list of dicts - quite verbose :/)
- Operators can now take collection args when called from python.
- Support for printing operators that use collections (macro recording).
- Added RNA_pointer_as_string which prints all pointer prop values as a python dict.
Example that can run in the in test.py (F7 key)
bpy.ops.VIEW3D_OT_select_lasso(path=[{"loc":(0, 0), "time":0}, {"loc":(1000, 0), "time":0}, {"loc":(1000, 1000), "time":0}], type='SELECT')
for some reason lasso locations always print as 0,0. Need to look into why this is.
											 
										 
										
											2009-06-05 12:48:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											BLI_dynstr_append ( dynstr ,  cstring ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											MEM_freeN ( cstring ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_property_collection_end ( & collect_iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BLI_dynstr_append ( dynstr ,  " ] " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 03:56:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
									
										
										
											
												PyRNA
- Support for python to convert a PyObject into a collection (uses a list of dicts - quite verbose :/)
- Operators can now take collection args when called from python.
- Support for printing operators that use collections (macro recording).
- Added RNA_pointer_as_string which prints all pointer prop values as a python dict.
Example that can run in the in test.py (F7 key)
bpy.ops.VIEW3D_OT_select_lasso(path=[{"loc":(0, 0), "time":0}, {"loc":(1000, 0), "time":0}, {"loc":(1000, 1000), "time":0}], type='SELECT')
for some reason lasso locations always print as 0,0. Need to look into why this is.
											 
										 
										
											2009-06-05 12:48:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-26 03:56:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BLI_dynstr_append ( dynstr ,  " '<UNKNOWN TYPE>' " ) ;  /* TODO */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									cstring  =  BLI_dynstr_get_cstring ( dynstr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BLI_dynstr_free ( dynstr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  cstring ; 
							 
						 
					
						
							
								
									
										
										
											
												RNA:
* Added support for using pointers + collections as operator properties,
  but with the restriction that they must point to other type derived from
  ID property groups. The "add" function for these properties will allocate
  a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
	float loc[2];
	RNA_float_get_array(&itemptr, "loc", loc);
	printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
											 
										 
										
											2008-12-26 20:38:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2008-12-31 13:16:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* Function */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const  char  * RNA_function_identifier ( FunctionRNA  * func ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  func - > identifier ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const  char  * RNA_function_ui_description ( FunctionRNA  * func ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  func - > description ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_function_flag ( FunctionRNA  * func ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  func - > flag ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-28 22:48:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_function_defined ( FunctionRNA  * func ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  func - > call  ! =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-31 02:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PropertyRNA  * RNA_function_get_parameter ( PointerRNA  * UNUSED ( ptr ) ,  FunctionRNA  * func ,  int  index ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-13 06:30:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  BLI_findlink ( & func - > cont . properties ,  index ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-31 02:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								PropertyRNA  * RNA_function_find_parameter ( PointerRNA  * UNUSED ( ptr ) ,  FunctionRNA  * func ,  const  char  * identifier ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-13 06:30:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  BLI_findstring ( & func - > cont . properties ,  identifier ,  offsetof ( PropertyRNA ,  identifier ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								const  struct  ListBase  * RNA_function_defined_parameters ( FunctionRNA  * func ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  & func - > cont . properties ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* Utility */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-31 02:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								ParameterList  * RNA_parameter_list_create ( ParameterList  * parms ,  PointerRNA  * UNUSED ( ptr ) ,  FunctionRNA  * func ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * parm ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-08-18 12:56:43 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									void  * data ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-03-23 15:04:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  alloc_size =  0 ,  size ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-13 06:30:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									parms - > arg_count =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									parms - > ret_count =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-08-18 12:56:43 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									/* allocate data */ 
							 
						 
					
						
							
								
									
										
										
										
											2010-03-23 15:04:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									for ( parm =  func - > cont . properties . first ;  parm ;  parm =  parm - > next )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										alloc_size  + =  rna_parameter_size_alloc ( parm ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-13 06:30:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( parm - > flag  &  PROP_OUTPUT ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											parms - > ret_count + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											parms - > arg_count + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-03-23 15:04:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									parms - > data =  MEM_callocN ( alloc_size ,  " RNA_parameter_list_create " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									parms - > func =  func ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-03-23 15:04:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									parms - > alloc_size =  alloc_size ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-08-18 12:56:43 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									/* set default values */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									data =  parms - > data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for ( parm =  func - > cont . properties . first ;  parm ;  parm =  parm - > next )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										size =  rna_parameter_size ( parm ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-08-31 11:31:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* set length to 0, these need to be set later, see bpy_array.c's py_to_array */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( parm - > flag  &  PROP_DYNAMIC )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											ParameterDynAlloc  * data_alloc =  data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											data_alloc - > array_tot =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											data_alloc - > array =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( ! ( parm - > flag  &  PROP_REQUIRED )  & &  ! ( parm - > flag  &  PROP_DYNAMIC ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-08-18 12:56:43 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											switch ( parm - > type )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												case  PROP_BOOLEAN : 
							 
						 
					
						
							
								
									
										
										
										
											2011-07-26 16:01:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if ( parm - > arraydimension )  memcpy ( data ,  ( ( BooleanPropertyRNA * ) parm ) - > defaultarray ,  size ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-08-18 12:56:43 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													else  memcpy ( data ,  & ( ( BooleanPropertyRNA * ) parm ) - > defaultvalue ,  size ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												case  PROP_INT : 
							 
						 
					
						
							
								
									
										
										
										
											2011-07-26 16:01:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if ( parm - > arraydimension )  memcpy ( data ,  ( ( IntPropertyRNA * ) parm ) - > defaultarray ,  size ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-08-18 12:56:43 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													else  memcpy ( data ,  & ( ( IntPropertyRNA * ) parm ) - > defaultvalue ,  size ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												case  PROP_FLOAT : 
							 
						 
					
						
							
								
									
										
										
										
											2011-07-26 16:01:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if ( parm - > arraydimension )  memcpy ( data ,  ( ( FloatPropertyRNA * ) parm ) - > defaultarray ,  size ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-08-18 12:56:43 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													else  memcpy ( data ,  & ( ( FloatPropertyRNA * ) parm ) - > defaultvalue ,  size ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												case  PROP_ENUM : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													memcpy ( data ,  & ( ( EnumPropertyRNA * ) parm ) - > defaultvalue ,  size ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												case  PROP_STRING :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													const  char  * defvalue =  ( ( StringPropertyRNA * ) parm ) - > defaultvalue ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if ( defvalue  & &  defvalue [ 0 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														memcpy ( data ,  & defvalue ,  size ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												case  PROP_POINTER : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												case  PROP_COLLECTION : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-01-24 10:51:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										data =  ( ( char * ) data )  +  rna_parameter_size_alloc ( parm ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-08-18 12:56:43 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  parms ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_parameter_list_free ( ParameterList  * parms ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-27 01:10:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									PropertyRNA  * parm ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  tot ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									parm =  parms - > func - > cont . properties . first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for ( tot =  0 ;  parm ;  parm =  parm - > next )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( parm - > type  = =  PROP_COLLECTION ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											BLI_freelistN ( ( ListBase * ) ( ( char * ) parms - > data + tot ) ) ; 
							 
						 
					
						
							
								
									
										
										
											
												Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
  Mesh.add_vertices([(x, y, z), (x, y, z), ...])
  Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
											 
										 
										
											2009-08-25 17:06:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										else  if  ( parm - > flag  &  PROP_DYNAMIC )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											/* for dynamic arrays and strings, data is a pointer to an array */ 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-31 11:31:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											ParameterDynAlloc  * data_alloc =  ( void  * ) ( ( ( char  * ) parms - > data )  +  tot ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( data_alloc - > array ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												MEM_freeN ( data_alloc - > array ) ; 
							 
						 
					
						
							
								
									
										
										
											
												Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
  Mesh.add_vertices([(x, y, z), (x, y, z), ...])
  Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
											 
										 
										
											2009-08-25 17:06:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-27 01:10:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-01-24 10:51:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										tot + =  rna_parameter_size_alloc ( parm ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-27 01:10:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									MEM_freeN ( parms - > data ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-05 19:43:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									parms - > data =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									parms - > func =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-17 02:31:28 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-07-17 02:31:28 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int   RNA_parameter_list_size ( ParameterList  * parms ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2010-03-23 15:04:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  parms - > alloc_size ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int   RNA_parameter_list_arg_count ( ParameterList  * parms ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  parms - > arg_count ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int   RNA_parameter_list_ret_count ( ParameterList  * parms ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  parms - > ret_count ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_parameter_list_begin ( ParameterList  * parms ,  ParameterIterator  * iter ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2011-08-15 03:41:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									/* may be useful but unused now */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* RNA_pointer_create(NULL, &RNA_Function, parms->func, &iter->funcptr); */  /*UNUSED*/ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									iter - > parms =  parms ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									iter - > parm =  parms - > func - > cont . properties . first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									iter - > valid =  iter - > parm  ! =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									iter - > offset =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( iter - > valid )  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-24 10:51:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										iter - > size =  rna_parameter_size_alloc ( iter - > parm ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2011-01-17 08:31:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										iter - > data =  ( ( ( char * ) iter - > parms - > data ) ) ;  /* +iter->offset, always 0 */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_parameter_list_next ( ParameterIterator  * iter ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									iter - > offset + =  iter - > size ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									iter - > parm =  iter - > parm - > next ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									iter - > valid =  iter - > parm  ! =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( iter - > valid )  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-24 10:51:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										iter - > size =  rna_parameter_size_alloc ( iter - > parm ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										iter - > data =  ( ( ( char * ) iter - > parms - > data ) + iter - > offset ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-31 02:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_parameter_list_end ( ParameterIterator  * UNUSED ( iter ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* nothing to do */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_parameter_get ( ParameterList  * parms ,  PropertyRNA  * parm ,  void  * * value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ParameterIterator  iter ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_parameter_list_begin ( parms ,  & iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for ( ;  iter . valid ;  RNA_parameter_list_next ( & iter ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( iter . parm = = parm )  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( iter . valid ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* value =  iter . data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										* value =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_parameter_list_end ( & iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_parameter_get_lookup ( ParameterList  * parms ,  const  char  * identifier ,  void  * * value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * parm ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									parm =  parms - > func - > cont . properties . first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for ( ;  parm ;  parm =  parm - > next ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( strcmp ( RNA_property_identifier ( parm ) ,  identifier ) = = 0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( parm ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_parameter_get ( parms ,  parm ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-12-19 16:34:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_parameter_set ( ParameterList  * parms ,  PropertyRNA  * parm ,  const  void  * value ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ParameterIterator  iter ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_parameter_list_begin ( parms ,  & iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for ( ;  iter . valid ;  RNA_parameter_list_next ( & iter ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( iter . parm = = parm )  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( iter . valid ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										memcpy ( iter . data ,  value ,  iter . size ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_parameter_list_end ( & iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-12-19 16:34:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_parameter_set_lookup ( ParameterList  * parms ,  const  char  * identifier ,  const  void  * value ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * parm ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									parm =  parms - > func - > cont . properties . first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for ( ;  parm ;  parm =  parm - > next ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( strcmp ( RNA_property_identifier ( parm ) ,  identifier ) = = 0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( parm ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_parameter_set ( parms ,  parm ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2010-01-24 10:51:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_parameter_length_get ( ParameterList  * parms ,  PropertyRNA  * parm ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ParameterIterator  iter ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  len =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_parameter_list_begin ( parms ,  & iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for ( ;  iter . valid ;  RNA_parameter_list_next ( & iter ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( iter . parm = = parm ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( iter . valid ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										len =  RNA_parameter_length_get_data ( parms ,  parm ,  iter . data ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_parameter_list_end ( & iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  len ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  RNA_parameter_length_set ( ParameterList  * parms ,  PropertyRNA  * parm ,  int  length ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ParameterIterator  iter ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_parameter_list_begin ( parms ,  & iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for ( ;  iter . valid ;  RNA_parameter_list_next ( & iter ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( iter . parm = = parm ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( iter . valid ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										RNA_parameter_length_set_data ( parms ,  parm ,  iter . data ,  length ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_parameter_list_end ( & iter ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-31 02:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_parameter_length_get_data ( ParameterList  * UNUSED ( parms ) ,  PropertyRNA  * UNUSED ( parm ) ,  void  * data ) 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-24 10:51:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-31 11:31:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  * ( ( int  * ) ( ( char  * ) data ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-24 10:51:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-05-31 02:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  RNA_parameter_length_set_data ( ParameterList  * UNUSED ( parms ) ,  PropertyRNA  * UNUSED ( parm ) ,  void  * data ,  int  length ) 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-24 10:51:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2010-08-31 11:31:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									* ( ( int  * ) data ) =  length ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-24 10:51:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-18 19:48:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_function_call ( bContext  * C ,  ReportList  * reports ,  PointerRNA  * ptr ,  FunctionRNA  * func ,  ParameterList  * parms ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( func - > call )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-18 19:48:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										func - > call ( C ,  reports ,  ptr ,  parms ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  - 1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-18 19:48:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_function_call_lookup ( bContext  * C ,  ReportList  * reports ,  PointerRNA  * ptr ,  const  char  * identifier ,  ParameterList  * parms ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									FunctionRNA  * func ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									func =  RNA_struct_find_function ( ptr ,  identifier ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( func ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-18 19:48:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  RNA_function_call ( C ,  reports ,  ptr ,  func ,  parms ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  - 1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-18 19:48:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_function_call_direct ( bContext  * C ,  ReportList  * reports ,  PointerRNA  * ptr ,  FunctionRNA  * func ,  const  char  * format ,  . . . ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									va_list  args ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  ret ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									va_start ( args ,  format ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-18 19:48:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ret =  RNA_function_call_direct_va ( C ,  reports ,  ptr ,  func ,  format ,  args ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									va_end ( args ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  ret ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-18 19:48:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_function_call_direct_lookup ( bContext  * C ,  ReportList  * reports ,  PointerRNA  * ptr ,  const  char  * identifier ,  const  char  * format ,  . . . ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									FunctionRNA  * func ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									func =  RNA_struct_find_function ( ptr ,  identifier ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( func )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										va_list  args ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  ret ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										va_start ( args ,  format ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-18 19:48:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										ret =  RNA_function_call_direct_va ( C ,  reports ,  ptr ,  func ,  format ,  args ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										va_end ( args ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  ret ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  - 1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  int  rna_function_format_array_length ( const  char  * format ,  int  ofs ,  int  flen ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									char  lenbuf [ 16 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  idx =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( format [ ofs + + ] = = ' [ ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										for  ( ;  ofs < flen  & &  format [ ofs ] ! = ' ] '  & &  idx < sizeof ( * lenbuf ) - 1 ;  idx + + ,  ofs + + ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											lenbuf [ idx ] =  format [ ofs ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-01-17 08:31:57 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( ofs < flen  & &  format [ ofs + 1 ] = = ' ] ' )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* XXX put better error reporting for ofs>=flen or idx over lenbuf capacity */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										lenbuf [ idx ] =  ' \0 ' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  atoi ( lenbuf ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  int  rna_function_parameter_parse ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  PropertyType  type ,  char  ftype ,  int  len ,  void  * dest ,  void  * src ,  StructRNA  * srna ,  const  char  * tid ,  const  char  * fid ,  const  char  * pid ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* ptr is always a function pointer, prop always a parameter */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									switch  ( type )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  PROP_BOOLEAN : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( ftype ! = ' b ' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												fprintf ( stderr ,  " %s.%s: wrong type for parameter %s, a boolean was expected \n " ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( len = = 0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												* ( ( int * ) dest ) =  * ( ( int * ) src ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												memcpy ( dest ,  src ,  len * sizeof ( int ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  PROP_INT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( ftype ! = ' i ' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												fprintf ( stderr ,  " %s.%s: wrong type for parameter %s, an integer was expected \n " ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( len = = 0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												* ( ( int * ) dest ) =  * ( ( int * ) src ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												memcpy ( dest ,  src ,  len * sizeof ( int ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  PROP_FLOAT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( ftype ! = ' f ' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												fprintf ( stderr ,  " %s.%s: wrong type for parameter %s, a float was expected \n " ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( len = = 0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												* ( ( float * ) dest ) =  * ( ( float * ) src ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												memcpy ( dest ,  src ,  len * sizeof ( float ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  PROP_STRING : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( ftype ! = ' s ' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												fprintf ( stderr ,  " %s.%s: wrong type for parameter %s, a string was expected \n " ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											* ( ( char * * ) dest ) =  * ( ( char * * ) src ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  PROP_ENUM : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( ftype ! = ' e ' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												fprintf ( stderr ,  " %s.%s: wrong type for parameter %s, an enum was expected \n " ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											* ( ( int * ) dest ) =  * ( ( int * ) src ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  PROP_POINTER : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											StructRNA  * ptype ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( ftype ! = ' O ' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												fprintf ( stderr ,  " %s.%s: wrong type for parameter %s, an object was expected \n " ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-07 13:09:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											ptype =  RNA_property_pointer_type ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-16 00:52:21 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if ( prop - > flag  &  PROP_RNAPTR )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												* ( ( PointerRNA * ) dest ) =  * ( ( PointerRNA * ) src ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-01 19:56:50 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												break ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-03-22 09:30:00 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											 } 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-01 19:56:50 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( ptype ! = srna  & &  ! RNA_struct_is_a ( srna ,  ptype ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												fprintf ( stderr ,  " %s.%s: wrong type for parameter %s, an object of type %s was expected, passed an object of type %s \n " ,  tid ,  fid ,  pid ,  RNA_struct_identifier ( ptype ) ,  RNA_struct_identifier ( srna ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  - 1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-01 19:56:50 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											* ( ( void * * ) dest ) =  * ( ( void * * ) src ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  PROP_COLLECTION : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-01 19:56:50 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											StructRNA  * ptype ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											ListBase  * lb ,  * clb ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											Link  * link ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											CollectionPointerLink  * clink ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( ftype ! = ' C ' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												fprintf ( stderr ,  " %s.%s: wrong type for parameter %s, a collection was expected \n " ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											lb =  ( ListBase  * ) src ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											clb =  ( ListBase  * ) dest ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											ptype =  RNA_property_pointer_type ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( ptype ! = srna  & &  ! RNA_struct_is_a ( srna ,  ptype ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												fprintf ( stderr ,  " %s.%s: wrong type for parameter %s, a collection of objects of type %s was expected, passed a collection of objects of type %s \n " ,  tid ,  fid ,  pid ,  RNA_struct_identifier ( ptype ) ,  RNA_struct_identifier ( srna ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											for  ( link =  lb - > first ;  link ;  link =  link - > next )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												clink =  MEM_callocN ( sizeof ( CollectionPointerLink ) ,  " CCollectionPointerLink " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												RNA_pointer_create ( NULL ,  srna ,  link ,  & clink - > ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												BLI_addtail ( clb ,  clink ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									default :  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( len = = 0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												fprintf ( stderr ,  " %s.%s: unknown type for parameter %s \n " ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												fprintf ( stderr ,  " %s.%s: unknown array type for parameter %s \n " ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-18 19:48:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_function_call_direct_va ( bContext  * C ,  ReportList  * reports ,  PointerRNA  * ptr ,  FunctionRNA  * func ,  const  char  * format ,  va_list  args ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PointerRNA  funcptr ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-17 02:31:28 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ParameterList  parms ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ParameterIterator  iter ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PropertyRNA  * pret ,  * parm ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									PropertyType  type ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  i ,  ofs ,  flen ,  flag ,  len ,  alen ,  err =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-11 02:07:40 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									const  char  * tid ,  * fid ,  * pid = NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									char  ftype ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-11 02:07:40 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									void  * * retdata = NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_pointer_create ( NULL ,  & RNA_Function ,  func ,  & funcptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									tid =  RNA_struct_identifier ( ptr - > type ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									fid =  RNA_function_identifier ( func ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-02 10:42:38 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									pret =  func - > c_ret ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									flen =  strlen ( format ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-07-17 02:31:28 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									RNA_parameter_list_create ( & parms ,  ptr ,  func ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_parameter_list_begin ( & parms ,  & iter ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									for ( i =  0 ,  ofs =  0 ;  iter . valid ;  RNA_parameter_list_next ( & iter ) ,  i + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										parm =  iter . parm ; 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-02 10:42:38 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										flag =  RNA_property_flag ( parm ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( parm = = pret )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											retdata =  iter . data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											continue ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-24 10:51:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										else  if  ( flag  &  PROP_OUTPUT )  { 
							 
						 
					
						
							
								
									
										
										
										
											2010-01-02 10:42:38 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											continue ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										pid =  RNA_property_identifier ( parm ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( ofs > = flen  | |  format [ ofs ] = = ' N ' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( flag  &  PROP_REQUIRED )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												err =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												fprintf ( stderr ,  " %s.%s: missing required parameter %s \n " ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											ofs + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											continue ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										type =  RNA_property_type ( parm ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										ftype =  format [ ofs + + ] ; 
							 
						 
					
						
							
								
									
										
										
											
												Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
  Mesh.add_vertices([(x, y, z), (x, y, z), ...])
  Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
											 
										 
										
											2009-08-25 17:06:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										len =  RNA_property_array_length ( & funcptr ,  parm ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										alen =  rna_function_format_array_length ( format ,  ofs ,  flen ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( len ! = alen )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											err =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											fprintf ( stderr ,  " %s.%s: for parameter %s, was expecting an array of %i elements, passed %i elements instead \n " ,  tid ,  fid ,  pid ,  len ,  alen ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										switch  ( type )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_BOOLEAN : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_INT : 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										case  PROP_ENUM : 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												int  arg =  va_arg ( args ,  int ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												err =  rna_function_parameter_parse ( & funcptr ,  parm ,  type ,  ftype ,  len ,  iter . data ,  & arg ,  NULL ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_FLOAT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-16 13:01:50 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												double  arg =  va_arg ( args ,  double ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												err =  rna_function_parameter_parse ( & funcptr ,  parm ,  type ,  ftype ,  len ,  iter . data ,  & arg ,  NULL ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_STRING : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												char  * arg =  va_arg ( args ,  char * ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												err =  rna_function_parameter_parse ( & funcptr ,  parm ,  type ,  ftype ,  len ,  iter . data ,  & arg ,  NULL ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_POINTER : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												StructRNA  * srna =  va_arg ( args ,  StructRNA * ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												void  * arg =  va_arg ( args ,  void * ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												err =  rna_function_parameter_parse ( & funcptr ,  parm ,  type ,  ftype ,  len ,  iter . data ,  & arg ,  srna ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-01 19:56:50 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										case  PROP_COLLECTION : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												StructRNA  * srna =  va_arg ( args ,  StructRNA * ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												ListBase  * arg =  va_arg ( args ,  ListBase * ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												err =  rna_function_parameter_parse ( & funcptr ,  parm ,  type ,  ftype ,  len ,  iter . data ,  & arg ,  srna ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										default : 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												/* handle errors */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												err =  rna_function_parameter_parse ( & funcptr ,  parm ,  type ,  ftype ,  len ,  iter . data ,  NULL ,  NULL ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 13:24:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( err ! = 0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( err = = 0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-17 02:31:28 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										err =  RNA_function_call ( C ,  reports ,  ptr ,  func ,  & parms ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* XXX throw error when more parameters than those needed are passed or leave silent? */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( err = = 0  & &  pret  & &  ofs < flen  & &  format [ ofs + + ] = = ' R ' )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										parm =  pret ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-19 13:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										type =  RNA_property_type ( parm ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										ftype =  format [ ofs + + ] ; 
							 
						 
					
						
							
								
									
										
										
											
												Implemented dynamic and multidimensional array support in RNA.
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
  Mesh.add_vertices([(x, y, z), (x, y, z), ...])
  Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
											 
										 
										
											2009-08-25 17:06:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										len =  RNA_property_array_length ( & funcptr ,  parm ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										alen =  rna_function_format_array_length ( format ,  ofs ,  flen ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( len ! = alen )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											err =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											fprintf ( stderr ,  " %s.%s: for return parameter %s, was expecting an array of %i elements, passed %i elements instead \n " ,  tid ,  fid ,  pid ,  len ,  alen ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											switch  ( type )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											case  PROP_BOOLEAN : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											case  PROP_INT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											case  PROP_ENUM : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													int  * arg =  va_arg ( args ,  int * ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													err =  rna_function_parameter_parse ( & funcptr ,  parm ,  type ,  ftype ,  len ,  arg ,  retdata ,  NULL ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											case  PROP_FLOAT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													float  * arg =  va_arg ( args ,  float * ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													err =  rna_function_parameter_parse ( & funcptr ,  parm ,  type ,  ftype ,  len ,  arg ,  retdata ,  NULL ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											case  PROP_STRING : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													char  * * arg =  va_arg ( args ,  char * * ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													err =  rna_function_parameter_parse ( & funcptr ,  parm ,  type ,  ftype ,  len ,  arg ,  retdata ,  NULL ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											case  PROP_POINTER : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													StructRNA  * srna =  va_arg ( args ,  StructRNA * ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													void  * * arg =  va_arg ( args ,  void * * ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													err =  rna_function_parameter_parse ( & funcptr ,  parm ,  type ,  ftype ,  len ,  arg ,  retdata ,  srna ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-01 19:56:50 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											case  PROP_COLLECTION : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													StructRNA  * srna =  va_arg ( args ,  StructRNA * ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													ListBase  * * arg =  va_arg ( args ,  ListBase * * ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													err =  rna_function_parameter_parse ( & funcptr ,  parm ,  type ,  ftype ,  len ,  arg ,  retdata ,  srna ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 			
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													/* handle errors */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													err =  rna_function_parameter_parse ( & funcptr ,  parm ,  type ,  ftype ,  len ,  NULL ,  NULL ,  NULL ,  tid ,  fid ,  pid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									RNA_parameter_list_end ( & iter ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-17 02:31:28 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									RNA_parameter_list_free ( & parms ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 15:46:35 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 12:44:01 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  err ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-06-18 19:48:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_function_call_direct_va_lookup ( bContext  * C ,  ReportList  * reports ,  PointerRNA  * ptr ,  const  char  * identifier ,  const  char  * format ,  va_list  args ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									FunctionRNA  * func ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									func =  RNA_struct_find_function ( ptr ,  identifier ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( func ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-18 19:48:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  RNA_function_call_direct_va ( C ,  reports ,  ptr ,  func ,  format ,  args ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-07 00:49:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-12-17 17:15:38 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  RNA_property_reset ( PointerRNA  * ptr ,  PropertyRNA  * prop ,  int  index ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  len ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* get the length of the array to work with */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									len =  RNA_property_array_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* get and set the default values as appropriate for the various types */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									switch  ( RNA_property_type ( prop ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_BOOLEAN : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( len )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if  ( index  = =  - 1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													int  * tmparray =  MEM_callocN ( sizeof ( int ) * len ,  " reset_defaults - boolean " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													RNA_property_boolean_get_default_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													RNA_property_boolean_set_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													MEM_freeN ( tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													int  value =  RNA_property_boolean_get_default_index ( ptr ,  prop ,  index ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													RNA_property_boolean_set_index ( ptr ,  prop ,  index ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												int  value =  RNA_property_boolean_get_default ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												RNA_property_boolean_set ( ptr ,  prop ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_INT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( len )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if  ( index  = =  - 1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													int  * tmparray =  MEM_callocN ( sizeof ( int ) * len ,  " reset_defaults - int " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													RNA_property_int_get_default_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													RNA_property_int_set_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													MEM_freeN ( tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													int  value =  RNA_property_int_get_default_index ( ptr ,  prop ,  index ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													RNA_property_int_set_index ( ptr ,  prop ,  index ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												int  value =  RNA_property_int_get_default ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												RNA_property_int_set ( ptr ,  prop ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_FLOAT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( len )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if  ( index  = =  - 1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													float  * tmparray =  MEM_callocN ( sizeof ( float ) * len ,  " reset_defaults - float " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													RNA_property_float_get_default_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													RNA_property_float_set_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													MEM_freeN ( tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													float  value =  RNA_property_float_get_default_index ( ptr ,  prop ,  index ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													RNA_property_float_set_index ( ptr ,  prop ,  index ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												float  value =  RNA_property_float_get_default ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												RNA_property_float_set ( ptr ,  prop ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_ENUM : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											int  value =  RNA_property_enum_get_default ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											RNA_property_enum_set ( ptr ,  prop ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2010-02-08 09:22:17 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										case  PROP_STRING : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											char  * value =  RNA_property_string_get_default_alloc ( ptr ,  prop ,  NULL ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											RNA_property_string_set ( ptr ,  prop ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											MEM_freeN ( value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2011-01-11 22:32:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										case  PROP_POINTER : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											PointerRNA  value =  RNA_property_pointer_get_default ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											RNA_property_pointer_set ( ptr ,  prop ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2009-12-17 17:15:38 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										default :  
							 
						 
					
						
							
								
									
										
										
										
											2011-01-11 22:32:18 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											// FIXME: are there still any cases that haven't been handled? comment out "default" block to check :)
 
							 
						 
					
						
							
								
									
										
										
										
											2009-12-17 17:15:38 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								int  RNA_property_copy ( PointerRNA  * ptr ,  PointerRNA  * fromptr ,  PropertyRNA  * prop ,  int  index ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  len ,  fromlen ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* get the length of the array to work with */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									len =  RNA_property_array_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									fromlen =  RNA_property_array_length ( ptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( len  ! =  fromlen ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* get and set the default values as appropriate for the various types */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									switch  ( RNA_property_type ( prop ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_BOOLEAN : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( len )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if  ( index  = =  - 1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													int  * tmparray =  MEM_callocN ( sizeof ( int ) * len ,  " copy - boolean " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													RNA_property_boolean_get_array ( fromptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													RNA_property_boolean_set_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													MEM_freeN ( tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													int  value =  RNA_property_boolean_get_index ( fromptr ,  prop ,  index ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													RNA_property_boolean_set_index ( ptr ,  prop ,  index ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												int  value =  RNA_property_boolean_get ( fromptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												RNA_property_boolean_set ( ptr ,  prop ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_INT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( len )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if  ( index  = =  - 1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													int  * tmparray =  MEM_callocN ( sizeof ( int ) * len ,  " copy - int " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													RNA_property_int_get_array ( fromptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													RNA_property_int_set_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													MEM_freeN ( tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													int  value =  RNA_property_int_get_index ( fromptr ,  prop ,  index ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													RNA_property_int_set_index ( ptr ,  prop ,  index ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												int  value =  RNA_property_int_get ( fromptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												RNA_property_int_set ( ptr ,  prop ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_FLOAT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( len )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if  ( index  = =  - 1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													float  * tmparray =  MEM_callocN ( sizeof ( float ) * len ,  " copy - float " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													RNA_property_float_get_array ( fromptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													RNA_property_float_set_array ( ptr ,  prop ,  tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													MEM_freeN ( tmparray ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													float  value =  RNA_property_float_get_index ( fromptr ,  prop ,  index ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													RNA_property_float_set_index ( ptr ,  prop ,  index ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												float  value =  RNA_property_float_get ( fromptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												RNA_property_float_set ( ptr ,  prop ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_ENUM : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											int  value =  RNA_property_enum_get ( fromptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											RNA_property_enum_set ( ptr ,  prop ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_POINTER : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											PointerRNA  value =  RNA_property_pointer_get ( fromptr ,  prop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											RNA_property_pointer_set ( ptr ,  prop ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  PROP_STRING : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											char  * value =  RNA_property_string_get_alloc ( fromptr ,  prop ,  NULL ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											RNA_property_string_set ( ptr ,  prop ,  value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											MEM_freeN ( value ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-25 04:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2011-09-09 01:29:53 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* use RNA_warning macro which includes __func__ suffix */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  _RNA_warning ( const  char  * format ,  . . . ) 
							 
						 
					
						
							
								
									
										
										
										
											2011-03-25 04:37:59 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									va_list  args ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									va_start ( args ,  format ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									vprintf ( format ,  args ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									va_end ( args ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# ifdef WITH_PYTHON 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										extern  void  PyC_LineSpit ( void ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										PyC_LineSpit ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# endif 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}