2008-11-27 00:23:22 +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 ,
* Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*
* Contributor ( s ) : Blender Foundation ( 2008 ) , Nathan Letwory
*
* * * * * * END GPL LICENSE BLOCK * * * * *
*/
2009-01-05 05:09:20 +00:00
# include <float.h>
2008-11-27 00:23:22 +00:00
# include <stdlib.h>
# include "RNA_define.h"
# include "RNA_types.h"
# include "rna_internal.h"
# include "DNA_material_types.h"
2009-01-03 19:39:39 +00:00
# include "DNA_texture_types.h"
2008-11-27 00:23:22 +00:00
2009-01-03 05:41:58 +00:00
# include "WM_types.h"
2008-11-27 00:23:22 +00:00
# ifdef RNA_RUNTIME
2009-02-02 19:57:57 +00:00
static PointerRNA rna_Material_mirror_get ( PointerRNA * ptr )
2009-01-03 20:20:09 +00:00
{
2009-02-02 19:57:57 +00:00
return rna_pointer_inherit_refine ( ptr , & RNA_MaterialRaytraceMirror , ptr - > id . data ) ;
}
static PointerRNA rna_Material_transp_get ( PointerRNA * ptr )
{
return rna_pointer_inherit_refine ( ptr , & RNA_MaterialRaytraceTransparency , ptr - > id . data ) ;
}
static PointerRNA rna_Material_halo_get ( PointerRNA * ptr )
{
return rna_pointer_inherit_refine ( ptr , & RNA_MaterialHalo , ptr - > id . data ) ;
}
static PointerRNA rna_Material_sss_get ( PointerRNA * ptr )
{
return rna_pointer_inherit_refine ( ptr , & RNA_MaterialSubsurfaceScattering , ptr - > id . data ) ;
}
static PointerRNA rna_Material_strand_get ( PointerRNA * ptr )
{
return rna_pointer_inherit_refine ( ptr , & RNA_MaterialStrand , ptr - > id . data ) ;
2009-01-03 20:20:09 +00:00
}
2009-05-20 13:34:04 +00:00
static void rna_Material_type_set ( PointerRNA * ptr , int value )
2008-12-26 00:10:29 +00:00
{
2009-01-10 22:57:33 +00:00
Material * ma = ( Material * ) ptr - > data ;
2009-05-20 13:34:04 +00:00
if ( ma - > material_type = = MA_TYPE_HALO & & value ! = MA_TYPE_HALO )
ma - > mode & = ~ ( MA_STAR | MA_HALO_XALPHA | MA_ZINV | MA_ENV ) ;
ma - > material_type = value ;
2008-12-26 00:10:29 +00:00
}
2009-01-03 19:39:39 +00:00
static void rna_Material_mtex_begin ( CollectionPropertyIterator * iter , PointerRNA * ptr )
{
2009-01-10 22:57:33 +00:00
Material * ma = ( Material * ) ptr - > data ;
rna_iterator_array_begin ( iter , ( void * ) ma - > mtex , sizeof ( MTex * ) , MAX_MTEX , NULL ) ;
}
2009-02-02 19:57:57 +00:00
static PointerRNA rna_Material_active_texture_get ( PointerRNA * ptr )
2009-01-10 22:57:33 +00:00
{
Material * ma = ( Material * ) ptr - > data ;
2009-02-02 19:57:57 +00:00
return rna_pointer_inherit_refine ( ptr , & RNA_TextureSlot , ma - > mtex [ ( int ) ma - > texact ] ) ;
2009-01-10 22:57:33 +00:00
}
static void rna_MaterialStrand_start_size_range ( PointerRNA * ptr , float * min , float * max )
{
Material * ma = ( Material * ) ptr - > id . data ;
if ( ma - > mode & MA_STR_B_UNITS ) {
* min = 0.0001f ;
* max = 2.0f ;
}
else {
* min = 0.25f ;
* max = 20.0f ;
}
}
static void rna_MaterialStrand_end_size_range ( PointerRNA * ptr , float * min , float * max )
{
Material * ma = ( Material * ) ptr - > id . data ;
if ( ma - > mode & MA_STR_B_UNITS ) {
* min = 0.0001f ;
* max = 1.0f ;
}
else {
* min = 0.25f ;
* max = 10.0f ;
}
2009-01-03 19:39:39 +00:00
}
2008-11-27 00:23:22 +00:00
# else
2009-01-10 22:57:33 +00:00
static void rna_def_material_mtex ( BlenderRNA * brna )
{
StructRNA * srna ;
PropertyRNA * prop ;
static EnumPropertyItem prop_texture_coordinates_items [ ] = {
{ TEXCO_GLOB , " GLOBAL " , " Global " , " Uses global coordinates for the texture coordinates. " } ,
{ TEXCO_OBJECT , " OBJECT " , " Object " , " Uses linked object's coordinates for texture coordinates. " } ,
{ TEXCO_UV , " UV " , " UV " , " Uses UV coordinates for texture coordinates. " } ,
2009-06-11 18:19:08 +00:00
{ TEXCO_ORCO , " ORCO " , " Generated " , " Uses the original undeformed coordinates of the object. " } ,
2009-01-10 22:57:33 +00:00
{ TEXCO_STRAND , " STRAND " , " Strand " , " Uses normalized strand texture coordinate (1D). " } ,
{ TEXCO_STICKY , " STICKY " , " Sticky " , " Uses mesh's sticky coordinates for the texture coordinates. " } ,
{ TEXCO_WINDOW , " WINDOW " , " Window " , " Uses screen coordinates as texture coordinates. " } ,
{ TEXCO_NORM , " NORMAL " , " Normal " , " Uses normal vector as texture coordinates. " } ,
{ TEXCO_REFL , " REFLECTION " , " Reflection " , " Uses reflection vector as texture coordinates. " } ,
{ TEXCO_STRESS , " STRESS " , " Stress " , " Uses the difference of edge lengths compared to original coordinates of the mesh. " } ,
{ TEXCO_SPEED , " TANGENT " , " Tangent " , " Uses the optional tangent vector as texture coordinates. " } ,
{ 0 , NULL , NULL , NULL } } ;
static EnumPropertyItem prop_mapping_items [ ] = {
{ MTEX_FLAT , " FLAT " , " Flat " , " Maps X and Y coordinates directly. " } ,
{ MTEX_CUBE , " CUBE " , " Cube " , " Maps using the normal vector. " } ,
{ MTEX_TUBE , " TUBE " , " Tube " , " Maps with Z as central axis. " } ,
{ MTEX_SPHERE , " SPHERE " , " Sphere " , " Maps with Z as central axis. " } ,
{ 0 , NULL , NULL , NULL } } ;
2009-06-09 16:04:07 +00:00
static EnumPropertyItem prop_x_mapping_items [ ] = {
{ 0 , " NONE " , " None " , " " } ,
{ 1 , " X " , " X " , " " } ,
{ 2 , " Y " , " Y " , " " } ,
{ 3 , " Z " , " Z " , " " } ,
{ 0 , NULL , NULL , NULL } } ;
static EnumPropertyItem prop_y_mapping_items [ ] = {
{ 0 , " NONE " , " None " , " " } ,
{ 1 , " X " , " X " , " " } ,
{ 2 , " Y " , " Y " , " " } ,
{ 3 , " Z " , " Z " , " " } ,
{ 0 , NULL , NULL , NULL } } ;
static EnumPropertyItem prop_z_mapping_items [ ] = {
{ 0 , " NONE " , " None " , " " } ,
{ 1 , " X " , " X " , " " } ,
{ 2 , " Y " , " Y " , " " } ,
{ 3 , " Z " , " Z " , " " } ,
{ 0 , NULL , NULL , NULL } } ;
2009-01-10 22:57:33 +00:00
static EnumPropertyItem prop_normal_map_space_items [ ] = {
{ MTEX_NSPACE_CAMERA , " CAMERA " , " Camera " , " " } ,
{ MTEX_NSPACE_WORLD , " WORLD " , " World " , " " } ,
{ MTEX_NSPACE_OBJECT , " OBJECT " , " Object " , " " } ,
{ MTEX_NSPACE_TANGENT , " TANGENT " , " Tangent " , " " } ,
{ 0 , NULL , NULL , NULL } } ;
srna = RNA_def_struct ( brna , " MaterialTextureSlot " , " TextureSlot " ) ;
RNA_def_struct_sdna ( srna , " MTex " ) ;
RNA_def_struct_ui_text ( srna , " Material Texture Slot " , " Texture slot for textures in a Material datablock. " ) ;
prop = RNA_def_property ( srna , " texture_coordinates " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " texco " ) ;
RNA_def_property_enum_items ( prop , prop_texture_coordinates_items ) ;
RNA_def_property_ui_text ( prop , " Texture Coordinates " , " " ) ;
prop = RNA_def_property ( srna , " object " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " object " ) ;
RNA_def_property_struct_type ( prop , " Object " ) ;
2009-05-28 23:23:47 +00:00
RNA_def_property_flag ( prop , PROP_EDITABLE ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Object " , " Object to use for mapping with Object texture coordinates. " ) ;
prop = RNA_def_property ( srna , " uv_layer " , PROP_STRING , PROP_NONE ) ;
RNA_def_property_string_sdna ( prop , NULL , " uvname " ) ;
RNA_def_property_ui_text ( prop , " UV Layer " , " UV layer to use for mapping with UV texture coordinates. " ) ;
prop = RNA_def_property ( srna , " from_dupli " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " texflag " , MTEX_DUPLI_MAPTO ) ;
RNA_def_property_ui_text ( prop , " From Dupli " , " Dupli's instanced from verts, faces or particles, inherit texture coordinate from their parent (only for UV and Orco texture coordinates). " ) ;
2009-06-09 16:04:07 +00:00
prop = RNA_def_property ( srna , " map_color " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mapto " , MAP_COL ) ;
RNA_def_property_ui_text ( prop , " Color " , " Causes the texture to affect basic color of the material " ) ;
prop = RNA_def_property ( srna , " map_normal " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mapto " , MAP_NORM ) ;
RNA_def_property_ui_text ( prop , " Normal " , " Causes the texture to affect the rendered normal " ) ;
prop = RNA_def_property ( srna , " map_colorspec " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mapto " , MAP_COLSPEC ) ;
RNA_def_property_ui_text ( prop , " Specularity Color " , " Causes the texture to affect the specularity color " ) ;
prop = RNA_def_property ( srna , " map_mirror " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mapto " , MAP_COLMIR ) ;
RNA_def_property_ui_text ( prop , " Mirror " , " Causes the texture to affect the mirror color " ) ;
prop = RNA_def_property ( srna , " map_reflection " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mapto " , MAP_REF ) ;
RNA_def_property_ui_text ( prop , " Reflection " , " Causes the texture to affect the value of the materials reflectivity " ) ;
prop = RNA_def_property ( srna , " map_specularity " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mapto " , MAP_SPEC ) ;
RNA_def_property_ui_text ( prop , " Specularity " , " Causes the texture to affect the value of specularity " ) ;
prop = RNA_def_property ( srna , " map_ambient " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mapto " , MAP_AMB ) ;
RNA_def_property_ui_text ( prop , " Ambient " , " Causes the texture to affect the value of ambient " ) ;
prop = RNA_def_property ( srna , " map_hardness " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mapto " , MAP_HAR ) ;
RNA_def_property_ui_text ( prop , " Hardness " , " Causes the texture to affect the hardness value " ) ;
prop = RNA_def_property ( srna , " map_raymir " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mapto " , MAP_RAYMIRR ) ;
RNA_def_property_ui_text ( prop , " Ray-Mirror " , " Causes the texture to affect the ray-mirror value " ) ;
prop = RNA_def_property ( srna , " map_alpha " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mapto " , MAP_ALPHA ) ;
RNA_def_property_ui_text ( prop , " Alpha " , " Causes the texture to affect the alpha value " ) ;
prop = RNA_def_property ( srna , " map_emit " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mapto " , MAP_EMIT ) ;
RNA_def_property_ui_text ( prop , " Emit " , " Causes the texture to affect the emit value " ) ;
prop = RNA_def_property ( srna , " map_translucency " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mapto " , MAP_TRANSLU ) ;
RNA_def_property_ui_text ( prop , " Translucency " , " Causes the texture to affect the translucency value " ) ;
prop = RNA_def_property ( srna , " map_displacement " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mapto " , MAP_DISPLACE ) ;
RNA_def_property_ui_text ( prop , " Displacement " , " Let the texture displace the surface " ) ;
prop = RNA_def_property ( srna , " map_warp " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mapto " , MAP_WARP ) ;
RNA_def_property_ui_text ( prop , " Warp " , " Let the texture warp texture coordinates of next channels " ) ;
prop = RNA_def_property ( srna , " x_mapping " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " projx " ) ;
RNA_def_property_enum_items ( prop , prop_x_mapping_items ) ;
RNA_def_property_ui_text ( prop , " X Mapping " , " " ) ;
prop = RNA_def_property ( srna , " y_mapping " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " projy " ) ;
RNA_def_property_enum_items ( prop , prop_y_mapping_items ) ;
RNA_def_property_ui_text ( prop , " Y Mapping " , " " ) ;
prop = RNA_def_property ( srna , " z_mapping " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " projz " ) ;
RNA_def_property_enum_items ( prop , prop_z_mapping_items ) ;
RNA_def_property_ui_text ( prop , " Z Mapping " , " " ) ;
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " mapping " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_items ( prop , prop_mapping_items ) ;
RNA_def_property_ui_text ( prop , " Mapping " , " " ) ;
2009-05-20 13:34:04 +00:00
/* XXX: pmapto, pmaptoneg */
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " normal_map_space " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " normapspace " ) ;
RNA_def_property_enum_items ( prop , prop_normal_map_space_items ) ;
RNA_def_property_ui_text ( prop , " Normal Map Space " , " " ) ;
/* XXX: MTex.which_output */
/* XXX: MTex.k */
prop = RNA_def_property ( srna , " displacement_factor " , PROP_FLOAT , PROP_VECTOR ) ;
RNA_def_property_float_sdna ( prop , NULL , " dispfac " ) ;
RNA_def_property_range ( prop , 0 , 1 ) ;
RNA_def_property_ui_text ( prop , " Displacement Factor " , " Amount texture displaces the surface. " ) ;
prop = RNA_def_property ( srna , " warp_factor " , PROP_FLOAT , PROP_VECTOR ) ;
RNA_def_property_float_sdna ( prop , NULL , " warpfac " ) ;
RNA_def_property_range ( prop , 0 , 1 ) ;
RNA_def_property_ui_text ( prop , " Warp Factor " , " Amount texture affects color values. " ) ;
}
static void rna_def_material_colors ( StructRNA * srna )
2008-11-27 00:23:22 +00:00
{
2009-01-10 22:57:33 +00:00
PropertyRNA * prop ;
2008-11-29 14:35:50 +00:00
prop = RNA_def_property ( srna , " diffuse_color " , PROP_FLOAT , PROP_COLOR ) ;
RNA_def_property_float_sdna ( prop , NULL , " r " ) ;
2008-11-27 00:23:22 +00:00
RNA_def_property_array ( prop , 3 ) ;
2008-11-29 14:35:50 +00:00
RNA_def_property_ui_text ( prop , " Diffuse Color " , " " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING_DRAW , NULL ) ;
2008-11-27 00:23:22 +00:00
2008-11-29 14:35:50 +00:00
prop = RNA_def_property ( srna , " specular_color " , PROP_FLOAT , PROP_COLOR ) ;
2008-11-27 00:23:22 +00:00
RNA_def_property_float_sdna ( prop , NULL , " specr " ) ;
RNA_def_property_array ( prop , 3 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Specular Color " , " Specular color of the material. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING_DRAW , NULL ) ;
2008-11-28 00:14:27 +00:00
2008-11-29 14:35:50 +00:00
prop = RNA_def_property ( srna , " mirror_color " , PROP_FLOAT , PROP_COLOR ) ;
2008-11-28 00:14:27 +00:00
RNA_def_property_float_sdna ( prop , NULL , " mirr " ) ;
RNA_def_property_array ( prop , 3 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Mirror Color " , " Mirror color of the material. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-11-28 00:14:27 +00:00
2008-11-28 16:00:50 +00:00
prop = RNA_def_property ( srna , " alpha " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Alpha " , " Alpha transparency of the material. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING_DRAW , NULL ) ;
2009-01-06 00:56:20 +00:00
/* Color bands */
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " diffuse_ramp " , PROP_POINTER , PROP_NONE ) ;
2009-01-06 00:56:20 +00:00
RNA_def_property_pointer_sdna ( prop , NULL , " ramp_col " ) ;
RNA_def_property_struct_type ( prop , " ColorRamp " ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Diffuse Ramp " , " Color ramp used to affect diffuse shading. " ) ;
2009-01-06 00:56:20 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " specular_ramp " , PROP_POINTER , PROP_NONE ) ;
2009-01-06 00:56:20 +00:00
RNA_def_property_pointer_sdna ( prop , NULL , " ramp_spec " ) ;
RNA_def_property_struct_type ( prop , " ColorRamp " ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Specular Ramp " , " Color ramp used to affect specular shading. " ) ;
2008-12-26 00:10:29 +00:00
}
2009-01-10 22:57:33 +00:00
static void rna_def_material_diffuse ( StructRNA * srna )
2008-12-26 00:10:29 +00:00
{
2009-01-10 22:57:33 +00:00
PropertyRNA * prop ;
2008-12-26 00:10:29 +00:00
static EnumPropertyItem prop_diff_shader_items [ ] = {
2009-01-10 22:57:33 +00:00
{ MA_DIFF_LAMBERT , " LAMBERT " , " Lambert " , " " } ,
{ MA_DIFF_ORENNAYAR , " OREN_NAYAR " , " Oren-Nayar " , " " } ,
{ MA_DIFF_TOON , " TOON " , " Toon " , " " } ,
{ MA_DIFF_MINNAERT , " MINNAERT " , " Minnaert " , " " } ,
{ MA_DIFF_FRESNEL , " FRESNEL " , " Fresnel " , " " } ,
2008-12-26 00:10:29 +00:00
{ 0 , NULL , NULL , NULL } } ;
2008-11-28 16:00:50 +00:00
2008-11-29 14:35:50 +00:00
prop = RNA_def_property ( srna , " diffuse_shader " , PROP_ENUM , PROP_NONE ) ;
2008-12-03 20:17:12 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " diff_shader " ) ;
2008-11-28 16:00:50 +00:00
RNA_def_property_enum_items ( prop , prop_diff_shader_items ) ;
2008-11-29 14:35:50 +00:00
RNA_def_property_ui_text ( prop , " Diffuse Shader Model " , " " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-11-28 16:00:50 +00:00
2008-11-29 14:35:50 +00:00
prop = RNA_def_property ( srna , " diffuse_reflection " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " ref " ) ;
2008-11-28 16:00:50 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2008-11-29 14:35:50 +00:00
RNA_def_property_ui_text ( prop , " Diffuse Reflection " , " Amount of diffuse reflection. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING_DRAW , NULL ) ;
2008-11-28 16:00:50 +00:00
prop = RNA_def_property ( srna , " roughness " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_range ( prop , 0.0f , 3.14f ) ;
2008-11-29 14:35:50 +00:00
RNA_def_property_ui_text ( prop , " Roughness " , " Oren-Nayar Roughness " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-11-28 16:00:50 +00:00
prop = RNA_def_property ( srna , " params1_4 " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " param " ) ;
RNA_def_property_array ( prop , 4 ) ;
RNA_def_property_range ( prop , 0.0f , 5.0f ) ;
RNA_def_property_ui_text ( prop , " Params 1-4 " , " Parameters used for diffuse and specular Toon, and diffuse Fresnel shaders. Check documentation for details. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-11-28 16:00:50 +00:00
prop = RNA_def_property ( srna , " darkness " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_range ( prop , 0.0f , 2.0f ) ;
2008-11-29 14:35:50 +00:00
RNA_def_property_ui_text ( prop , " Darkness " , " Minnaert darkness. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
}
2009-01-10 22:57:33 +00:00
static void rna_def_material_raymirror ( BlenderRNA * brna )
2008-12-26 00:10:29 +00:00
{
2009-01-03 20:20:09 +00:00
StructRNA * srna ;
PropertyRNA * prop ;
2008-12-26 00:10:29 +00:00
static EnumPropertyItem prop_fadeto_mir_items [ ] = {
2009-01-10 22:57:33 +00:00
{ MA_RAYMIR_FADETOSKY , " FADE_TO_SKY " , " Fade to Sky Color " , " " } ,
{ MA_RAYMIR_FADETOMAT , " FADE_TO_MATERIAL " , " Fade to Material Color " , " " } ,
2008-12-26 00:10:29 +00:00
{ 0 , NULL , NULL , NULL } } ;
2009-01-03 20:20:09 +00:00
srna = RNA_def_struct ( brna , " MaterialRaytraceMirror " , NULL ) ;
RNA_def_struct_sdna ( srna , " Material " ) ;
2009-01-10 22:57:33 +00:00
RNA_def_struct_nested ( brna , srna , " Material " ) ;
RNA_def_struct_ui_text ( srna , " Material Raytrace Mirror " , " Raytraced reflection settings for a Material datablock. " ) ;
2009-01-03 20:20:09 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " enabled " , PROP_BOOLEAN , PROP_NONE ) ;
2008-11-28 00:14:27 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_RAYMIRROR ) ; /* use bitflags */
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Enabled " , " Enable raytraced reflections. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " reflect " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " ray_mirror " ) ;
2008-11-28 00:14:27 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-01-15 04:22:23 +00:00
RNA_def_property_ui_text ( prop , " Reflect " , " Sets the amount mirror reflection for raytrace. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-11-28 00:14:27 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " fresnel " , PROP_FLOAT , PROP_NONE ) ;
2008-12-01 14:36:14 +00:00
RNA_def_property_float_sdna ( prop , NULL , " fresnel_mir " ) ;
2008-11-28 00:14:27 +00:00
RNA_def_property_range ( prop , 0.0f , 5.0f ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Fresnel " , " Power of Fresnel for mirror reflection. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-11-28 00:14:27 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " fresnel_fac " , PROP_FLOAT , PROP_NONE ) ;
2008-12-01 14:36:14 +00:00
RNA_def_property_float_sdna ( prop , NULL , " fresnel_mir_i " ) ;
2008-11-28 00:14:27 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Fresnel Factor " , " Blending factor for Fresnel. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-11-28 00:14:27 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " gloss " , PROP_FLOAT , PROP_NONE ) ;
2008-12-01 14:36:14 +00:00
RNA_def_property_float_sdna ( prop , NULL , " gloss_mir " ) ;
2008-11-28 00:14:27 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Gloss " , " The shininess of the reflection. Values < 1.0 give diffuse, blurry reflections. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-11-28 00:14:27 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " gloss_anisotropic " , PROP_FLOAT , PROP_NONE ) ;
2008-12-01 14:36:14 +00:00
RNA_def_property_float_sdna ( prop , NULL , " aniso_gloss_mir " ) ;
2008-11-28 00:14:27 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-03-02 13:34:34 +00:00
RNA_def_property_ui_text ( prop , " Gloss Anisotropy " , " The shape of the reflection, from 0.0 (circular) to 1.0 (fully stretched along the tangent. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-11-28 00:14:27 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " gloss_samples " , PROP_INT , PROP_NONE ) ;
2008-12-26 02:02:06 +00:00
RNA_def_property_int_sdna ( prop , NULL , " samp_gloss_mir " ) ;
RNA_def_property_range ( prop , 0 , 1024 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Gloss Samples " , " Number of cone samples averaged for blurry reflections. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-11-28 00:14:27 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " gloss_threshold " , PROP_FLOAT , PROP_NONE ) ;
2008-12-01 14:36:14 +00:00
RNA_def_property_float_sdna ( prop , NULL , " adapt_thresh_mir " ) ;
2008-11-28 00:14:27 +00:00
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Gloss Threshold " , " Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-11-28 00:14:27 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " depth " , PROP_INT , PROP_NONE ) ;
2008-12-26 00:10:29 +00:00
RNA_def_property_int_sdna ( prop , NULL , " ray_depth " ) ;
RNA_def_property_range ( prop , 0 , 10 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Depth " , " Maximum allowed number of light inter-reflections. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-11-28 00:14:27 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " distance " , PROP_FLOAT , PROP_NONE ) ;
2008-12-01 14:36:14 +00:00
RNA_def_property_float_sdna ( prop , NULL , " dist_mir " ) ;
2008-11-28 00:14:27 +00:00
RNA_def_property_range ( prop , 0.0f , 10000.0f ) ;
2009-03-02 13:34:34 +00:00
RNA_def_property_ui_text ( prop , " Maximum Distance " , " Maximum distance of reflected rays. Reflections further than this range fade to sky color or material color. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-11-28 00:14:27 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " fade_to " , PROP_ENUM , PROP_NONE ) ;
2008-12-03 20:17:12 +00:00
RNA_def_property_enum_sdna ( prop , NULL , " fadeto_mir " ) ;
2008-11-28 00:14:27 +00:00
RNA_def_property_enum_items ( prop , prop_fadeto_mir_items ) ;
2009-03-02 13:34:34 +00:00
RNA_def_property_ui_text ( prop , " Fade-out Color " , " The color that rays with no intersection within the Max Distance take. Material color can be best for indoor scenes, sky color for outdoor. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
}
2009-01-10 22:57:33 +00:00
static void rna_def_material_raytra ( BlenderRNA * brna )
2008-12-26 00:10:29 +00:00
{
2009-01-03 20:20:09 +00:00
StructRNA * srna ;
PropertyRNA * prop ;
srna = RNA_def_struct ( brna , " MaterialRaytraceTransparency " , NULL ) ;
RNA_def_struct_sdna ( srna , " Material " ) ;
2009-01-10 22:57:33 +00:00
RNA_def_struct_nested ( brna , srna , " Material " ) ;
RNA_def_struct_ui_text ( srna , " Material Raytrace Transparency " , " Raytraced refraction settings for a Material datablock. " ) ;
2009-01-03 20:20:09 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " enabled " , PROP_BOOLEAN , PROP_NONE ) ;
2008-12-25 22:00:27 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_RAYTRANSP ) ; /* use bitflags */
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Enabled " , " Enables raytracing for transparent refraction rendering. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-25 22:00:27 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " ior " , PROP_FLOAT , PROP_NONE ) ;
2008-12-25 22:00:27 +00:00
RNA_def_property_float_sdna ( prop , NULL , " ang " ) ;
RNA_def_property_range ( prop , 1.0f , 3.0f ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " IOR " , " Sets angular index of refraction for raytraced refraction. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-25 22:00:27 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " fresnel " , PROP_FLOAT , PROP_NONE ) ;
2008-12-25 22:00:27 +00:00
RNA_def_property_float_sdna ( prop , NULL , " fresnel_tra " ) ;
RNA_def_property_range ( prop , 0.0f , 5.0f ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Fresnel " , " Power of Fresnel for transparency (Ray or ZTransp). " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-25 22:00:27 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " fresnel_fac " , PROP_FLOAT , PROP_NONE ) ;
2008-12-25 22:00:27 +00:00
RNA_def_property_float_sdna ( prop , NULL , " fresnel_tra_i " ) ;
RNA_def_property_range ( prop , 1.0f , 5.0f ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Fresnel Factor " , " Blending factor for Fresnel. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-25 22:00:27 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " gloss " , PROP_FLOAT , PROP_NONE ) ;
2008-12-25 22:00:27 +00:00
RNA_def_property_float_sdna ( prop , NULL , " gloss_tra " ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Gloss " , " The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-25 22:00:27 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " gloss_samples " , PROP_INT , PROP_NONE ) ;
2008-12-26 02:02:06 +00:00
RNA_def_property_int_sdna ( prop , NULL , " samp_gloss_tra " ) ;
RNA_def_property_range ( prop , 0 , 1024 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Gloss Samples " , " Number of cone samples averaged for blurry refractions. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-25 22:00:27 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " gloss_threshold " , PROP_FLOAT , PROP_NONE ) ;
2008-12-25 22:00:27 +00:00
RNA_def_property_float_sdna ( prop , NULL , " adapt_thresh_tra " ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Gloss Threshold " , " Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-25 22:00:27 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " depth " , PROP_INT , PROP_NONE ) ;
2008-12-26 00:10:29 +00:00
RNA_def_property_int_sdna ( prop , NULL , " ray_depth_tra " ) ;
RNA_def_property_range ( prop , 0 , 10 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Depth " , " Maximum allowed number of light inter-refractions. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-25 22:00:27 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " filter " , PROP_FLOAT , PROP_NONE ) ;
2008-12-25 22:00:27 +00:00
RNA_def_property_float_sdna ( prop , NULL , " filter " ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Filter " , " Amount to blend in the material's diffuse color in raytraced transparency (simulating absorption). " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-25 22:00:27 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " limit " , PROP_FLOAT , PROP_NONE ) ;
2008-12-25 22:00:27 +00:00
RNA_def_property_float_sdna ( prop , NULL , " tx_limit " ) ;
RNA_def_property_range ( prop , 0.0f , 100.0f ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Limit " , " Maximum depth for light to travel through the transparent material before becoming fully filtered (0.0 is disabled). " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-25 22:00:27 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " falloff " , PROP_FLOAT , PROP_NONE ) ;
2008-12-25 22:00:27 +00:00
RNA_def_property_float_sdna ( prop , NULL , " tx_falloff " ) ;
RNA_def_property_range ( prop , 0.1f , 10.0f ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Falloff " , " Falloff power for transmissivity filter effect (1.0 is linear). " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-25 22:00:27 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " specular_opacity " , PROP_FLOAT , PROP_NONE ) ;
2008-12-25 22:00:27 +00:00
RNA_def_property_float_sdna ( prop , NULL , " spectra " ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Specular Opacity " , " Makes specular areas opaque on transparent materials. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
}
2009-01-10 22:57:33 +00:00
static void rna_def_material_halo ( BlenderRNA * brna )
2008-12-26 00:10:29 +00:00
{
2009-01-03 20:20:09 +00:00
StructRNA * srna ;
PropertyRNA * prop ;
srna = RNA_def_struct ( brna , " MaterialHalo " , NULL ) ;
RNA_def_struct_sdna ( srna , " Material " ) ;
2009-01-10 22:57:33 +00:00
RNA_def_struct_nested ( brna , srna , " Material " ) ;
RNA_def_struct_ui_text ( srna , " Material Halo " , " Halo particle effect settings for a Material datablock. " ) ;
2009-01-03 20:20:09 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " size " , PROP_FLOAT , PROP_NONE ) ;
2008-12-26 00:10:29 +00:00
RNA_def_property_float_sdna ( prop , NULL , " hasize " ) ;
RNA_def_property_range ( prop , 0.0f , 100.0f ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Size " , " Sets the dimension of the halo. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " hardness " , PROP_INT , PROP_NONE ) ;
2008-12-26 00:10:29 +00:00
RNA_def_property_int_sdna ( prop , NULL , " har " ) ;
RNA_def_property_range ( prop , 0 , 127 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Hardness " , " Sets the hardness of the halo. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " add " , PROP_FLOAT , PROP_NONE ) ;
2008-12-26 00:10:29 +00:00
RNA_def_property_float_sdna ( prop , NULL , " add " ) ;
RNA_def_property_range ( prop , 0.0f , 1.0f ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Add " , " Sets the strength of the add effect. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " rings " , PROP_INT , PROP_NONE ) ;
2008-12-26 00:10:29 +00:00
RNA_def_property_int_sdna ( prop , NULL , " ringc " ) ;
RNA_def_property_range ( prop , 0 , 24 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Rings " , " Sets the number of rings rendered over the halo. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " line_number " , PROP_INT , PROP_NONE ) ;
2008-12-26 00:10:29 +00:00
RNA_def_property_int_sdna ( prop , NULL , " linec " ) ;
RNA_def_property_range ( prop , 0 , 250 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Line Number " , " Sets the number of star shaped lines rendered over the halo. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " star_tips " , PROP_INT , PROP_NONE ) ;
2008-12-26 00:10:29 +00:00
RNA_def_property_int_sdna ( prop , NULL , " starc " ) ;
RNA_def_property_range ( prop , 3 , 50 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Star Tips " , " Sets the number of points on the star shaped halo. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " seed " , PROP_INT , PROP_NONE ) ;
2008-12-26 00:10:29 +00:00
RNA_def_property_int_sdna ( prop , NULL , " seed1 " ) ;
RNA_def_property_range ( prop , 0 , 255 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Seed " , " Randomizes ring dimension and line location. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " flare_mode " , PROP_BOOLEAN , PROP_NONE ) ;
2008-12-26 00:10:29 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_HALO_FLARE ) ; /* use bitflags */
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Flare " , " Renders halo as a lensflare. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " flare_size " , PROP_FLOAT , PROP_NONE ) ;
2008-12-26 00:10:29 +00:00
RNA_def_property_float_sdna ( prop , NULL , " flaresize " ) ;
RNA_def_property_range ( prop , 0.1f , 25.0f ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Flare Size " , " Sets the factor by which the flare is larger than the halo. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " flare_subsize " , PROP_FLOAT , PROP_NONE ) ;
2008-12-26 00:10:29 +00:00
RNA_def_property_float_sdna ( prop , NULL , " subsize " ) ;
RNA_def_property_range ( prop , 0.1f , 25.0f ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Flare Subsize " , " Sets the dimension of the subflares, dots and circles. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " flare_boost " , PROP_FLOAT , PROP_NONE ) ;
2008-12-26 00:10:29 +00:00
RNA_def_property_float_sdna ( prop , NULL , " flareboost " ) ;
RNA_def_property_range ( prop , 0.1f , 10.0f ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Flare Boost " , " Gives the flare extra strength. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " flare_seed " , PROP_INT , PROP_NONE ) ;
2008-12-26 00:10:29 +00:00
RNA_def_property_int_sdna ( prop , NULL , " seed2 " ) ;
RNA_def_property_range ( prop , 0 , 255 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Flare Seed " , " Specifies an offset in the flare seed table. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-05 23:53:37 +00:00
prop = RNA_def_property ( srna , " flares_sub " , PROP_INT , PROP_NONE ) ;
2008-12-26 00:10:29 +00:00
RNA_def_property_int_sdna ( prop , NULL , " flarec " ) ;
RNA_def_property_range ( prop , 1 , 32 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Flares Sub " , " Sets the number of subflares. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " ring " , PROP_BOOLEAN , PROP_NONE ) ;
2009-03-02 13:34:34 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_HALO_RINGS ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Rings " , " Renders rings over halo. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " lines " , PROP_BOOLEAN , PROP_NONE ) ;
2009-03-02 13:34:34 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_HALO_LINES ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Lines " , " Renders star shaped lines over halo. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " star " , PROP_BOOLEAN , PROP_NONE ) ;
2009-03-02 13:34:34 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_STAR ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Star " , " Renders halo as a star. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " use_texture " , PROP_BOOLEAN , PROP_NONE ) ;
2009-03-02 13:34:34 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_HALOTEX ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Use Texture " , " Gives halo a texture. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " use_vertex_normal " , PROP_BOOLEAN , PROP_NONE ) ;
2009-03-02 13:34:34 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_HALOPUNO ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Use Vertex Normal " , " Uses the vertex normal to specify the dimension of the halo. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " xalpha " , PROP_BOOLEAN , PROP_NONE ) ;
2009-03-02 13:34:34 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_HALO_XALPHA ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Extreme Alpha " , " Uses extreme alpha. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " shaded " , PROP_BOOLEAN , PROP_NONE ) ;
2009-03-02 13:34:34 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_HALO_SHADE ) ;
RNA_def_property_ui_text ( prop , " Shaded " , " Lets halo receive light and shadows from external objects. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " soft " , PROP_BOOLEAN , PROP_NONE ) ;
2009-03-02 13:34:34 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_HALO_SOFT ) ;
RNA_def_property_ui_text ( prop , " Soft " , " Softens the edges of halos at intersections with other geometry. " ) ;
2009-01-03 05:41:58 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2008-12-26 00:10:29 +00:00
}
2009-01-10 22:57:33 +00:00
static void rna_def_material_sss ( BlenderRNA * brna )
2009-01-05 05:09:20 +00:00
{
StructRNA * srna ;
PropertyRNA * prop ;
srna = RNA_def_struct ( brna , " MaterialSubsurfaceScattering " , NULL ) ;
RNA_def_struct_sdna ( srna , " Material " ) ;
2009-01-10 22:57:33 +00:00
RNA_def_struct_nested ( brna , srna , " Material " ) ;
RNA_def_struct_ui_text ( srna , " Material Subsurface Scattering " , " Diffuse subsurface scattering settings for a Material datablock. " ) ;
2009-01-05 05:09:20 +00:00
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
prop = RNA_def_property ( srna , " radius " , PROP_FLOAT , PROP_NONE ) ;
2009-01-05 05:09:20 +00:00
RNA_def_property_float_sdna ( prop , NULL , " sss_radius " ) ;
RNA_def_property_range ( prop , 0.001 , FLT_MAX ) ;
RNA_def_property_ui_range ( prop , 0.001 , 10000 , 1 , 3 ) ;
RNA_def_property_ui_text ( prop , " Radius " , " Mean red/green/blue scattering path length. " ) ;
2009-06-07 19:18:20 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 05:09:20 +00:00
prop = RNA_def_property ( srna , " color " , PROP_FLOAT , PROP_COLOR ) ;
RNA_def_property_float_sdna ( prop , NULL , " sss_col " ) ;
RNA_def_property_ui_text ( prop , " Color " , " Scattering color. " ) ;
2009-06-07 19:18:20 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 05:09:20 +00:00
prop = RNA_def_property ( srna , " error_tolerance " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " sss_error " ) ;
RNA_def_property_ui_range ( prop , 0.0001 , 10 , 1 , 3 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Error Tolerance " , " Error tolerance (low values are slower and higher quality). " ) ;
2009-06-07 19:18:20 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 05:09:20 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " scale " , PROP_FLOAT , PROP_NONE ) ;
2009-01-05 05:09:20 +00:00
RNA_def_property_float_sdna ( prop , NULL , " sss_scale " ) ;
RNA_def_property_ui_range ( prop , 0.001 , 1000 , 1 , 3 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Scale " , " Object scale factor. " ) ;
2009-06-07 19:18:20 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 05:09:20 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " ior " , PROP_FLOAT , PROP_NONE ) ;
2009-01-05 05:09:20 +00:00
RNA_def_property_float_sdna ( prop , NULL , " sss_ior " ) ;
RNA_def_property_ui_range ( prop , 0.1 , 2 , 1 , 3 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " IOR " , " Index of refraction (higher values are denser). " ) ;
2009-06-07 19:18:20 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 05:09:20 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " color_factor " , PROP_FLOAT , PROP_NONE ) ;
2009-01-05 05:09:20 +00:00
RNA_def_property_float_sdna ( prop , NULL , " sss_colfac " ) ;
RNA_def_property_range ( prop , 0 , 1 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Color Factor " , " Blend factor for SSS colors. " ) ;
2009-06-07 19:18:20 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 05:09:20 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " texture_factor " , PROP_FLOAT , PROP_NONE ) ;
2009-01-05 05:09:20 +00:00
RNA_def_property_float_sdna ( prop , NULL , " sss_texfac " ) ;
RNA_def_property_range ( prop , 0 , 1 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Texture Factor " , " Texture scatting blend factor. " ) ;
2009-06-07 19:18:20 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 05:09:20 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " front " , PROP_FLOAT , PROP_NONE ) ;
2009-01-05 05:09:20 +00:00
RNA_def_property_float_sdna ( prop , NULL , " sss_front " ) ;
RNA_def_property_range ( prop , 0 , 2 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Front " , " Front scattering weight. " ) ;
2009-06-07 19:18:20 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 05:09:20 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " back " , PROP_FLOAT , PROP_NONE ) ;
2009-01-05 05:09:20 +00:00
RNA_def_property_float_sdna ( prop , NULL , " sss_back " ) ;
RNA_def_property_range ( prop , 0 , 10 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Back " , " Back scattering weight. " ) ;
2009-06-07 19:18:20 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 05:09:20 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " enabled " , PROP_BOOLEAN , PROP_NONE ) ;
2009-01-05 05:09:20 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " sss_flag " , MA_DIFF_SSS ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Enabled " , " Enable diffuse subsurface scatting effects in a material. " ) ;
2009-06-07 19:18:20 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 05:09:20 +00:00
}
2009-01-10 22:57:33 +00:00
void rna_def_material_specularity ( StructRNA * srna )
2009-01-05 23:06:22 +00:00
{
2009-01-10 22:57:33 +00:00
PropertyRNA * prop ;
2009-06-13 21:22:21 +00:00
static EnumPropertyItem prop_spec_shader_items [ ] = {
{ MA_SPEC_COOKTORR , " COOKTORR " , " CookTorr " , " " } ,
{ MA_SPEC_PHONG , " PHONG " , " Phong " , " " } ,
{ MA_SPEC_BLINN , " BLINN " , " Blinn " , " " } ,
{ MA_SPEC_TOON , " TOON " , " Toon " , " " } ,
{ MA_SPEC_WARDISO , " WARDISO " , " WardIso " , " " } ,
{ 0 , NULL , NULL , NULL } } ;
prop = RNA_def_property ( srna , " spec_shader " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " spec_shader " ) ;
RNA_def_property_enum_items ( prop , prop_spec_shader_items ) ;
RNA_def_property_ui_text ( prop , " Specular Shader Model " , " " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 23:06:22 +00:00
prop = RNA_def_property ( srna , " specularity " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " spec " ) ;
RNA_def_property_range ( prop , 0 , 1 ) ;
2009-03-02 13:34:34 +00:00
RNA_def_property_ui_text ( prop , " Specularity Intensity " , " " ) ;
2009-06-14 18:16:38 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 23:06:22 +00:00
/* XXX: this field is also used for Halo hardness. should probably be fixed in DNA */
2009-06-13 21:22:21 +00:00
/* I guess it's fine. Specular is disabled when mat type is Halo. --DingTo */
2009-01-05 23:06:22 +00:00
prop = RNA_def_property ( srna , " specular_hardness " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " har " ) ;
RNA_def_property_range ( prop , 1 , 511 ) ;
RNA_def_property_ui_text ( prop , " Specular Hardness " , " " ) ;
2009-06-14 18:16:38 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 23:06:22 +00:00
prop = RNA_def_property ( srna , " specular_refraction " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " refrac " ) ;
RNA_def_property_range ( prop , 1 , 10 ) ;
2009-03-02 13:34:34 +00:00
RNA_def_property_ui_text ( prop , " Specular IOR " , " " ) ;
2009-06-14 18:16:38 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 23:06:22 +00:00
/* XXX: evil "param" field also does specular stuff */
prop = RNA_def_property ( srna , " specular_slope " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " rms " ) ;
RNA_def_property_range ( prop , 0 , 0.4 ) ;
RNA_def_property_ui_text ( prop , " Specular Slope " , " The standard deviation of surface slope. " ) ;
2009-06-14 18:16:38 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 23:06:22 +00:00
}
2009-01-10 22:57:33 +00:00
void rna_def_material_strand ( BlenderRNA * brna )
2009-01-05 23:06:22 +00:00
{
2009-01-10 22:57:33 +00:00
StructRNA * srna ;
PropertyRNA * prop ;
srna = RNA_def_struct ( brna , " MaterialStrand " , NULL ) ;
RNA_def_struct_sdna ( srna , " Material " ) ;
RNA_def_struct_nested ( brna , srna , " Material " ) ;
RNA_def_struct_ui_text ( srna , " Material Strand " , " Strand settings for a Material datablock. " ) ;
prop = RNA_def_property ( srna , " tangent_shading " , PROP_BOOLEAN , PROP_NONE ) ;
2009-01-05 23:06:22 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_TANGENT_STR ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Tangent Shading " , " Uses direction of strands as normal for tangent-shading. " ) ;
2009-06-14 18:16:38 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 23:06:22 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " surface_diffuse " , PROP_BOOLEAN , PROP_NONE ) ;
2009-01-05 23:06:22 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_STR_SURFDIFF ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Surface Diffuse " , " Make diffuse shading more similar to shading the surface. " ) ;
2009-06-14 18:16:38 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 23:06:22 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " blend_distance " , PROP_FLOAT , PROP_NONE ) ;
2009-01-05 23:06:22 +00:00
RNA_def_property_float_sdna ( prop , NULL , " strand_surfnor " ) ;
RNA_def_property_range ( prop , 0 , 10 ) ;
RNA_def_property_ui_text ( prop , " Blend Distance " , " Distance in Blender units over which to blend in the surface normal. " ) ;
2009-06-14 18:16:38 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 23:06:22 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " blender_units " , PROP_BOOLEAN , PROP_NONE ) ;
2009-01-05 23:06:22 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_STR_B_UNITS ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Blender Units " , " Use Blender units for widths instead of pixels. " ) ;
2009-06-14 18:16:38 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 23:06:22 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " start_size " , PROP_FLOAT , PROP_UNSIGNED ) ;
2009-01-05 23:06:22 +00:00
RNA_def_property_float_sdna ( prop , NULL , " strand_sta " ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_float_funcs ( prop , NULL , NULL , " rna_MaterialStrand_start_size_range " ) ;
RNA_def_property_ui_text ( prop , " Start Size " , " Start size of strands in pixels Blender units. " ) ;
2009-06-14 18:16:38 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 23:06:22 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " end_size " , PROP_FLOAT , PROP_UNSIGNED ) ;
2009-01-05 23:06:22 +00:00
RNA_def_property_float_sdna ( prop , NULL , " strand_end " ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_float_funcs ( prop , NULL , NULL , " rna_MaterialStrand_end_size_range " ) ;
RNA_def_property_ui_text ( prop , " End Size " , " Start size of strands in pixels or Blender units. " ) ;
2009-06-14 18:16:38 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 23:06:22 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " min_size " , PROP_FLOAT , PROP_UNSIGNED ) ;
2009-01-05 23:06:22 +00:00
RNA_def_property_float_sdna ( prop , NULL , " strand_min " ) ;
RNA_def_property_range ( prop , 0.001 , 10 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Minimum Size " , " Minimum size of strands in pixels. " ) ;
2009-06-14 18:16:38 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 23:06:22 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " shape " , PROP_FLOAT , PROP_NONE ) ;
2009-01-05 23:06:22 +00:00
RNA_def_property_float_sdna ( prop , NULL , " strand_ease " ) ;
RNA_def_property_range ( prop , - 0.9 , 0.9 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Shape " , " Positive values make strands rounder, negative makes strands spiky. " ) ;
2009-06-14 18:16:38 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 23:06:22 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " width_fade " , PROP_FLOAT , PROP_NONE ) ;
2009-01-05 23:06:22 +00:00
RNA_def_property_float_sdna ( prop , NULL , " strand_widthfade " ) ;
RNA_def_property_range ( prop , 0 , 2 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Width Fade " , " Transparency along the width of the strand. " ) ;
2009-06-14 18:16:38 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 23:06:22 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " uv_layer " , PROP_STRING , PROP_NONE ) ;
2009-01-05 23:06:22 +00:00
RNA_def_property_string_sdna ( prop , NULL , " strand_uvname " ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " UV Layer " , " Name of UV layer to override. " ) ;
2009-06-14 18:16:38 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 23:06:22 +00:00
}
2008-12-26 00:10:29 +00:00
void RNA_def_material ( BlenderRNA * brna )
{
2009-05-20 13:34:04 +00:00
StructRNA * srna ;
PropertyRNA * prop ;
static EnumPropertyItem prop_type_items [ ] = {
{ MA_TYPE_SURFACE , " SURFACE " , " Surface " , " Render object as a surface. " } ,
{ MA_TYPE_VOLUME , " VOLUME " , " Volume " , " Render object as a volume. " } ,
{ MA_TYPE_HALO , " HALO " , " Halo " , " Render object as halo particles. " } ,
{ 0 , NULL , NULL , NULL } } ;
2009-01-03 19:39:39 +00:00
2008-12-26 00:10:29 +00:00
srna = RNA_def_struct ( brna , " Material " , " ID " ) ;
2009-01-10 22:57:33 +00:00
RNA_def_struct_ui_text ( srna , " Material " , " Material datablock to defined the appearance of geometric objects for rendering. " ) ;
2009-06-03 23:16:51 +00:00
RNA_def_struct_ui_icon ( srna , ICON_MATERIAL_DATA ) ;
2009-05-20 13:34:04 +00:00
prop = RNA_def_property ( srna , " type " , PROP_ENUM , PROP_NONE ) ;
RNA_def_property_enum_sdna ( prop , NULL , " material_type " ) ;
RNA_def_property_enum_items ( prop , prop_type_items ) ;
RNA_def_property_ui_text ( prop , " Type " , " Material type defining how the object is rendered. " ) ;
2009-05-28 23:23:47 +00:00
RNA_def_property_enum_funcs ( prop , NULL , " rna_Material_type_set " , NULL ) ;
2009-05-20 13:34:04 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING_DRAW , NULL ) ;
2009-01-05 23:06:22 +00:00
prop = RNA_def_property ( srna , " ambient " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " amb " ) ;
RNA_def_property_range ( prop , 0 , 1 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Ambient " , " Amount of global ambient color the material receives. " ) ;
2009-06-07 11:12:35 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 23:06:22 +00:00
prop = RNA_def_property ( srna , " emit " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_range ( prop , 0 , 2 ) ;
RNA_def_property_ui_text ( prop , " Emit " , " Amount of light to emit. " ) ;
prop = RNA_def_property ( srna , " translucency " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_range ( prop , 0 , 1 ) ;
RNA_def_property_ui_text ( prop , " Translucency " , " Amount of diffuse shading on the back side. " ) ;
2009-06-07 11:12:35 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 23:06:22 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " cubic " , PROP_BOOLEAN , PROP_NONE ) ;
2009-01-05 23:06:22 +00:00
RNA_def_property_boolean_sdna ( prop , NULL , " shade_flag " , MA_CUBIC ) ;
2009-03-02 13:34:34 +00:00
RNA_def_property_ui_text ( prop , " Cubic Interpolation " , " Use cubic interpolation for diffuse values, for smoother transitions. " ) ;
2009-01-05 23:06:22 +00:00
prop = RNA_def_property ( srna , " object_color " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " shade_flag " , MA_OBCOLOR ) ;
RNA_def_property_ui_text ( prop , " Object Color " , " Modulate the result with a per-object color. " ) ;
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " shadow_ray_bias " , PROP_FLOAT , PROP_NONE ) ;
2009-01-05 23:06:22 +00:00
RNA_def_property_float_sdna ( prop , NULL , " sbias " ) ;
RNA_def_property_range ( prop , 0 , 0.25 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Shadow Ray Bias " , " Shadow raytracing bias to prevent terminator problems on shadow boundary. " ) ;
2009-01-05 23:06:22 +00:00
2009-01-10 22:57:33 +00:00
prop = RNA_def_property ( srna , " shadow_buffer_bias " , PROP_FLOAT , PROP_NONE ) ;
2009-01-05 23:06:22 +00:00
RNA_def_property_float_sdna ( prop , NULL , " lbias " ) ;
RNA_def_property_range ( prop , 0 , 10 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Shadow Buffer Bias " , " Factor to multiply shadow buffer bias with (0 is ignore.) " ) ;
2009-01-05 23:06:22 +00:00
prop = RNA_def_property ( srna , " shadow_casting_alpha " , PROP_FLOAT , PROP_NONE ) ;
RNA_def_property_float_sdna ( prop , NULL , " shad_alpha " ) ;
RNA_def_property_range ( prop , 0.001 , 1 ) ;
RNA_def_property_ui_text ( prop , " Shadow Casting Alpha " , " Shadow casting alpha, only in use for Irregular Shadowbuffer. " ) ;
2009-06-07 11:12:35 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-05 23:06:22 +00:00
2009-03-02 13:34:34 +00:00
prop = RNA_def_property ( srna , " light_group " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " group " ) ;
RNA_def_property_struct_type ( prop , " Group " ) ;
2009-05-28 23:23:47 +00:00
RNA_def_property_flag ( prop , PROP_EDITABLE ) ;
2009-03-02 13:34:34 +00:00
RNA_def_property_ui_text ( prop , " Light Group " , " Limit lighting to lamps in this Group. " ) ;
2009-06-07 11:12:35 +00:00
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-03-02 13:34:34 +00:00
/* flags */
prop = RNA_def_property ( srna , " light_group_exclusive " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_GROUP_NOLAY ) ;
RNA_def_property_ui_text ( prop , " Light Group Exclusive " , " Material uses the light group exclusively - these lamps are excluded from other scene lighting. " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
prop = RNA_def_property ( srna , " traceable " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_TRACEBLE ) ;
RNA_def_property_ui_text ( prop , " Traceable " , " Include this material and geometry that uses it in ray tracing calculations. " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
prop = RNA_def_property ( srna , " shadows " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_SHADOW ) ;
RNA_def_property_ui_text ( prop , " Shadows " , " Allows this material to receive shadows. " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
prop = RNA_def_property ( srna , " shadeless " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_SHLESS ) ;
RNA_def_property_ui_text ( prop , " Shadeless " , " Makes this material insensitive to light or shadow. " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
prop = RNA_def_property ( srna , " wireframe " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_WIRE ) ;
RNA_def_property_ui_text ( prop , " Wireframe " , " Render the edges of faces as wires (not supported in ray tracing). " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
prop = RNA_def_property ( srna , " vertex_color_light " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_VERTEXCOL ) ;
RNA_def_property_ui_text ( prop , " Vertex Color Light " , " Add vertex colors as additional lighting. " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
prop = RNA_def_property ( srna , " vertex_color_paint " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_VERTEXCOLP ) ;
RNA_def_property_ui_text ( prop , " Vertex Color Paint " , " Replaces object base color with vertex colors (multiplies with 'texture face' face assigned textures). " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
prop = RNA_def_property ( srna , " invert_z " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_ZINV ) ;
RNA_def_property_ui_text ( prop , " Invert Z Depth " , " Renders material's faces with an inverted Z buffer (scanline only). " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
prop = RNA_def_property ( srna , " sky " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_ENV ) ;
RNA_def_property_ui_text ( prop , " Sky " , " Renders this material with zero alpha, with sky background in place (scanline only). " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
prop = RNA_def_property ( srna , " only_shadow " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_ONLYSHADOW ) ;
RNA_def_property_ui_text ( prop , " Only Shadow " , " Renders shadows as the material's alpha value, making materials transparent except for shadowed areas. " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
prop = RNA_def_property ( srna , " face_texture " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_FACETEXTURE ) ;
RNA_def_property_ui_text ( prop , " Face Textures " , " Replaces the object's base color with color from face assigned image textures " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
prop = RNA_def_property ( srna , " face_texture_alpha " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_FACETEXTURE_ALPHA ) ;
RNA_def_property_ui_text ( prop , " Face Textures Alpha " , " Replaces the object's base alpha value with alpha from face assigned image textures " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
prop = RNA_def_property ( srna , " cast_shadows_only " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_ONLYCAST ) ;
RNA_def_property_ui_text ( prop , " Cast Shadows Only " , " Makes objects with this material appear invisible, only casting shadows (not rendered). " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
prop = RNA_def_property ( srna , " exclude_mist " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_NOMIST ) ;
RNA_def_property_ui_text ( prop , " Exclude Mist " , " Excludes this material from mist effects (in world settings) " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
prop = RNA_def_property ( srna , " radiosity " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_RADIO ) ;
RNA_def_property_ui_text ( prop , " Radiosity " , " Include this material in radiosity calculations " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
prop = RNA_def_property ( srna , " transparent_shadows " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_SHADOW_TRA ) ;
RNA_def_property_ui_text ( prop , " Transparent Shadows " , " Allow this object to receive transparent shadows casted through other objects " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
prop = RNA_def_property ( srna , " ray_shadow_bias " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_RAYBIAS ) ;
RNA_def_property_ui_text ( prop , " Ray Shadow Bias " , " Prevents raytraced shadow errors on surfaces with smooth shaded normals (terminator problem) " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
prop = RNA_def_property ( srna , " full_oversampling " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_FULL_OSA ) ;
RNA_def_property_ui_text ( prop , " Full Oversampling " , " Force this material to render full shading/textures for all anti-aliasing samples " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
prop = RNA_def_property ( srna , " cast_buffer_shadows " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_SHADBUF ) ;
RNA_def_property_ui_text ( prop , " Cast Buffer Shadows " , " Allow this material to cast shadows from shadow buffer lamps " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
prop = RNA_def_property ( srna , " tangent_shading " , PROP_BOOLEAN , PROP_NONE ) ;
RNA_def_property_boolean_sdna ( prop , NULL , " mode " , MA_TANGENT_V ) ;
RNA_def_property_ui_text ( prop , " Tangent Shading " , " Use the material's tangent vector instead of the normal for shading - for anisotropic shading effects " ) ;
RNA_def_property_update ( prop , NC_MATERIAL | ND_SHADING , NULL ) ;
2009-01-10 22:57:33 +00:00
/* nested structs */
prop = RNA_def_property ( srna , " raytrace_mirror " , PROP_POINTER , PROP_NEVER_NULL ) ;
RNA_def_property_struct_type ( prop , " MaterialRaytraceMirror " ) ;
2009-06-07 13:09:18 +00:00
RNA_def_property_pointer_funcs ( prop , " rna_Material_mirror_get " , NULL , NULL ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Raytrace Mirror " , " Raytraced reflection settings for the material. " ) ;
prop = RNA_def_property ( srna , " raytrace_transparency " , PROP_POINTER , PROP_NEVER_NULL ) ;
RNA_def_property_struct_type ( prop , " MaterialRaytraceTransparency " ) ;
2009-06-07 13:09:18 +00:00
RNA_def_property_pointer_funcs ( prop , " rna_Material_transp_get " , NULL , NULL ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Raytrace Transparency " , " Raytraced reflection settings for the material. " ) ;
prop = RNA_def_property ( srna , " halo " , PROP_POINTER , PROP_NEVER_NULL ) ;
RNA_def_property_struct_type ( prop , " MaterialHalo " ) ;
2009-06-07 13:09:18 +00:00
RNA_def_property_pointer_funcs ( prop , " rna_Material_halo_get " , NULL , NULL ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Halo " , " Halo settings for the material. " ) ;
prop = RNA_def_property ( srna , " subsurface_scattering " , PROP_POINTER , PROP_NEVER_NULL ) ;
RNA_def_property_struct_type ( prop , " MaterialSubsurfaceScattering " ) ;
2009-06-07 13:09:18 +00:00
RNA_def_property_pointer_funcs ( prop , " rna_Material_sss_get " , NULL , NULL ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Subsurface Scattering " , " Subsurface scattering settings for the material. " ) ;
prop = RNA_def_property ( srna , " strand " , PROP_POINTER , PROP_NEVER_NULL ) ;
RNA_def_property_struct_type ( prop , " MaterialStrand " ) ;
2009-06-07 13:09:18 +00:00
RNA_def_property_pointer_funcs ( prop , " rna_Material_strand_get " , NULL , NULL ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Strand " , " Strand settings for the material. " ) ;
/* nodetree */
prop = RNA_def_property ( srna , " node_tree " , PROP_POINTER , PROP_NONE ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " nodetree " ) ;
RNA_def_property_ui_text ( prop , " Node Tree " , " Node tree for node based materials. " ) ;
/* common */
2009-02-02 11:51:10 +00:00
rna_def_animdata_common ( srna ) ;
2009-01-10 22:57:33 +00:00
rna_def_mtex_common ( srna , " rna_Material_mtex_begin " , " rna_Material_active_texture_get " , " MaterialTextureSlot " ) ;
prop = RNA_def_property ( srna , " script_link " , PROP_POINTER , PROP_NEVER_NULL ) ;
RNA_def_property_pointer_sdna ( prop , NULL , " scriptlink " ) ;
2009-03-23 13:24:48 +00:00
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Script Link " , " Scripts linked to this material. " ) ;
2009-01-05 23:06:22 +00:00
/* XXX: does Material.septex get RNA? */
2008-12-26 00:10:29 +00:00
2009-01-10 22:57:33 +00:00
rna_def_material_colors ( srna ) ;
rna_def_material_diffuse ( srna ) ;
rna_def_material_specularity ( srna ) ;
/* nested structs */
rna_def_material_raymirror ( brna ) ;
rna_def_material_raytra ( brna ) ;
rna_def_material_halo ( brna ) ;
rna_def_material_sss ( brna ) ;
rna_def_material_mtex ( brna ) ;
rna_def_material_strand ( brna ) ;
}
2009-01-05 05:09:20 +00:00
2009-01-10 22:57:33 +00:00
void rna_def_mtex_common ( StructRNA * srna , const char * begin , const char * activeget , const char * structname )
{
PropertyRNA * prop ;
/* mtex */
prop = RNA_def_property ( srna , " textures " , PROP_COLLECTION , PROP_NONE ) ;
RNA_def_property_struct_type ( prop , structname ) ;
2009-02-02 19:57:57 +00:00
RNA_def_property_collection_funcs ( prop , begin , " rna_iterator_array_next " , " rna_iterator_array_end " , " rna_iterator_array_dereference_get " , 0 , 0 , 0 ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Textures " , " Texture slots defining the mapping and influence of textures. " ) ;
prop = RNA_def_property ( srna , " active_texture " , PROP_POINTER , PROP_NONE ) ;
2009-03-23 13:24:48 +00:00
RNA_def_property_clear_flag ( prop , PROP_EDITABLE ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_struct_type ( prop , structname ) ;
2009-06-07 13:09:18 +00:00
RNA_def_property_pointer_funcs ( prop , activeget , NULL , NULL ) ;
2009-01-10 22:57:33 +00:00
RNA_def_property_ui_text ( prop , " Active Texture " , " Active texture slot being displayed. " ) ;
prop = RNA_def_property ( srna , " active_texture_index " , PROP_INT , PROP_UNSIGNED ) ;
RNA_def_property_int_sdna ( prop , NULL , " texact " ) ;
RNA_def_property_range ( prop , 0 , MAX_MTEX - 1 ) ;
RNA_def_property_ui_text ( prop , " Active Texture Index " , " Index of active texture slot. " ) ;
2008-11-27 00:23:22 +00:00
}
# endif