2008-10-31 23:50:02 +00:00
/**
2002-10-12 11:37:38 +00:00
* $ Id $
*
2008-01-07 19:13:47 +00:00
* * * * * * BEGIN GPL LICENSE BLOCK * * * * *
2002-10-12 11:37:38 +00:00
*
* 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
2008-01-07 19:13:47 +00:00
* of the License , or ( at your option ) any later version .
2002-10-12 11:37:38 +00:00
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software Foundation ,
* Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*
2008-10-31 23:50:02 +00:00
* Contributor ( s ) : Blender Foundation ( 2008 ) .
2002-10-12 11:37:38 +00:00
*
2008-01-07 19:13:47 +00:00
* * * * * * END GPL LICENSE BLOCK * * * * *
2002-10-12 11:37:38 +00:00
*/
2009-06-03 23:22:43 +00:00
# include <stdio.h>
2008-10-31 23:50:02 +00:00
# include <stdlib.h>
# include "RNA_define.h"
# include "RNA_types.h"
2008-11-07 02:58:25 +00:00
# include "rna_internal.h"
2009-01-08 13:57:29 +00:00
# include "DNA_customdata_types.h"
2009-06-03 23:22:43 +00:00
# include "DNA_material_types.h"
2009-01-08 13:57:29 +00:00
# include "DNA_mesh_types.h"
2009-06-27 13:20:19 +00:00
# include "DNA_object_force.h"
2008-10-31 23:50:02 +00:00
# include "DNA_object_types.h"
2008-12-02 01:05:23 +00:00
# include "DNA_property_types.h"
2009-01-02 13:47:33 +00:00
# include "DNA_scene_types.h"
2008-10-31 23:50:02 +00:00
2009-01-01 15:52:51 +00:00
# include "WM_types.h"
2008-10-31 23:50:02 +00:00
# ifdef RNA_RUNTIME
2008-12-02 23:45:11 +00:00
2009-07-01 22:25:49 +00:00
# include "DNA_key_types.h"
2009-06-07 13:09:18 +00:00
# include "BKE_armature.h"
2009-01-01 15:52:51 +00:00
# include "BKE_context.h"
2009-06-07 13:09:18 +00:00
# include "BKE_curve.h"
2009-01-01 15:52:51 +00:00
# include "BKE_depsgraph.h"
2009-07-01 22:25:49 +00:00
# include "BKE_key.h"
2009-01-04 19:25:24 +00:00
# include "BKE_material.h"
2009-06-07 13:09:18 +00:00
# include "BKE_mesh.h"
2009-06-01 11:39:11 +00:00
# include "BKE_particle.h"
2009-01-01 15:52:51 +00:00
static void rna_Object_update ( bContext * C , PointerRNA * ptr )
{
DAG_object_flush_update ( CTX_data_scene ( C ) , ptr - > id . data , OB_RECALC_OB ) ;
}
2009-06-07 13:09:18 +00:00
static void rna_Object_update_data ( bContext * C , PointerRNA * ptr )
{
DAG_object_flush_update ( CTX_data_scene ( C ) , ptr - > id . data , OB_RECALC_DATA ) ;
}
2009-05-27 00:03:49 +00:00
static void rna_Object_dependency_update ( bContext * C , PointerRNA * ptr )
2009-04-11 01:43:50 +00:00
{
DAG_object_flush_update ( CTX_data_scene ( C ) , ptr - > id . data , OB_RECALC_OB ) ;
DAG_scene_sort ( CTX_data_scene ( C ) ) ;
}
2009-06-07 13:09:18 +00:00
static int rna_Object_data_editable ( PointerRNA * ptr )
{
Object * ob = ( Object * ) ptr - > data ;
return ( ob - > type = = OB_EMPTY ) ? 0 : PROP_EDITABLE ;
}
static void rna_Object_data_set ( PointerRNA * ptr , PointerRNA value )
{
Object * ob = ( Object * ) ptr - > data ;
ID * id = value . data ;
if ( ob - > type = = OB_EMPTY | | id = = NULL )
return ;
if ( ob - > type = = OB_MESH ) {
set_mesh ( ob , ( Mesh * ) id ) ;
}
else {
if ( ob - > data )
id_us_min ( ( ID * ) ob - > data ) ;
if ( id )
id_us_plus ( id ) ;
ob - > data = id ;
test_object_materials ( id ) ;
2009-06-20 15:06:18 +00:00
if ( GS ( id - > name ) = = ID_CU )
2009-06-07 13:09:18 +00:00
test_curve_type ( ob ) ;
else if ( ob - > type = = OB_ARMATURE )
armature_rebuild_pose ( ob , ob - > data ) ;
}
}
static StructRNA * rna_Object_data_typef ( PointerRNA * ptr )
{
Object * ob = ( Object * ) ptr - > data ;
switch ( ob - > type ) {
case OB_MESH : return & RNA_Mesh ;
case OB_CURVE : return & RNA_Curve ;
case OB_SURF : return & RNA_Curve ;
case OB_FONT : return & RNA_Curve ;
case OB_MBALL : return & RNA_MetaBall ;
case OB_LAMP : return & RNA_Lamp ;
case OB_CAMERA : return & RNA_Camera ;
case OB_LATTICE : return & RNA_Lattice ;
case OB_ARMATURE : return & RNA_Armature ;
default : return & RNA_ID ;
}
}
2009-01-01 20:44:40 +00:00
static int rna_VertexGroup_index_get ( PointerRNA * ptr )
{
2009-01-04 19:25:24 +00:00
Object * ob = ( Object * ) ptr - > id . data ;
2009-01-01 20:44:40 +00:00
return BLI_findindex ( & ob - > defbase , ptr - > data ) ;
}
2009-02-02 19:57:57 +00:00
static PointerRNA rna_Object_active_vertex_group_get ( PointerRNA * ptr )
2009-01-01 20:44:40 +00:00
{
2009-01-04 19:25:24 +00:00
Object * ob = ( Object * ) ptr - > id . data ;
2009-02-02 19:57:57 +00:00
return rna_pointer_inherit_refine ( ptr , & RNA_VertexGroup , BLI_findlink ( & ob - > defbase , ob - > actdef ) ) ;
2009-01-01 20:44:40 +00:00
}
2009-07-01 22:25:49 +00:00
static int rna_Object_active_vertex_group_index_get ( PointerRNA * ptr )
{
Object * ob = ( Object * ) ptr - > id . data ;
return MAX2 ( ob - > actdef - 1 , 0 ) ;
}
static void rna_Object_active_vertex_group_index_set ( PointerRNA * ptr , int value )
{
Object * ob = ( Object * ) ptr - > id . data ;
ob - > actdef = value + 1 ;
}
static void rna_Object_active_vertex_group_index_range ( PointerRNA * ptr , int * min , int * max )
{
Object * ob = ( Object * ) ptr - > id . data ;
* min = 0 ;
* max = BLI_countlist ( & ob - > defbase ) - 1 ;
* max = MAX2 ( 0 , * max ) ;
}
2009-01-04 19:25:24 +00:00
void rna_object_vgroup_name_index_get ( PointerRNA * ptr , char * value , int index )
{
Object * ob = ( Object * ) ptr - > id . data ;
bDeformGroup * dg ;
dg = BLI_findlink ( & ob - > defbase , index - 1 ) ;
if ( dg ) BLI_strncpy ( value , dg - > name , sizeof ( dg - > name ) ) ;
else BLI_strncpy ( value , " " , sizeof ( dg - > name ) ) ;
}
int rna_object_vgroup_name_index_length ( PointerRNA * ptr , int index )
{
Object * ob = ( Object * ) ptr - > id . data ;
bDeformGroup * dg ;
dg = BLI_findlink ( & ob - > defbase , index - 1 ) ;
return ( dg ) ? strlen ( dg - > name ) : 0 ;
}
void rna_object_vgroup_name_index_set ( PointerRNA * ptr , const char * value , short * index )
{
Object * ob = ( Object * ) ptr - > id . data ;
bDeformGroup * dg ;
int a ;
for ( a = 1 , dg = ob - > defbase . first ; dg ; dg = dg - > next , a + + ) {
if ( strcmp ( dg - > name , value ) = = 0 ) {
* index = a ;
return ;
}
}
* index = 0 ;
}
void rna_object_vgroup_name_set ( PointerRNA * ptr , const char * value , char * result , int maxlen )
{
Object * ob = ( Object * ) ptr - > id . data ;
bDeformGroup * dg ;
for ( dg = ob - > defbase . first ; dg ; dg = dg - > next ) {
if ( strcmp ( dg - > name , value ) = = 0 ) {
BLI_strncpy ( result , value , maxlen ) ;
return ;
}
}
BLI_strncpy ( result , " " , maxlen ) ;
}
void rna_object_uvlayer_name_set ( PointerRNA * ptr , const char * value , char * result , int maxlen )
{
Object * ob = ( Object * ) ptr - > id . data ;
Mesh * me ;
CustomDataLayer * layer ;
int a ;
if ( ob - > type = = OB_MESH & & ob - > data ) {
me = ( Mesh * ) ob - > data ;
for ( a = 0 ; a < me - > fdata . totlayer ; a + + ) {
layer = & me - > fdata . layers [ a ] ;
if ( layer - > type = = CD_MTFACE & & strcmp ( layer - > name , value ) = = 0 ) {
BLI_strncpy ( result , value , maxlen ) ;
return ;
}
}
}
BLI_strncpy ( result , " " , maxlen ) ;
}
void rna_object_vcollayer_name_set ( PointerRNA * ptr , const char * value , char * result , int maxlen )
{
Object * ob = ( Object * ) ptr - > id . data ;
Mesh * me ;
CustomDataLayer * layer ;
int a ;
if ( ob - > type = = OB_MESH & & ob - > data ) {
me = ( Mesh * ) ob - > data ;
for ( a = 0 ; a < me - > fdata . totlayer ; a + + ) {
layer = & me - > fdata . layers [ a ] ;
if ( layer - > type = = CD_MCOL & & strcmp ( layer - > name , value ) = = 0 ) {
BLI_strncpy ( result , value , maxlen ) ;
return ;
}
}
}
BLI_strncpy ( result , " " , maxlen ) ;
}
2009-07-01 22:25:49 +00:00
static int rna_Object_active_material_index_get ( PointerRNA * ptr )
{
Object * ob = ( Object * ) ptr - > id . data ;
return MAX2 ( ob - > actcol - 1 , 0 ) ;
}
static void rna_Object_active_material_index_set ( PointerRNA * ptr , int value )
{
Object * ob = ( Object * ) ptr - > id . data ;
ob - > actcol = value + 1 ;
}
2009-01-04 19:25:24 +00:00
static void rna_Object_active_material_index_range ( PointerRNA * ptr , int * min , int * max )
2009-01-02 13:47:33 +00:00
{
Object * ob = ( Object * ) ptr - > id . data ;
2009-07-01 22:25:49 +00:00
* min = 0 ;
* max = MAX2 ( ob - > totcol - 1 , 0 ) ;
2009-01-02 13:47:33 +00:00
}
2009-02-02 19:57:57 +00:00
static PointerRNA rna_Object_active_material_get ( PointerRNA * ptr )
2009-01-04 19:25:24 +00:00
{
Object * ob = ( Object * ) ptr - > id . data ;
2009-06-03 23:22:43 +00:00
return rna_pointer_inherit_refine ( ptr , & RNA_MaterialSlot , ob - > mat + ob - > actcol ) ;
2009-01-04 19:25:24 +00:00
}
2009-06-27 15:41:47 +00:00
static void rna_Object_active_particle_system_index_range ( PointerRNA * ptr , int * min , int * max )
{
Object * ob = ( Object * ) ptr - > id . data ;
2009-07-01 22:25:49 +00:00
* min = 0 ;
* max = BLI_countlist ( & ob - > particlesystem ) - 1 ;
* max = MAX2 ( 0 , * max ) ;
2009-06-27 15:41:47 +00:00
}
static int rna_Object_active_particle_system_index_get ( PointerRNA * ptr )
{
Object * ob = ( Object * ) ptr - > id . data ;
2009-07-01 22:25:49 +00:00
return psys_get_current_num ( ob ) ;
2009-06-27 15:41:47 +00:00
}
static void rna_Object_active_particle_system_index_set ( struct PointerRNA * ptr , int value )
{
Object * ob = ( Object * ) ptr - > id . data ;
psys_set_current_num ( ob , value ) ;
}
2009-01-04 19:25:24 +00:00
#if 0
2009-02-02 19:57:57 +00:00
static void rna_Object_active_material_set ( PointerRNA * ptr , PointerRNA value )
2009-01-04 19:25:24 +00:00
{
Object * ob = ( Object * ) ptr - > id . data ;
2009-02-02 19:57:57 +00:00
assign_material ( ob , value . data , ob - > actcol ) ;
2009-01-04 19:25:24 +00:00
}
# endif
2009-06-03 23:22:43 +00:00
static PointerRNA rna_MaterialSlot_material_get ( PointerRNA * ptr )
2009-01-02 16:58:09 +00:00
{
Object * ob = ( Object * ) ptr - > id . data ;
2009-06-03 23:22:43 +00:00
Material * ma ;
int index = ( Material * * ) ptr - > data - ob - > mat ;
ma = give_current_material ( ob , index + 1 ) ;
return rna_pointer_inherit_refine ( ptr , & RNA_Material , ma ) ;
2009-01-02 16:58:09 +00:00
}
2009-06-03 23:22:43 +00:00
static void rna_MaterialSlot_material_set ( PointerRNA * ptr , PointerRNA value )
2009-01-02 16:58:09 +00:00
{
Object * ob = ( Object * ) ptr - > id . data ;
2009-06-03 23:22:43 +00:00
int index = ( Material * * ) ptr - > data - ob - > mat ;
assign_material ( ob , value . data , index + 1 ) ;
}
static int rna_MaterialSlot_link_get ( PointerRNA * ptr )
{
Object * ob = ( Object * ) ptr - > id . data ;
int index = ( Material * * ) ptr - > data - ob - > mat ;
return ( ob - > colbits & ( 1 < < index ) ) ! = 0 ;
}
static void rna_MaterialSlot_link_set ( PointerRNA * ptr , int value )
{
Object * ob = ( Object * ) ptr - > id . data ;
int index = ( Material * * ) ptr - > data - ob - > mat ;
2009-01-02 16:58:09 +00:00
if ( value )
2009-06-03 23:22:43 +00:00
ob - > colbits | = ( 1 < < index ) ;
2009-01-02 16:58:09 +00:00
else
2009-06-03 23:22:43 +00:00
ob - > colbits & = ~ ( 1 < < index ) ;
}
static int rna_MaterialSlot_name_length ( PointerRNA * ptr )
{
Object * ob = ( Object * ) ptr - > id . data ;
Material * ma ;
int index = ( Material * * ) ptr - > data - ob - > mat ;
ma = give_current_material ( ob , index + 1 ) ;
if ( ma )
2009-06-07 13:09:18 +00:00
return strlen ( ma - > id . name + 2 ) ;
2009-06-03 23:22:43 +00:00
2009-06-07 13:09:18 +00:00
return 0 ;
2009-06-03 23:22:43 +00:00
}
static void rna_MaterialSlot_name_get ( PointerRNA * ptr , char * str )
{
Object * ob = ( Object * ) ptr - > id . data ;
Material * ma ;
int index = ( Material * * ) ptr - > data - ob - > mat ;
ma = give_current_material ( ob , index + 1 ) ;
2009-06-07 13:09:18 +00:00
2009-06-03 23:22:43 +00:00
if ( ma )
2009-06-07 13:09:18 +00:00
strcpy ( str , ma - > id . name + 2 ) ;
else
strcpy ( str , " " ) ;
2009-01-02 16:58:09 +00:00
}
2009-06-01 11:39:11 +00:00
static PointerRNA rna_Object_active_particle_system_get ( PointerRNA * ptr )
{
Object * ob = ( Object * ) ptr - > id . data ;
ParticleSystem * psys = psys_get_current ( ob ) ;
return rna_pointer_inherit_refine ( ptr , & RNA_ParticleSystem , psys ) ;
}
2009-02-02 19:57:57 +00:00
static PointerRNA rna_Object_game_settings_get ( PointerRNA * ptr )
2009-01-01 20:44:40 +00:00
{
2009-02-02 19:57:57 +00:00
return rna_pointer_inherit_refine ( ptr , & RNA_GameObjectSettings , ptr - > id . data ) ;
2009-01-01 20:44:40 +00:00
}
2009-02-02 19:57:57 +00:00
static void rna_Object_layer_set ( PointerRNA * ptr , const int * values )
2009-01-01 20:44:40 +00:00
{
Object * ob = ( Object * ) ptr - > data ;
2009-02-03 10:14:29 +00:00
int i , tot = 0 ;
2009-02-02 19:57:57 +00:00
/* ensure we always have some layer selected */
for ( i = 0 ; i < 20 ; i + + )
if ( values [ i ] )
tot + + ;
if ( tot = = 0 )
return ;
2009-01-01 20:44:40 +00:00
2009-02-02 19:57:57 +00:00
for ( i = 0 ; i < 20 ; i + + ) {
if ( values [ i ] ) ob - > lay | = ( 1 < < i ) ;
else ob - > lay & = ~ ( 1 < < i ) ;
2009-01-01 20:44:40 +00:00
}
}
2009-02-02 19:57:57 +00:00
static void rna_GameObjectSettings_state_set ( PointerRNA * ptr , const int * values )
2009-01-01 20:44:40 +00:00
{
Object * ob = ( Object * ) ptr - > data ;
2009-02-03 10:14:29 +00:00
int i , tot = 0 ;
2009-02-02 19:57:57 +00:00
2009-06-07 13:09:18 +00:00
/* ensure we always have some state selected */
2009-02-02 19:57:57 +00:00
for ( i = 0 ; i < 20 ; i + + )
if ( values [ i ] )
tot + + ;
if ( tot = = 0 )
return ;
2009-01-01 20:44:40 +00:00
2009-02-02 19:57:57 +00:00
for ( i = 0 ; i < 20 ; i + + ) {
if ( values [ i ] ) ob - > state | = ( 1 < < i ) ;
else ob - > state & = ~ ( 1 < < i ) ;
2009-01-01 20:44:40 +00:00
}
}
2009-07-01 22:25:49 +00:00
static void rna_Object_active_shape_key_index_range ( PointerRNA * ptr , int * min , int * max )
{
Object * ob = ( Object * ) ptr - > id . data ;
Key * key = ob_get_key ( ob ) ;
* min = 0 ;
* max = ( key ) ? BLI_countlist ( & key - > block ) - 1 : 0 ;
* max = MAX2 ( 0 , * max ) ;
}
static int rna_Object_active_shape_key_index_get ( PointerRNA * ptr )
{
Object * ob = ( Object * ) ptr - > id . data ;
return MAX2 ( ob - > shapenr - 1 , 0 ) ;
}
static void rna_Object_active_shape_key_index_set ( PointerRNA * ptr , int value )
{
Object * ob = ( Object * ) ptr - > id . data ;
ob - > shapenr = value + 1 ;
ob - > shapeflag | = OB_SHAPE_TEMPLOCK ;
}
static void rna_Object_shape_key_lock_set ( PointerRNA * ptr , int value )
{
Object * ob = ( Object * ) ptr - > id . data ;
if ( value ) ob - > shapeflag | = OB_SHAPE_LOCK ;
else ob - > shapeflag & = ~ OB_SHAPE_LOCK ;
ob - > shapeflag & = ~ OB_SHAPE_TEMPLOCK ;
}
2008-10-31 23:50:02 +00:00
# else
2009-01-01 20:44:40 +00:00
static void rna_def_vertex_group ( BlenderRNA * brna )
{
StructRNA * srna ;
PropertyRNA * prop ;
srna = RNA_def_struct ( brna , " VertexGroup " , NULL ) ;
RNA_def_struct_sdna ( srna , " bDeformGroup " ) ;
RNA_def_struct_ui_text ( srna , " Vertex Group " , " Group of vertices, used for armature deform and other purposes. " ) ;
2009-06-03 23:16:51 +00:00
RNA_def_struct_ui_icon ( srna , ICON_GROUP_VERTEX ) ;
2009-01-01 20:44:40 +00:00
prop = RNA_def_property ( srna , " name " , PROP_STRING , PROP_NONE ) ;
RNA_def_property_ui_text ( prop , " Name " , " Vertex group name. " ) ;
RNA_def_struct_name_property ( srna , prop ) ;
prop = RNA_def_property ( srna , " index " , PROP_INT , PROP_UNSIGNED ) ;
2009-03-23 13:24:48 +00:00
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
2009-01-01 20:44:40 +00:00
RNA_def_property_int_funcs ( prop , " rna_VertexGroup_index_get " , NULL , NULL ) ;
RNA_def_property_ui_text ( prop , " Index " , " Index number of the vertex group. " ) ;
}
2009-06-03 23:22:43 +00:00
static void rna_def_material_slot ( BlenderRNA * brna )
{
StructRNA * srna ;
PropertyRNA * prop ;
static EnumPropertyItem link_items [ ] = {
2009-06-16 00:52:21 +00:00
{ 0 , " DATA " , 0 , " Data " , " " } ,
{ 1 , " OBJECT " , 0 , " Object " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-06-03 23:22:43 +00:00
/* NOTE: there is no MaterialSlot equivalent in DNA, so the internal
* pointer data points to ob - > mat + index , and we manually implement
* get / set for the properties . */
srna = RNA_def_struct ( brna , " MaterialSlot " , NULL ) ;
RNA_def_struct_ui_text ( srna , " Material Slot " , " Material slot in an object. " ) ;
RNA_def_struct_ui_icon ( srna , ICON_MATERIAL_DATA ) ;
prop = RNA_def_property ( srna , " material " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_struct_type ( prop , " Material " ) ;
RNA_def_property_flag ( prop , PROP_EDITABLE ) ;
2009-06-07 13:09:18 +00:00
RNA_def_property_pointer_funcs ( prop , " rna_MaterialSlot_material_get " , " rna_MaterialSlot_material_set " , NULL ) ;
2009-06-03 23:22:43 +00:00
RNA_def_property_ui_text ( prop , " Material " , " Material datablock used by this material slot. " ) ;
2009-06-24 17:22:22 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_SHADING , " rna_Object_update " ) ;
2009-06-03 23:22:43 +00:00
prop = RNA_def_property ( srna , " link " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_items ( prop , link_items ) ;
RNA_def_property_enum_funcs ( prop , " rna_MaterialSlot_link_get " , " rna_MaterialSlot_link_set " , NULL ) ;
RNA_def_property_ui_text ( prop , " Link " , " Link material to object or the object's data. " ) ;
2009-06-24 17:22:22 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_SHADING , " rna_Object_update " ) ;
2009-06-03 23:22:43 +00:00
prop = RNA_def_property ( srna , " name " , PROP_STRING , PROP_NONE ) ;
RNA_def_property_string_funcs ( prop , " rna_MaterialSlot_name_get " , " rna_MaterialSlot_name_length " , NULL ) ;
RNA_def_property_ui_text ( prop , " Name " , " Material slot name. " ) ;
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
RNA_def_struct_name_property ( srna , prop ) ;
}
2009-01-10 22:57:33 +00:00
static void rna_def_object_game_settings ( BlenderRNA * brna )
2009-01-01 20:44:40 +00:00
{
StructRNA * srna ;
PropertyRNA * prop ;
static EnumPropertyItem body_type_items [ ] = {
2009-06-16 00:52:21 +00:00
{ OB_BODY_TYPE_NO_COLLISION , " NO_COLLISION " , 0 , " No Collision " , " " } ,
{ OB_BODY_TYPE_STATIC , " STATIC " , 0 , " Static " , " " } ,
{ OB_BODY_TYPE_DYNAMIC , " DYNAMIC " , 0 , " Dynamic " , " " } ,
{ OB_BODY_TYPE_RIGID , " RIGID_BODY " , 0 , " Rigid Body " , " " } ,
{ OB_BODY_TYPE_SOFT , " SOFT_BODY " , 0 , " Soft Body " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-01-01 20:44:40 +00:00
static EnumPropertyItem collision_bounds_items [ ] = {
2009-06-16 00:52:21 +00:00
{ OB_BOUND_BOX , " BOX " , 0 , " Box " , " " } ,
{ OB_BOUND_SPHERE , " SPHERE " , 0 , " Sphere " , " " } ,
{ OB_BOUND_CYLINDER , " CYLINDER " , 0 , " Cylinder " , " " } ,
{ OB_BOUND_CONE , " CONE " , 0 , " Cone " , " " } ,
{ OB_BOUND_POLYH , " CONVEX_HULL " , 0 , " Convex Hull " , " " } ,
{ OB_BOUND_POLYT , " TRIANGLE_MESH " , 0 , " Triangle Mesh " , " " } ,
//{OB_DYN_MESH, "DYNAMIC_MESH", 0, "Dynamic Mesh", ""},
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-01-01 20:44:40 +00:00
2009-01-10 22:57:33 +00:00
srna = RNA_def_struct ( brna , " GameObjectSettings " , NULL ) ;
2009-01-01 20:44:40 +00:00
RNA_def_struct_sdna ( srna , " Object " ) ;
2009-01-10 22:57:33 +00:00
RNA_def_struct_nested ( brna , srna , " Object " ) ;
RNA_def_struct_ui_text ( srna , " Game Object Settings " , " Game engine related settings for the object. " ) ;
2009-06-03 23:16:51 +00:00
RNA_def_struct_ui_icon ( srna , ICON_GAME ) ;
2009-01-01 20:44:40 +00:00
2009-01-02 16:58:09 +00:00
/* logic */
2009-01-01 20:44:40 +00:00
prop = RNA_def_property ( srna , " sensors " , PROP_COLLECTION , PROP_NONE ) ;
RNA_def_property_struct_type ( prop , " Sensor " ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Sensors " , " Game engine sensor to detect events. " ) ;
2009-01-01 20:44:40 +00:00
prop = RNA_def_property ( srna , " controllers " , PROP_COLLECTION , PROP_NONE ) ;
RNA_def_property_struct_type ( prop , " Controller " ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Controllers " , " Game engine controllers to process events, connecting sensor to actuators. " ) ;
2009-01-01 20:44:40 +00:00
prop = RNA_def_property ( srna , " actuators " , PROP_COLLECTION , PROP_NONE ) ;
RNA_def_property_struct_type ( prop , " Actuator " ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Actuators " , " Game engine actuators to act on events. " ) ;
2009-01-01 20:44:40 +00:00
prop = RNA_def_property ( srna , " properties " , PROP_COLLECTION , PROP_NONE ) ;
RNA_def_property_collection_sdna ( prop , NULL , " prop " , NULL ) ;
RNA_def_property_struct_type ( prop , " GameProperty " ) ;
RNA_def_property_ui_text ( prop , " Properties " , " Game engine properties. " ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " show_sensors " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " scaflag " , OB_SHOWSENS ) ;
RNA_def_property_ui_text ( prop , " Show Sensors " , " Shows sensors for this object in the user interface. " ) ;
prop = RNA_def_property ( srna , " show_controllers " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " scaflag " , OB_SHOWCONT ) ;
RNA_def_property_ui_text ( prop , " Show Controllers " , " Shows controllers for this object in the user interface. " ) ;
prop = RNA_def_property ( srna , " show_actuators " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " scaflag " , OB_SHOWACT ) ;
RNA_def_property_ui_text ( prop , " Show Actuators " , " Shows actuators for this object in the user interface. " ) ;
/* physics */
2009-01-01 20:44:40 +00:00
prop = RNA_def_property ( srna , " physics_type " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " body_type " ) ;
RNA_def_property_enum_items ( prop , body_type_items ) ;
2009-03-23 13:24:48 +00:00
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ; // this controls various gameflags
2009-01-01 20:44:40 +00:00
RNA_def_property_ui_text ( prop , " Physics Type " , " Selects the type of physical representation. " ) ;
prop = RNA_def_property ( srna , " actor " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " gameflag " , OB_ACTOR ) ;
RNA_def_property_ui_text ( prop , " Actor " , " Object is detected by the Near and Radar sensor. " ) ;
prop = RNA_def_property ( srna , " ghost " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " gameflag " , OB_GHOST ) ;
RNA_def_property_ui_text ( prop , " Ghost " , " Object does not restitute collisions, like a ghost. " ) ;
prop = RNA_def_property ( srna , " mass " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_range ( prop , 0.01 , 10000.0 ) ;
RNA_def_property_ui_text ( prop , " Mass " , " Mass of the object. " ) ;
prop = RNA_def_property ( srna , " radius " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " inertia " ) ;
RNA_def_property_range ( prop , 0.01 , 10.0 ) ;
RNA_def_property_ui_text ( prop , " Radius " , " Radius for Bounding sphere and Fh/Fh Rot. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , NULL ) ;
2009-01-01 20:44:40 +00:00
prop = RNA_def_property ( srna , " no_sleeping " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " gameflag " , OB_COLLISION_RESPONSE ) ;
RNA_def_property_ui_text ( prop , " No Sleeping " , " Disable auto (de)activation in physics simulation. " ) ;
prop = RNA_def_property ( srna , " damping " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " damping " ) ;
RNA_def_property_range ( prop , 0.0 , 1.0 ) ;
RNA_def_property_ui_text ( prop , " Damping " , " General movement damping. " ) ;
prop = RNA_def_property ( srna , " rotation_damping " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " rdamping " ) ;
RNA_def_property_range ( prop , 0.0 , 1.0 ) ;
RNA_def_property_ui_text ( prop , " Rotation Damping " , " General rotation damping. " ) ;
2009-06-20 06:06:13 +00:00
prop = RNA_def_property ( srna , " minimum_velocity " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " min_vel " ) ;
RNA_def_property_range ( prop , 0.0 , 1000.0 ) ;
RNA_def_property_ui_text ( prop , " Velocity Min " , " Clamp velocity to this minimum speed (except when totally still). " ) ;
prop = RNA_def_property ( srna , " maximum_velocity " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " max_vel " ) ;
RNA_def_property_range ( prop , 0.0 , 1000.0 ) ;
RNA_def_property_ui_text ( prop , " Velocity Max " , " Clamp velocity to this maximum speed. " ) ;
/* lock position */
prop = RNA_def_property ( srna , " lock_x_axis " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " gameflag2 " , OB_LOCK_RIGID_BODY_X_AXIS ) ;
RNA_def_property_ui_text ( prop , " Lock X Axis " , " Disable simulation of linear motion along the X axis. " ) ;
prop = RNA_def_property ( srna , " lock_y_axis " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " gameflag2 " , OB_LOCK_RIGID_BODY_Y_AXIS ) ;
RNA_def_property_ui_text ( prop , " Lock Y Axis " , " Disable simulation of linear motion along the Y axis. " ) ;
prop = RNA_def_property ( srna , " lock_z_axis " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " gameflag2 " , OB_LOCK_RIGID_BODY_Z_AXIS ) ;
RNA_def_property_ui_text ( prop , " Lock Z Axis " , " Disable simulation of linear motion along the Z axis. " ) ;
/* lock rotation */
prop = RNA_def_property ( srna , " lock_x_rot_axis " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " gameflag2 " , OB_LOCK_RIGID_BODY_X_ROT_AXIS ) ;
RNA_def_property_ui_text ( prop , " Lock X Rotation Axis " , " Disable simulation of angular motion along the X axis. " ) ;
prop = RNA_def_property ( srna , " lock_y_rot_axis " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " gameflag2 " , OB_LOCK_RIGID_BODY_Y_ROT_AXIS ) ;
RNA_def_property_ui_text ( prop , " Lock Y Rotation Axis " , " Disable simulation of angular motion along the Y axis. " ) ;
prop = RNA_def_property ( srna , " lock_z_rot_axis " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " gameflag2 " , OB_LOCK_RIGID_BODY_Z_ROT_AXIS ) ;
RNA_def_property_ui_text ( prop , " Lock Z Rotation Axis " , " Disable simulation of angular motion along the Z axis. " ) ;
/* is this used anywhere ? */
prop = RNA_def_property ( srna , " use_activity_culling " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_negative_sdna ( prop , NULL , " gameflag2 " , OB_NEVER_DO_ACTIVITY_CULLING ) ;
RNA_def_property_ui_text ( prop , " Lock Z Rotation Axis " , " Disable simulation of angular motion along the Z axis. " ) ;
2009-01-01 20:44:40 +00:00
prop = RNA_def_property ( srna , " do_fh " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " gameflag " , OB_DO_FH ) ;
RNA_def_property_ui_text ( prop , " Do Fh " , " Use Fh settings in materials. " ) ;
prop = RNA_def_property ( srna , " rotation_fh " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " gameflag " , OB_ROT_FH ) ;
RNA_def_property_ui_text ( prop , " Rotation Fh " , " Use face normal to rotate Object " ) ;
prop = RNA_def_property ( srna , " form_factor " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " formfactor " ) ;
RNA_def_property_range ( prop , 0.0 , 1.0 ) ;
RNA_def_property_ui_text ( prop , " Form Factor " , " Form factor scales the inertia tensor. " ) ;
prop = RNA_def_property ( srna , " anisotropic_friction " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " gameflag " , OB_ANISOTROPIC_FRICTION ) ;
RNA_def_property_ui_text ( prop , " Anisotropic Friction " , " Enable anisotropic friction. " ) ;
prop = RNA_def_property ( srna , " friction_coefficients " , PROP_FLOAT , PROP_VECTOR ) ;
RNA_def_property_float_sdna ( prop , NULL , " anisotropicFriction " ) ;
RNA_def_property_range ( prop , 0.0 , 1.0 ) ;
RNA_def_property_ui_text ( prop , " Friction Coefficients " , " Relative friction coefficient in the in the X, Y and Z directions, when anisotropic friction is enabled. " ) ;
prop = RNA_def_property ( srna , " use_collision_bounds " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " gameflag " , OB_BOUNDS ) ;
RNA_def_property_ui_text ( prop , " Use Collision Bounds " , " Specify a collision bounds type other than the default. " ) ;
prop = RNA_def_property ( srna , " collision_bounds " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " boundtype " ) ;
RNA_def_property_enum_items ( prop , collision_bounds_items ) ;
RNA_def_property_ui_text ( prop , " Collision Bounds " , " Selects the collision type. " ) ;
prop = RNA_def_property ( srna , " collision_compound " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " gameflag " , OB_CHILD ) ;
RNA_def_property_ui_text ( prop , " Collison Compound " , " Add children to form a compound collision object. " ) ;
prop = RNA_def_property ( srna , " collision_margin " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " margin " ) ;
RNA_def_property_range ( prop , 0.0 , 1.0 ) ;
RNA_def_property_ui_text ( prop , " Collision Margin " , " Extra margin around object for collision detection, small amount required for stability. " ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " soft_body " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " bsoft " ) ;
RNA_def_property_ui_text ( prop , " Soft Body Settings " , " Settings for Bullet soft body simulation. " ) ;
/* state */
2009-01-01 20:44:40 +00:00
prop = RNA_def_property ( srna , " state " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " state " , 1 ) ;
RNA_def_property_array ( prop , 30 ) ;
RNA_def_property_ui_text ( prop , " State " , " State determining which controllers are displayed. " ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_boolean_funcs ( prop , NULL , " rna_GameObjectSettings_state_set " ) ;
2009-01-01 20:44:40 +00:00
prop = RNA_def_property ( srna , " initial_state " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " init_state " , 1 ) ;
RNA_def_property_array ( prop , 30 ) ;
RNA_def_property_ui_text ( prop , " Initial State " , " Initial state when the game starts. " ) ;
2009-01-02 13:47:33 +00:00
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " debug_state " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " scaflag " , OB_DEBUGSTATE ) ;
RNA_def_property_ui_text ( prop , " Debug State " , " Print state debug info in the game engine. " ) ;
2009-01-01 20:44:40 +00:00
}
2009-06-18 19:48:55 +00:00
static void rna_def_object ( BlenderRNA * brna )
2008-10-31 23:50:02 +00:00
{
2008-11-07 02:58:25 +00:00
StructRNA * srna ;
2008-10-31 23:50:02 +00:00
PropertyRNA * prop ;
2009-01-02 13:47:33 +00:00
static EnumPropertyItem parent_type_items [ ] = {
2009-06-16 00:52:21 +00:00
{ PAROBJECT , " OBJECT " , 0 , " Object " , " " } ,
{ PARCURVE , " CURVE " , 0 , " Curve " , " " } ,
//{PARKEY, "KEY", 0, "Key", ""},
{ PARSKEL , " ARMATURE " , 0 , " Armature " , " " } ,
{ PARSKEL , " LATTICE " , 0 , " Lattice " , " " } , // PARSKEL reuse will give issues
{ PARVERT1 , " VERTEX " , 0 , " Vertex " , " " } ,
{ PARVERT3 , " VERTEX_3 " , 0 , " 3 Vertices " , " " } ,
{ PARBONE , " BONE " , 0 , " Bone " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-04-24 01:17:54 +00:00
static EnumPropertyItem object_type_items [ ] = {
2009-06-16 00:52:21 +00:00
{ OB_EMPTY , " EMPTY " , 0 , " Empty " , " " } ,
{ OB_MESH , " MESH " , 0 , " Mesh " , " " } ,
{ OB_CURVE , " CURVE " , 0 , " Curve " , " " } ,
{ OB_SURF , " SURFACE " , 0 , " Surface " , " " } ,
{ OB_FONT , " TEXT " , 0 , " Text " , " " } ,
{ OB_MBALL , " META " , 0 , " Meta " , " " } ,
{ OB_LAMP , " LAMP " , 0 , " Lamp " , " " } ,
{ OB_CAMERA , " CAMERA " , 0 , " Camera " , " " } ,
{ OB_WAVE , " WAVE " , 0 , " Wave " , " " } ,
{ OB_LATTICE , " LATTICE " , 0 , " Lattice " , " " } ,
{ OB_ARMATURE , " ARMATURE " , 0 , " Armature " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-01-02 13:47:33 +00:00
static EnumPropertyItem empty_drawtype_items [ ] = {
2009-06-16 00:52:21 +00:00
{ OB_ARROWS , " ARROWS " , 0 , " Arrows " , " " } ,
{ OB_SINGLE_ARROW , " SINGLE_ARROW " , 0 , " Single Arrow " , " " } ,
{ OB_PLAINAXES , " PLAIN_AXES " , 0 , " Plain Axes " , " " } ,
{ OB_CIRCLE , " CIRCLE " , 0 , " Circle " , " " } ,
{ OB_CUBE , " CUBE " , 0 , " Cube " , " " } ,
{ OB_EMPTY_SPHERE , " SPHERE " , 0 , " Sphere " , " " } ,
{ OB_EMPTY_CONE , " CONE " , 0 , " Cone " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-01-02 16:58:09 +00:00
static EnumPropertyItem track_items [ ] = {
2009-06-16 00:52:21 +00:00
{ OB_POSX , " POSX " , 0 , " +X " , " " } ,
{ OB_POSY , " POSY " , 0 , " +Y " , " " } ,
{ OB_POSZ , " POSZ " , 0 , " +Z " , " " } ,
{ OB_NEGX , " NEGX " , 0 , " -X " , " " } ,
{ OB_NEGY , " NEGY " , 0 , " -Y " , " " } ,
{ OB_NEGZ , " NEGZ " , 0 , " -Z " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-01-02 16:58:09 +00:00
static EnumPropertyItem up_items [ ] = {
2009-06-16 00:52:21 +00:00
{ OB_POSX , " X " , 0 , " X " , " " } ,
{ OB_POSY , " Y " , 0 , " Y " , " " } ,
{ OB_POSZ , " Z " , 0 , " Z " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-01-02 16:58:09 +00:00
static EnumPropertyItem drawtype_items [ ] = {
2009-06-16 00:52:21 +00:00
{ OB_BOUNDBOX , " BOUNDS " , 0 , " Bounds " , " " } ,
{ OB_WIRE , " WIRE " , 0 , " Wire " , " " } ,
{ OB_SOLID , " SOLID " , 0 , " Solid " , " " } ,
{ OB_SHADED , " SHADED " , 0 , " Shaded " , " " } ,
{ OB_TEXTURE , " TEXTURED " , 0 , " Textured " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-01-02 13:47:33 +00:00
2009-01-02 16:58:09 +00:00
static EnumPropertyItem boundtype_items [ ] = {
2009-06-16 00:52:21 +00:00
{ OB_BOUND_BOX , " BOX " , 0 , " Box " , " " } ,
{ OB_BOUND_SPHERE , " SPHERE " , 0 , " Sphere " , " " } ,
{ OB_BOUND_CYLINDER , " CYLINDER " , 0 , " Cylinder " , " " } ,
{ OB_BOUND_CONE , " CONE " , 0 , " Cone " , " " } ,
{ OB_BOUND_POLYH , " POLYHEDER " , 0 , " Polyheder " , " " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-01-02 16:58:09 +00:00
2009-04-11 01:43:50 +00:00
static EnumPropertyItem dupli_items [ ] = {
2009-06-16 00:52:21 +00:00
{ 0 , " NONE " , 0 , " None " , " " } ,
{ OB_DUPLIFRAMES , " FRAMES " , 0 , " Frames " , " Make copy of object for every frame. " } ,
{ OB_DUPLIVERTS , " VERTS " , 0 , " Verts " , " Duplicate child objects on all vertices. " } ,
{ OB_DUPLIFACES , " FACES " , 0 , " Faces " , " Duplicate child objects on all faces. " } ,
{ OB_DUPLIGROUP , " GROUP " , 0 , " Group " , " Enable group instancing. " } ,
{ 0 , NULL , 0 , NULL , NULL } } ;
2009-04-11 01:43:50 +00:00
2008-12-19 04:06:24 +00:00
srna = RNA_def_struct ( brna , " Object " , " ID " ) ;
2009-01-10 22:57:33 +00:00
RNA_def_struct_ui_text ( srna , " Object " , " Object datablock defining an object in a scene.. " ) ;
2009-05-29 15:12:31 +00:00
RNA_def_struct_clear_flag ( srna , STRUCT_ID_REFCOUNT ) ;
2009-06-03 23:16:51 +00:00
RNA_def_struct_ui_icon ( srna , ICON_OBJECT_DATA ) ;
2008-11-07 02:58:25 +00:00
2008-11-18 10:57:06 +00:00
prop = RNA_def_property ( srna , " data " , PROP_POINTER , PROP_NONE ) ;
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_def_property_struct_type ( prop , " ID " ) ;
2009-06-07 13:09:18 +00:00
RNA_def_property_pointer_funcs ( prop , NULL , " rna_Object_data_set " , " rna_Object_data_typef " ) ;
RNA_def_property_editable_func ( prop , " rna_Object_data_editable " ) ;
RNA_def_property_flag ( prop , PROP_EDITABLE ) ;
2008-11-18 10:57:06 +00:00
RNA_def_property_ui_text ( prop , " Data " , " Object data. " ) ;
2009-06-07 13:09:18 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , " rna_Object_update_data " ) ;
2008-10-31 23:50:02 +00:00
2009-01-01 20:44:40 +00:00
prop = RNA_def_property ( srna , " layers " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " lay " , 1 ) ;
RNA_def_property_array ( prop , 20 ) ;
RNA_def_property_ui_text ( prop , " Layers " , " Layers the object is on. " ) ;
RNA_def_property_boolean_funcs ( prop , NULL , " rna_Object_layer_set " ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " selected " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , SELECT ) ;
RNA_def_property_ui_text ( prop , " Selected " , " Object selection state. " ) ;
2009-01-01 20:44:40 +00:00
/* parent and track */
2008-11-07 02:58:25 +00:00
prop = RNA_def_property ( srna , " parent " , PROP_POINTER , PROP_NONE ) ;
2008-11-14 17:05:25 +00:00
RNA_def_property_ui_text ( prop , " Parent " , " Parent Object " ) ;
2008-10-31 23:50:02 +00:00
2009-04-24 01:17:54 +00:00
prop = RNA_def_property ( srna , " type " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " type " ) ;
RNA_def_property_enum_items ( prop , object_type_items ) ;
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
RNA_def_property_ui_text ( prop , " Type " , " Type of Object. " ) ;
2009-01-02 13:47:33 +00:00
prop = RNA_def_property ( srna , " parent_type " , PROP_ENUM , PROP_NONE ) ;
2009-04-07 05:01:42 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " partype " ) ;
2009-01-02 13:47:33 +00:00
RNA_def_property_enum_items ( prop , parent_type_items ) ;
2009-03-23 13:24:48 +00:00
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
2009-01-02 13:47:33 +00:00
RNA_def_property_ui_text ( prop , " Parent Type " , " Type of parent relation. " ) ;
prop = RNA_def_property ( srna , " parent_vertices " , PROP_INT , PROP_UNSIGNED ) ;
RNA_def_property_int_sdna ( prop , NULL , " par1 " ) ;
RNA_def_property_array ( prop , 3 ) ;
2009-03-23 13:24:48 +00:00
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
2009-01-02 13:47:33 +00:00
RNA_def_property_ui_text ( prop , " Parent Vertices " , " Indices of vertices in cases of a vertex parenting relation. " ) ;
prop = RNA_def_property ( srna , " parent_bone " , PROP_STRING , PROP_NONE ) ;
RNA_def_property_string_sdna ( prop , NULL , " parsubstr " ) ;
RNA_def_property_ui_text ( prop , " Parent Bone " , " Name of parent bone in case of a bone parenting relation. " ) ;
2008-11-07 02:58:25 +00:00
prop = RNA_def_property ( srna , " track " , PROP_POINTER , PROP_NONE ) ;
2009-05-28 23:23:47 +00:00
RNA_def_property_flag ( prop , PROP_EDITABLE ) ;
2008-11-14 17:05:25 +00:00
RNA_def_property_ui_text ( prop , " Track " , " Object being tracked to define the rotation (Old Track). " ) ;
2008-11-18 10:57:06 +00:00
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " track_axis " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " trackflag " ) ;
RNA_def_property_enum_items ( prop , track_items ) ;
RNA_def_property_ui_text ( prop , " Track Axis " , " Tracking axis pointing to the another object. " ) ;
prop = RNA_def_property ( srna , " up_axis " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " upflag " ) ;
RNA_def_property_enum_items ( prop , up_items ) ;
RNA_def_property_ui_text ( prop , " Up Axis " , " Specify the axis that points up. " ) ;
2009-01-02 13:47:33 +00:00
/* proxy */
prop = RNA_def_property ( srna , " proxy " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_ui_text ( prop , " Proxy " , " Library object this proxy object controls. " ) ;
prop = RNA_def_property ( srna , " proxy_group " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_ui_text ( prop , " Proxy Group " , " Library group duplicator object this proxy object controls. " ) ;
/* materials */
prop = RNA_def_property ( srna , " materials " , PROP_COLLECTION , PROP_NONE ) ;
RNA_def_property_collection_sdna ( prop , NULL , " mat " , " totcol " ) ;
2009-06-03 23:22:43 +00:00
RNA_def_property_struct_type ( prop , " MaterialSlot " ) ;
2009-06-18 19:48:55 +00:00
RNA_def_property_collection_funcs ( prop , NULL , NULL , NULL , " rna_iterator_array_get " , 0 , 0 , 0 , 0 , 0 ) ; /* don't dereference pointer! */
2009-06-03 23:22:43 +00:00
RNA_def_property_ui_text ( prop , " Materials " , " Material slots in the object. " ) ;
2009-01-02 13:47:33 +00:00
2009-01-04 19:25:24 +00:00
prop = RNA_def_property ( srna , " active_material " , PROP_POINTER , PROP_NONE ) ;
2009-06-03 23:22:43 +00:00
RNA_def_property_struct_type ( prop , " MaterialSlot " ) ;
2009-06-07 13:09:18 +00:00
RNA_def_property_pointer_funcs ( prop , " rna_Object_active_material_get " , NULL , NULL ) ;
2009-01-04 19:25:24 +00:00
RNA_def_property_ui_text ( prop , " Active Material " , " Active material being displayed. " ) ;
prop = RNA_def_property ( srna , " active_material_index " , PROP_INT , PROP_UNSIGNED ) ;
2009-01-02 13:47:33 +00:00
RNA_def_property_int_sdna ( prop , NULL , " actcol " ) ;
2009-07-01 22:25:49 +00:00
RNA_def_property_int_funcs ( prop , " rna_Object_active_material_index_get " , " rna_Object_active_material_index_set " , " rna_Object_active_material_index_range " ) ;
2009-06-03 23:22:43 +00:00
RNA_def_property_ui_text ( prop , " Active Material Index " , " Index of active material slot. " ) ;
2009-01-02 16:58:09 +00:00
2009-01-01 20:44:40 +00:00
/* transform */
prop = RNA_def_property ( srna , " location " , PROP_FLOAT , PROP_VECTOR ) ;
RNA_def_property_float_sdna ( prop , NULL , " loc " ) ;
RNA_def_property_ui_text ( prop , " Location " , " Location of the object. " ) ;
RNA_def_property_update ( prop , NC_OBJECT | ND_TRANSFORM , " rna_Object_update " ) ;
prop = RNA_def_property ( srna , " delta_location " , PROP_FLOAT , PROP_VECTOR ) ;
RNA_def_property_float_sdna ( prop , NULL , " dloc " ) ;
RNA_def_property_ui_text ( prop , " Delta Location " , " Extra added translation to object location. " ) ;
2009-01-01 15:52:51 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_TRANSFORM , " rna_Object_update " ) ;
2008-12-02 10:10:07 +00:00
2009-01-01 20:44:40 +00:00
prop = RNA_def_property ( srna , " rotation " , PROP_FLOAT , PROP_ROTATION ) ;
RNA_def_property_float_sdna ( prop , NULL , " rot " ) ;
RNA_def_property_ui_text ( prop , " Rotation " , " Rotation of the object. " ) ;
RNA_def_property_update ( prop , NC_OBJECT | ND_TRANSFORM , " rna_Object_update " ) ;
prop = RNA_def_property ( srna , " delta_rotation " , PROP_FLOAT , PROP_ROTATION ) ;
RNA_def_property_float_sdna ( prop , NULL , " drot " ) ;
RNA_def_property_ui_text ( prop , " Delta Rotation " , " Extra added rotation to the rotation of the object. " ) ;
2009-01-01 15:52:51 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_TRANSFORM , " rna_Object_update " ) ;
2008-12-02 10:10:07 +00:00
2009-01-01 20:44:40 +00:00
prop = RNA_def_property ( srna , " scale " , PROP_FLOAT , PROP_VECTOR ) ;
RNA_def_property_float_sdna ( prop , NULL , " size " ) ;
RNA_def_property_ui_text ( prop , " Scale " , " Scaling of the object. " ) ;
RNA_def_property_update ( prop , NC_OBJECT | ND_TRANSFORM , " rna_Object_update " ) ;
prop = RNA_def_property ( srna , " delta_scale " , PROP_FLOAT , PROP_VECTOR ) ;
RNA_def_property_float_sdna ( prop , NULL , " dsize " ) ;
RNA_def_property_ui_text ( prop , " Delta Scale " , " Extra added scaling to the scale of the object. " ) ;
2009-01-01 15:52:51 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_TRANSFORM , " rna_Object_update " ) ;
2008-12-26 16:50:05 +00:00
2009-01-02 13:47:33 +00:00
prop = RNA_def_property ( srna , " lock_location " , PROP_BOOLEAN , PROP_VECTOR ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " protectflag " , OB_LOCK_LOCX ) ;
RNA_def_property_array ( prop , 3 ) ;
RNA_def_property_ui_text ( prop , " Lock Location " , " Lock editing of location in the interface. " ) ;
prop = RNA_def_property ( srna , " lock_rotation " , PROP_BOOLEAN , PROP_VECTOR ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " protectflag " , OB_LOCK_ROTX ) ;
RNA_def_property_array ( prop , 3 ) ;
RNA_def_property_ui_text ( prop , " Lock Rotation " , " Lock editing of rotation in the interface. " ) ;
prop = RNA_def_property ( srna , " lock_scale " , PROP_BOOLEAN , PROP_VECTOR ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " protectflag " , OB_LOCK_SCALEX ) ;
RNA_def_property_array ( prop , 3 ) ;
RNA_def_property_ui_text ( prop , " Lock Scale " , " Lock editing of scale in the interface. " ) ;
2009-06-18 19:48:55 +00:00
/* matrix */
prop = RNA_def_property ( srna , " matrix " , PROP_FLOAT , PROP_MATRIX ) ;
RNA_def_property_float_sdna ( prop , NULL , " obmat " ) ;
RNA_def_property_array ( prop , 16 ) ;
RNA_def_property_ui_text ( prop , " Matrix " , " Transformation matrix. " ) ;
2009-01-01 20:44:40 +00:00
/* collections */
2008-12-12 23:30:23 +00:00
prop = RNA_def_property ( srna , " constraints " , PROP_COLLECTION , PROP_NONE ) ;
RNA_def_property_struct_type ( prop , " Constraint " ) ;
2009-01-02 13:47:33 +00:00
RNA_def_property_ui_text ( prop , " Constraints " , " Constraints of the object. " ) ;
2008-12-01 13:01:48 +00:00
prop = RNA_def_property ( srna , " modifiers " , PROP_COLLECTION , PROP_NONE ) ;
2008-12-02 23:45:11 +00:00
RNA_def_property_struct_type ( prop , " Modifier " ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Modifiers " , " Modifiers affecting the geometric data of the Object. " ) ;
2008-12-01 13:01:48 +00:00
2009-01-01 20:44:40 +00:00
/* game engine */
2008-11-30 14:40:00 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " game " , PROP_POINTER , PROP_NEVER_NULL ) ;
RNA_def_property_struct_type ( prop , " GameObjectSettings " ) ;
2009-06-07 13:09:18 +00:00
RNA_def_property_pointer_funcs ( prop , " rna_Object_game_settings_get " , NULL , NULL ) ;
2009-01-01 20:44:40 +00:00
RNA_def_property_ui_text ( prop , " Game Settings " , " Game engine related settings for the object. " ) ;
2008-11-30 14:40:00 +00:00
2009-01-01 20:44:40 +00:00
/* vertex groups */
2008-11-30 19:52:21 +00:00
2009-01-01 20:44:40 +00:00
prop = RNA_def_property ( srna , " vertex_groups " , PROP_COLLECTION , PROP_NONE ) ;
RNA_def_property_collection_sdna ( prop , NULL , " defbase " , NULL ) ;
RNA_def_property_struct_type ( prop , " VertexGroup " ) ;
RNA_def_property_ui_text ( prop , " Vertex Groups " , " Vertex groups of the object. " ) ;
prop = RNA_def_property ( srna , " active_vertex_group " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_struct_type ( prop , " VertexGroup " ) ;
2009-07-01 22:25:49 +00:00
RNA_def_property_pointer_funcs ( prop , " rna_Object_active_vertex_group_get " , " rna_Object_active_vertex_group_set " , NULL ) ;
2009-01-01 20:44:40 +00:00
RNA_def_property_ui_text ( prop , " Active Vertex Group " , " Vertex groups of the object. " ) ;
2009-07-01 22:25:49 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_GEOM_DATA , " rna_Object_update_data " ) ;
prop = RNA_def_property ( srna , " active_vertex_group_index " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " actdef " ) ;
RNA_def_property_int_funcs ( prop , " rna_Object_active_vertex_group_index_get " , " rna_Object_active_vertex_group_index_set " , " rna_Object_active_vertex_group_index_range " ) ;
RNA_def_property_ui_text ( prop , " Active Vertex Group Index " , " Active index in vertex group array. " ) ;
RNA_def_property_update ( prop , NC_OBJECT | ND_GEOM_DATA , " rna_Object_update_data " ) ;
2009-01-01 20:44:40 +00:00
2009-01-02 13:47:33 +00:00
/* empty */
prop = RNA_def_property ( srna , " empty_draw_type " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " empty_drawtype " ) ;
RNA_def_property_enum_items ( prop , empty_drawtype_items ) ;
RNA_def_property_ui_text ( prop , " Empty Draw Type " , " Viewport display style for empties. " ) ;
2009-05-11 17:34:31 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , NULL ) ;
2009-01-02 13:47:33 +00:00
prop = RNA_def_property ( srna , " empty_draw_size " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " empty_drawsize " ) ;
RNA_def_property_range ( prop , 0.01 , 10.0 ) ;
RNA_def_property_ui_text ( prop , " Empty Draw Size " , " Size of of display for empties in the viewport. " ) ;
2009-05-11 17:34:31 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , NULL ) ;
2009-01-02 13:47:33 +00:00
2009-01-02 16:58:09 +00:00
/* render */
2009-01-01 20:44:40 +00:00
prop = RNA_def_property ( srna , " pass_index " , PROP_INT , PROP_UNSIGNED ) ;
RNA_def_property_int_sdna ( prop , NULL , " index " ) ;
RNA_def_property_ui_text ( prop , " Pass Index " , " Index # for the IndexOB render pass. " ) ;
prop = RNA_def_property ( srna , " color " , PROP_FLOAT , PROP_COLOR ) ;
RNA_def_property_float_sdna ( prop , NULL , " col " ) ;
RNA_def_property_ui_text ( prop , " Color " , " Object color and alpha, used when faces have the ObColor mode enabled. " ) ;
2009-01-02 13:47:33 +00:00
/* physics */
prop = RNA_def_property ( srna , " field " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " pd " ) ;
RNA_def_property_struct_type ( prop , " FieldSettings " ) ;
RNA_def_property_ui_text ( prop , " Field Settings " , " Settings for using the objects as a field in physics simulation. " ) ;
prop = RNA_def_property ( srna , " collision " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " pd " ) ;
RNA_def_property_struct_type ( prop , " CollisionSettings " ) ;
RNA_def_property_ui_text ( prop , " Collision Settings " , " Settings for using the objects as a collider in physics simulation. " ) ;
prop = RNA_def_property ( srna , " soft_body " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " soft " ) ;
RNA_def_property_ui_text ( prop , " Soft Body Settings " , " Settings for soft body simulation. " ) ;
prop = RNA_def_property ( srna , " particle_systems " , PROP_COLLECTION , PROP_NONE ) ;
RNA_def_property_collection_sdna ( prop , NULL , " particlesystem " , NULL ) ;
RNA_def_property_struct_type ( prop , " ParticleSystem " ) ;
RNA_def_property_ui_text ( prop , " Particle Systems " , " Particle systems emitted from the object. " ) ;
2009-06-01 11:39:11 +00:00
prop = RNA_def_property ( srna , " active_particle_system " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_struct_type ( prop , " ParticleSystem " ) ;
2009-06-07 13:09:18 +00:00
RNA_def_property_pointer_funcs ( prop , " rna_Object_active_particle_system_get " , NULL , NULL ) ;
2009-06-01 11:39:11 +00:00
RNA_def_property_ui_text ( prop , " Active Particle System " , " Active particle system being displayed " ) ;
2009-06-27 15:41:47 +00:00
prop = RNA_def_property ( srna , " active_particle_system_index " , PROP_INT , PROP_UNSIGNED ) ;
RNA_def_property_int_funcs ( prop , " rna_Object_active_particle_system_index_get " , " rna_Object_active_particle_system_index_set " , " rna_Object_active_particle_system_index_range " ) ;
RNA_def_property_ui_text ( prop , " Active Particle System Index " , " Index of active particle system slot. " ) ;
2009-01-02 13:47:33 +00:00
/* restrict */
prop = RNA_def_property ( srna , " restrict_view " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " restrictflag " , OB_RESTRICT_VIEW ) ;
RNA_def_property_ui_text ( prop , " Restrict View " , " Restrict visibility in the viewport. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , NULL ) ;
2009-01-02 13:47:33 +00:00
prop = RNA_def_property ( srna , " restrict_select " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " restrictflag " , OB_RESTRICT_SELECT ) ;
RNA_def_property_ui_text ( prop , " Restrict Select " , " Restrict selection in the viewport. " ) ;
prop = RNA_def_property ( srna , " restrict_render " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " restrictflag " , OB_RESTRICT_RENDER ) ;
RNA_def_property_ui_text ( prop , " Restrict Render " , " Restrict renderability. " ) ;
2009-01-02 16:58:09 +00:00
/* anim */
2009-02-02 11:51:10 +00:00
rna_def_animdata_common ( srna ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " draw_keys " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " ipoflag " , OB_DRAWKEY ) ;
2009-03-23 13:24:48 +00:00
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ; // update ipo flag indirect
2009-01-02 16:58:09 +00:00
RNA_def_property_ui_text ( prop , " Draw Keys " , " Draw object as key positions. " ) ;
prop = RNA_def_property ( srna , " draw_keys_selected " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " ipoflag " , OB_DRAWKEYSEL ) ;
RNA_def_property_ui_text ( prop , " Draw Keys Selected " , " Limit the drawing of object keys to selected. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , NULL ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " track_rotation " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " transflag " , OB_POWERTRACK ) ;
RNA_def_property_ui_text ( prop , " Track Rotation " , " Switch object rotation of in tracking. " ) ;
prop = RNA_def_property ( srna , " slow_parent " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " partype " , PARSLOW ) ;
RNA_def_property_ui_text ( prop , " Slow Parent " , " Create a delay in the parent relationship. " ) ;
2009-04-11 01:43:50 +00:00
prop = RNA_def_property ( srna , " dupli_type " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_bitflag_sdna ( prop , NULL , " transflag " ) ;
RNA_def_property_enum_items ( prop , dupli_items ) ;
RNA_def_property_ui_text ( prop , " Dupli Type " , " If not None, object duplication method to use. " ) ;
2009-05-27 00:03:49 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , " rna_Object_dependency_update " ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " dupli_frames_no_speed " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " transflag " , OB_DUPLINOSPEED ) ;
RNA_def_property_ui_text ( prop , " Dupli Frames No Speed " , " Set dupliframes to still, regardless of frame. " ) ;
2009-05-28 23:23:47 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , " rna_Object_update " ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " dupli_verts_rotation " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " transflag " , OB_DUPLIROT ) ;
RNA_def_property_ui_text ( prop , " Dupli Verts Rotation " , " Rotate dupli according to vertex normal. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , NULL ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " dupli_faces_inherit_scale " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " transflag " , OB_DUPLIROT ) ;
RNA_def_property_ui_text ( prop , " Dupli Faces Inherit Scale " , " Scale dupli based on face size. " ) ;
2009-05-28 23:23:47 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , " rna_Object_update " ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " dupli_faces_scale " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " dupfacesca " ) ;
2009-02-02 11:51:10 +00:00
RNA_def_property_range ( prop , 0.001f , 10000.0f ) ;
2009-01-02 16:58:09 +00:00
RNA_def_property_ui_text ( prop , " Dupli Faces Scale " , " Scale the DupliFace objects. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , NULL ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " dupli_group " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " dup_group " ) ;
2009-05-28 23:23:47 +00:00
RNA_def_property_flag ( prop , PROP_EDITABLE ) ;
2009-01-02 16:58:09 +00:00
RNA_def_property_ui_text ( prop , " Dupli Group " , " Instance an existing group. " ) ;
2009-05-28 23:23:47 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , " rna_Object_dependency_update " ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " dupli_frames_start " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " dupsta " ) ;
RNA_def_property_range ( prop , 1 , 32767 ) ;
RNA_def_property_ui_text ( prop , " Dupli Frames Start " , " Start frame for DupliFrames. " ) ;
2009-05-28 23:23:47 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , " rna_Object_update " ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " dupli_frames_end " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " dupend " ) ;
RNA_def_property_range ( prop , 1 , 32767 ) ;
RNA_def_property_ui_text ( prop , " Dupli Frames End " , " End frame for DupliFrames. " ) ;
2009-05-28 23:23:47 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , " rna_Object_update " ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " dupli_frames_on " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " dupon " ) ;
RNA_def_property_range ( prop , 1 , 1500 ) ;
RNA_def_property_ui_text ( prop , " Dupli Frames On " , " Number of frames to use between DupOff frames. " ) ;
2009-05-28 23:23:47 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , " rna_Object_update " ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " dupli_frames_off " , PROP_INT , PROP_NONE ) ;
RNA_def_property_int_sdna ( prop , NULL , " dupoff " ) ;
RNA_def_property_range ( prop , 0 , 1500 ) ;
RNA_def_property_ui_text ( prop , " Dupli Frames Off " , " Recurring frames to exclude from the Dupliframes. " ) ;
2009-05-28 23:23:47 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , " rna_Object_update " ) ;
2009-01-02 16:58:09 +00:00
/* time offset */
prop = RNA_def_property ( srna , " time_offset " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " sf " ) ;
RNA_def_property_range ( prop , - MAXFRAMEF , MAXFRAMEF ) ;
2009-06-08 20:08:19 +00:00
RNA_def_property_ui_text ( prop , " Time Offset " , " Animation offset in frames for IPO's and dupligroup instances. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_TRANSFORM , " rna_Object_update " ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " time_offset_edit " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " ipoflag " , OB_OFFS_OB ) ;
2009-06-08 20:08:19 +00:00
RNA_def_property_ui_text ( prop , " Time Offset Edit " , " Use time offset when inserting keys and display time offset for IPO and action views. " ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " time_offset_parent " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " ipoflag " , OB_OFFS_PARENT ) ;
RNA_def_property_ui_text ( prop , " Time Offset Parent " , " Apply the time offset to this objects parent relationship. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_TRANSFORM , " rna_Object_update " ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " time_offset_particle " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " ipoflag " , OB_OFFS_PARTICLE ) ;
RNA_def_property_ui_text ( prop , " Time Offset Particle " , " Let the time offset work on the particle effect. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_TRANSFORM , " rna_Object_update " ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " time_offset_add_parent " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " ipoflag " , OB_OFFS_PARENTADD ) ;
RNA_def_property_ui_text ( prop , " Time Offset Add Parent " , " Add the parents time offset value " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_TRANSFORM , " rna_Object_update " ) ;
2009-01-02 16:58:09 +00:00
/* script link */
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " script_link " , PROP_POINTER , PROP_NEVER_NULL ) ;
2009-01-02 16:58:09 +00:00
RNA_def_property_pointer_sdna ( prop , NULL , " scriptlink " ) ;
RNA_def_property_ui_text ( prop , " Script Link " , " Scripts linked to this object. " ) ;
/* drawing */
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " max_draw_type " , PROP_ENUM , PROP_NONE ) ;
2009-01-02 16:58:09 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " dt " ) ;
RNA_def_property_enum_items ( prop , drawtype_items ) ;
RNA_def_property_ui_text ( prop , " Maximum Draw Type " , " Maximum draw type to display object with in viewport. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , NULL ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " draw_bounds " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " dtx " , OB_BOUNDBOX ) ;
RNA_def_property_ui_text ( prop , " Draw Bounds " , " Displays the object's bounds. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , NULL ) ;
2009-01-02 16:58:09 +00:00
2009-03-13 13:38:41 +00:00
prop = RNA_def_property ( srna , " draw_bounds_type " , PROP_ENUM , PROP_NONE ) ;
2009-01-02 16:58:09 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " boundtype " ) ;
RNA_def_property_enum_items ( prop , boundtype_items ) ;
RNA_def_property_ui_text ( prop , " Draw Bounds Type " , " Object boundary display type. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , NULL ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " draw_name " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " dtx " , OB_DRAWNAME ) ;
RNA_def_property_ui_text ( prop , " Draw Name " , " Displays the object's name. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , NULL ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " draw_axis " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " dtx " , OB_AXIS ) ;
RNA_def_property_ui_text ( prop , " Draw Axis " , " Displays the object's center and axis " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , NULL ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " draw_texture_space " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " dtx " , OB_TEXSPACE ) ;
RNA_def_property_ui_text ( prop , " Draw Texture Space " , " Displays the object's texture space. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , NULL ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " draw_wire " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " dtx " , OB_DRAWWIRE ) ;
RNA_def_property_ui_text ( prop , " Draw Wire " , " Adds the object's wireframe over solid drawing. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , NULL ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " draw_transparent " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " dtx " , OB_DRAWTRANSP ) ;
RNA_def_property_ui_text ( prop , " Draw Transparent " , " Enables transparent materials for the object (Mesh only). " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , NULL ) ;
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " x_ray " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " dtx " , OB_DRAWXRAY ) ;
RNA_def_property_ui_text ( prop , " X-Ray " , " Makes the object draw in front of others. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_DRAW , NULL ) ;
2009-02-02 11:51:10 +00:00
/* pose */
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " pose_library " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " poselib " ) ;
2009-01-07 04:06:52 +00:00
RNA_def_property_struct_type ( prop , " Action " ) ;
2009-01-02 16:58:09 +00:00
RNA_def_property_ui_text ( prop , " Pose Library " , " Action used as a pose library for armatures. " ) ;
prop = RNA_def_property ( srna , " pose " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " pose " ) ;
2009-01-07 04:06:52 +00:00
RNA_def_property_struct_type ( prop , " Pose " ) ;
2009-01-02 16:58:09 +00:00
RNA_def_property_ui_text ( prop , " Pose " , " Current pose for armatures. " ) ;
prop = RNA_def_property ( srna , " pose_mode " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " flag " , OB_POSEMODE ) ;
2009-03-23 13:24:48 +00:00
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
2009-01-02 16:58:09 +00:00
RNA_def_property_ui_text ( prop , " Pose Mode " , " Object with armature data is in pose mode. " ) ;
2009-02-02 11:51:10 +00:00
// XXX this stuff should be moved to AnimData...
/*
2009-01-02 16:58:09 +00:00
prop = RNA_def_property ( srna , " nla_disable_path " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " nlaflag " , OB_DISABLE_PATH ) ;
RNA_def_property_ui_text ( prop , " NLA Disable Path " , " Disable path temporally, for editing cycles. " ) ;
prop = RNA_def_property ( srna , " nla_collapsed " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " nlaflag " , OB_NLA_COLLAPSED ) ;
2009-03-23 13:24:48 +00:00
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
2009-01-02 16:58:09 +00:00
RNA_def_property_ui_text ( prop , " NLA Collapsed " , " " ) ;
prop = RNA_def_property ( srna , " nla_override " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " nlaflag " , OB_NLA_OVERRIDE ) ;
2009-03-23 13:24:48 +00:00
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
2009-01-02 16:58:09 +00:00
RNA_def_property_ui_text ( prop , " NLA Override " , " " ) ;
prop = RNA_def_property ( srna , " nla_strips " , PROP_COLLECTION , PROP_NONE ) ;
RNA_def_property_collection_sdna ( prop , NULL , " nlastrips " , NULL ) ;
RNA_def_property_struct_type ( prop , " UnknownType " ) ;
2009-03-23 13:24:48 +00:00
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
2009-01-02 16:58:09 +00:00
RNA_def_property_ui_text ( prop , " NLA Strips " , " NLA strips of the object. " ) ;
2009-02-02 11:51:10 +00:00
*/
2009-01-02 16:58:09 +00:00
/* shape keys */
prop = RNA_def_property ( srna , " shape_key_lock " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " shapeflag " , OB_SHAPE_LOCK ) ;
2009-07-01 22:25:49 +00:00
RNA_def_property_boolean_funcs ( prop , NULL , " rna_Object_shape_key_lock_set " ) ;
2009-01-02 16:58:09 +00:00
RNA_def_property_ui_text ( prop , " Shape Key Lock " , " Always show the current Shape for this Object. " ) ;
2009-07-01 22:25:49 +00:00
RNA_def_property_update ( prop , NC_OBJECT | ND_GEOM_DATA , " rna_Object_update_data " ) ;
2009-01-02 16:58:09 +00:00
2009-07-01 22:25:49 +00:00
prop = RNA_def_property ( srna , " active_shape_key_index " , PROP_INT , PROP_NONE ) ;
2009-01-02 16:58:09 +00:00
RNA_def_property_int_sdna ( prop , NULL , " shapenr " ) ;
2009-07-01 22:25:49 +00:00
RNA_def_property_int_funcs ( prop , " rna_Object_active_shape_key_index_get " , " rna_Object_active_shape_key_index_set " , " rna_Object_active_shape_key_index_range " ) ;
RNA_def_property_ui_text ( prop , " Active Shape Key Index " , " Current shape key index. " ) ;
RNA_def_property_update ( prop , NC_OBJECT | ND_GEOM_DATA , " rna_Object_update_data " ) ;
2009-06-18 19:48:55 +00:00
RNA_api_object ( srna ) ;
2009-01-01 20:44:40 +00:00
}
void RNA_def_object ( BlenderRNA * brna )
{
2009-01-10 22:57:33 +00:00
rna_def_object ( brna ) ;
rna_def_object_game_settings ( brna ) ;
2009-01-02 13:47:33 +00:00
rna_def_vertex_group ( brna ) ;
2009-06-03 23:22:43 +00:00
rna_def_material_slot ( brna ) ;
2008-10-31 23:50:02 +00:00
}
2002-10-12 11:37:38 +00:00
# endif
2002-10-30 02:07:20 +00:00