Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * Contributor(s): Blender Foundation (2008). 00019 * 00020 * ***** END GPL LICENSE BLOCK ***** 00021 */ 00022 00028 #include <float.h> 00029 #include <stdio.h> 00030 #include <stdlib.h> 00031 00032 #include "RNA_define.h" 00033 #include "RNA_enum_types.h" 00034 00035 #include "rna_internal.h" 00036 00037 #include "DNA_brush_types.h" 00038 #include "DNA_lamp_types.h" 00039 #include "DNA_material_types.h" 00040 #include "DNA_object_types.h" 00041 #include "DNA_texture_types.h" 00042 #include "DNA_world_types.h" 00043 #include "DNA_node_types.h" 00044 #include "DNA_particle_types.h" 00045 #include "DNA_scene_types.h" /* MAXFRAME only */ 00046 00047 #include "BKE_node.h" 00048 00049 EnumPropertyItem texture_filter_items[] = { 00050 {TXF_BOX, "BOX", 0, "Box", ""}, 00051 {TXF_EWA, "EWA", 0, "EWA", ""}, 00052 {TXF_FELINE, "FELINE", 0, "FELINE", ""}, 00053 {TXF_AREA, "AREA", 0, "Area", ""}, 00054 {0, NULL, 0, NULL, NULL}}; 00055 00056 EnumPropertyItem texture_type_items[] = { 00057 {0, "NONE", 0, "None", ""}, 00058 {TEX_BLEND, "BLEND", ICON_TEXTURE, "Blend", "Procedural - create a ramp texture"}, 00059 {TEX_CLOUDS, "CLOUDS", ICON_TEXTURE, "Clouds", "Procedural - create a cloud-like fractal noise texture"}, 00060 {TEX_DISTNOISE, "DISTORTED_NOISE", ICON_TEXTURE, 00061 "Distorted Noise", "Procedural - noise texture distorted by two noise algorithms"}, 00062 {TEX_ENVMAP, "ENVIRONMENT_MAP", ICON_IMAGE_DATA, 00063 "Environment Map", "Create a render of the environment mapped to a texture"}, 00064 {TEX_IMAGE, "IMAGE", ICON_IMAGE_DATA, "Image or Movie", "Allow for images or movies to be used as textures"}, 00065 {TEX_MAGIC, "MAGIC", ICON_TEXTURE, "Magic", "Procedural - color texture based on trigonometric functions"}, 00066 {TEX_MARBLE, "MARBLE", ICON_TEXTURE, "Marble", "Procedural - marble-like noise texture with wave generated bands"}, 00067 {TEX_MUSGRAVE, "MUSGRAVE", ICON_TEXTURE, "Musgrave", "Procedural - highly flexible fractal noise texture"}, 00068 {TEX_NOISE, "NOISE", ICON_TEXTURE, "Noise", 00069 "Procedural - random noise, gives a different result every time, for every frame, for every pixel"}, 00070 //{TEX_PLUGIN, "PLUGIN", ICON_PLUGIN, "Plugin", ""}, /* Nothing yet */ 00071 {TEX_POINTDENSITY, "POINT_DENSITY", ICON_TEXTURE, "Point Density", ""}, 00072 {TEX_STUCCI, "STUCCI", ICON_TEXTURE, "Stucci", "Procedural - create a fractal noise texture"}, 00073 {TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", "Procedural - create cell-like patterns based on Worley noise"}, 00074 {TEX_VOXELDATA, "VOXEL_DATA", ICON_TEXTURE, "Voxel Data", "Create a 3d texture based on volumetric data"}, 00075 {TEX_WOOD, "WOOD", ICON_TEXTURE, "Wood", "Procedural - wave generated bands or rings, with optional noise"}, 00076 {TEX_OCEAN, "OCEAN", ICON_TEXTURE, "Ocean", "Use a texture generated by an Ocean modifier"}, 00077 {0, NULL, 0, NULL, NULL}}; 00078 00079 EnumPropertyItem blend_type_items[] = { 00080 {MTEX_BLEND, "MIX", 0, "Mix", ""}, 00081 {MTEX_ADD, "ADD", 0, "Add", ""}, 00082 {MTEX_SUB, "SUBTRACT", 0, "Subtract", ""}, 00083 {MTEX_MUL, "MULTIPLY", 0, "Multiply", ""}, 00084 {MTEX_SCREEN, "SCREEN", 0, "Screen", ""}, 00085 {MTEX_OVERLAY, "OVERLAY", 0, "Overlay", ""}, 00086 {MTEX_DIFF, "DIFFERENCE", 0, "Difference", ""}, 00087 {MTEX_DIV, "DIVIDE", 0, "Divide", ""}, 00088 {MTEX_DARK, "DARKEN", 0, "Darken", ""}, 00089 {MTEX_LIGHT, "LIGHTEN", 0, "Lighten", ""}, 00090 {MTEX_BLEND_HUE, "HUE", 0, "Hue", ""}, 00091 {MTEX_BLEND_SAT, "SATURATION", 0, "Saturation", ""}, 00092 {MTEX_BLEND_VAL, "VALUE", 0, "Value", ""}, 00093 {MTEX_BLEND_COLOR, "COLOR", 0, "Color", ""}, 00094 {MTEX_SOFT_LIGHT, "SOFT_LIGHT", 0, "Soft Light", ""}, 00095 {MTEX_LIN_LIGHT , "LINEAR_LIGHT", 0, "Linear Light", ""}, 00096 {0, NULL, 0, NULL, NULL}}; 00097 00098 #ifdef RNA_RUNTIME 00099 00100 #include "MEM_guardedalloc.h" 00101 00102 #include "RNA_access.h" 00103 00104 #include "BKE_depsgraph.h" 00105 #include "BKE_image.h" 00106 #include "BKE_texture.h" 00107 #include "BKE_main.h" 00108 00109 #include "ED_node.h" 00110 00111 #include "WM_api.h" 00112 #include "WM_types.h" 00113 00114 static StructRNA *rna_Texture_refine(struct PointerRNA *ptr) 00115 { 00116 Tex *tex= (Tex*)ptr->data; 00117 00118 switch(tex->type) { 00119 case TEX_BLEND: 00120 return &RNA_BlendTexture; 00121 case TEX_CLOUDS: 00122 return &RNA_CloudsTexture; 00123 case TEX_DISTNOISE: 00124 return &RNA_DistortedNoiseTexture; 00125 case TEX_ENVMAP: 00126 return &RNA_EnvironmentMapTexture; 00127 case TEX_IMAGE: 00128 return &RNA_ImageTexture; 00129 case TEX_MAGIC: 00130 return &RNA_MagicTexture; 00131 case TEX_MARBLE: 00132 return &RNA_MarbleTexture; 00133 case TEX_MUSGRAVE: 00134 return &RNA_MusgraveTexture; 00135 case TEX_NOISE: 00136 return &RNA_NoiseTexture; 00137 case TEX_PLUGIN: 00138 return &RNA_PluginTexture; 00139 case TEX_POINTDENSITY: 00140 return &RNA_PointDensityTexture; 00141 case TEX_STUCCI: 00142 return &RNA_StucciTexture; 00143 case TEX_VORONOI: 00144 return &RNA_VoronoiTexture; 00145 case TEX_VOXELDATA: 00146 return &RNA_VoxelDataTexture; 00147 case TEX_WOOD: 00148 return &RNA_WoodTexture; 00149 case TEX_OCEAN: 00150 return &RNA_OceanTexture; 00151 default: 00152 return &RNA_Texture; 00153 } 00154 } 00155 00156 static void rna_Texture_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) 00157 { 00158 ID *id= ptr->id.data; 00159 00160 if(GS(id->name) == ID_TE) { 00161 Tex *tex= ptr->id.data; 00162 00163 DAG_id_tag_update(&tex->id, 0); 00164 WM_main_add_notifier(NC_TEXTURE, tex); 00165 WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, NULL); 00166 } 00167 else if(GS(id->name) == ID_NT) { 00168 bNodeTree *ntree= ptr->id.data; 00169 ED_node_generic_update(bmain, ntree, NULL); 00170 } 00171 } 00172 00173 static void rna_Texture_mapping_update(Main *bmain, Scene *scene, PointerRNA *ptr) 00174 { 00175 TexMapping *texmap = ptr->data; 00176 init_tex_mapping(texmap); 00177 rna_Texture_update(bmain, scene, ptr); 00178 } 00179 00180 static void rna_Color_mapping_update(Main *bmain, Scene *scene, PointerRNA *ptr) 00181 { 00182 /* nothing to do */ 00183 } 00184 00185 static void rna_Texture_voxeldata_update(Main *bmain, Scene *scene, PointerRNA *ptr) 00186 { 00187 Tex *tex= ptr->id.data; 00188 00189 tex->vd->ok = 0; 00190 rna_Texture_update(bmain, scene, ptr); 00191 } 00192 00193 static void rna_Texture_voxeldata_image_update(Main *bmain, Scene *scene, PointerRNA *ptr) 00194 { 00195 Tex *tex= ptr->id.data; 00196 00197 if(tex->ima) { /* may be getting cleared too */ 00198 tex->ima->source = IMA_SRC_SEQUENCE; 00199 } 00200 rna_Texture_voxeldata_update(bmain, scene, ptr); 00201 } 00202 00203 00204 /* Used for Texture Properties, used (also) for/in Nodes */ 00205 static void rna_Texture_nodes_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) 00206 { 00207 Tex *tex= ptr->id.data; 00208 00209 DAG_id_tag_update(&tex->id, 0); 00210 WM_main_add_notifier(NC_TEXTURE|ND_NODES, tex); 00211 } 00212 00213 static void rna_Texture_type_set(PointerRNA *ptr, int value) 00214 { 00215 Tex *tex= (Tex*)ptr->data; 00216 00217 tex_set_type(tex, value); 00218 } 00219 00220 void rna_TextureSlot_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) 00221 { 00222 ID *id= ptr->id.data; 00223 00224 DAG_id_tag_update(id, 0); 00225 00226 switch(GS(id->name)) { 00227 case ID_MA: 00228 WM_main_add_notifier(NC_MATERIAL|ND_SHADING, id); 00229 WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, id); 00230 break; 00231 case ID_WO: 00232 WM_main_add_notifier(NC_WORLD, id); 00233 break; 00234 case ID_LA: 00235 WM_main_add_notifier(NC_LAMP|ND_LIGHTING, id); 00236 break; 00237 case ID_BR: 00238 WM_main_add_notifier(NC_BRUSH, id); 00239 break; 00240 case ID_PA: 00241 { 00242 MTex *mtex= ptr->data; 00243 int recalc = OB_RECALC_DATA; 00244 00245 if(mtex->mapto & PAMAP_INIT) 00246 recalc |= PSYS_RECALC_RESET; 00247 if(mtex->mapto & PAMAP_CHILD) 00248 recalc |= PSYS_RECALC_CHILD; 00249 00250 DAG_id_tag_update(id, recalc); 00251 WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL); 00252 break; 00253 } 00254 } 00255 } 00256 00257 char *rna_TextureSlot_path(PointerRNA *ptr) 00258 { 00259 MTex *mtex= ptr->data; 00260 00261 /* if there is ID-data, resolve the path using the index instead of by name, 00262 * since the name used is the name of the texture assigned, but the texture 00263 * may be used multiple times in the same stack 00264 */ 00265 if (ptr->id.data) { 00266 PointerRNA id_ptr; 00267 PropertyRNA *prop; 00268 00269 /* find the 'textures' property of the ID-struct */ 00270 RNA_id_pointer_create(ptr->id.data, &id_ptr); 00271 prop= RNA_struct_find_property(&id_ptr, "texture_slots"); 00272 00273 /* get an iterator for this property, and try to find the relevant index */ 00274 if (prop) { 00275 int index= RNA_property_collection_lookup_index(&id_ptr, prop, ptr); 00276 00277 if (index >= 0) 00278 return BLI_sprintfN("texture_slots[%d]", index); 00279 } 00280 } 00281 00282 /* this is a compromise for the remaining cases... */ 00283 if (mtex->tex) 00284 return BLI_sprintfN("texture_slots[\"%s\"]", mtex->tex->id.name+2); 00285 else 00286 return BLI_strdup("texture_slots[0]"); 00287 } 00288 00289 static int rna_TextureSlot_name_length(PointerRNA *ptr) 00290 { 00291 MTex *mtex= ptr->data; 00292 00293 if(mtex->tex) 00294 return strlen(mtex->tex->id.name+2); 00295 00296 return 0; 00297 } 00298 00299 static void rna_TextureSlot_name_get(PointerRNA *ptr, char *str) 00300 { 00301 MTex *mtex= ptr->data; 00302 00303 if(mtex->tex) 00304 strcpy(str, mtex->tex->id.name+2); 00305 else 00306 str[0]= '\0'; 00307 } 00308 00309 static int rna_TextureSlot_output_node_get(PointerRNA *ptr) 00310 { 00311 MTex *mtex= ptr->data; 00312 Tex *tex= mtex->tex; 00313 int cur= mtex->which_output; 00314 00315 if(tex) { 00316 bNodeTree *ntree= tex->nodetree; 00317 bNode *node; 00318 if(ntree) { 00319 for(node= ntree->nodes.first; node; node= node->next) { 00320 if(node->type == TEX_NODE_OUTPUT) { 00321 if(cur == node->custom1) 00322 return cur; 00323 } 00324 } 00325 } 00326 } 00327 00328 mtex->which_output= 0; 00329 return 0; 00330 } 00331 00332 00333 static EnumPropertyItem *rna_TextureSlot_output_node_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), int *free) 00334 { 00335 MTex *mtex= ptr->data; 00336 Tex *tex= mtex->tex; 00337 EnumPropertyItem *item= NULL; 00338 int totitem= 0; 00339 00340 if(tex) { 00341 bNodeTree *ntree= tex->nodetree; 00342 if(ntree) { 00343 EnumPropertyItem tmp= {0, "", 0, "", ""}; 00344 bNode *node; 00345 00346 tmp.value = 0; 00347 tmp.name = "Not Specified"; 00348 tmp.identifier = "NOT_SPECIFIED"; 00349 RNA_enum_item_add(&item, &totitem, &tmp); 00350 00351 for(node= ntree->nodes.first; node; node= node->next) { 00352 if(node->type == TEX_NODE_OUTPUT) { 00353 tmp.value= node->custom1; 00354 tmp.name= ((TexNodeOutput*)node->storage)->name; 00355 tmp.identifier = tmp.name; 00356 RNA_enum_item_add(&item, &totitem, &tmp); 00357 } 00358 } 00359 } 00360 } 00361 00362 RNA_enum_item_end(&item, &totitem); 00363 *free = 1; 00364 00365 return item; 00366 } 00367 00368 static void rna_Texture_use_color_ramp_set(PointerRNA *ptr, int value) 00369 { 00370 Tex *tex= (Tex*)ptr->data; 00371 00372 if(value) tex->flag |= TEX_COLORBAND; 00373 else tex->flag &= ~TEX_COLORBAND; 00374 00375 if((tex->flag & TEX_COLORBAND) && tex->coba == NULL) 00376 tex->coba= add_colorband(0); 00377 } 00378 00379 static void rna_Texture_use_nodes_set(PointerRNA *ptr, int v) 00380 { 00381 Tex *tex= (Tex*)ptr->data; 00382 00383 tex->use_nodes = v; 00384 tex->type = 0; 00385 00386 if(v && tex->nodetree==NULL) 00387 ED_node_texture_default(tex); 00388 } 00389 00390 static void rna_ImageTexture_mipmap_set(PointerRNA *ptr, int value) 00391 { 00392 Tex *tex= (Tex*)ptr->data; 00393 00394 if(value) tex->imaflag |= TEX_MIPMAP; 00395 else tex->imaflag &= ~TEX_MIPMAP; 00396 } 00397 00398 static void rna_Envmap_source_update(Main *bmain, Scene *scene, PointerRNA *ptr) 00399 { 00400 Tex *tex= ptr->id.data; 00401 00402 if (tex->env) 00403 BKE_free_envmapdata(tex->env); 00404 00405 rna_Texture_update(bmain, scene, ptr); 00406 } 00407 00408 static PointerRNA rna_PointDensity_psys_get(PointerRNA *ptr) 00409 { 00410 PointDensity *pd= ptr->data; 00411 Object *ob= pd->object; 00412 ParticleSystem *psys= NULL; 00413 PointerRNA value; 00414 00415 if(ob && pd->psys) 00416 psys= BLI_findlink(&ob->particlesystem, pd->psys-1); 00417 00418 RNA_pointer_create(&ob->id, &RNA_ParticleSystem, psys, &value); 00419 return value; 00420 } 00421 00422 static void rna_PointDensity_psys_set(PointerRNA *ptr, PointerRNA value) 00423 { 00424 PointDensity *pd= ptr->data; 00425 Object *ob= pd->object; 00426 00427 if(ob && value.id.data == ob) 00428 pd->psys= BLI_findindex(&ob->particlesystem, value.data) + 1; 00429 } 00430 00431 static char *rna_PointDensity_path(PointerRNA *UNUSED(ptr)) 00432 { 00433 return BLI_sprintfN("point_density"); 00434 } 00435 00436 static char *rna_VoxelData_path(PointerRNA *UNUSED(ptr)) 00437 { 00438 return BLI_sprintfN("voxel_data"); 00439 } 00440 00441 static char *rna_OceanTex_path(PointerRNA *ptr) 00442 { 00443 return BLI_sprintfN("ocean"); 00444 } 00445 00446 #else 00447 00448 static void rna_def_texmapping(BlenderRNA *brna) 00449 { 00450 static EnumPropertyItem prop_mapping_items[] = { 00451 {MTEX_FLAT, "FLAT", 0, "Flat", "Map X and Y coordinates directly"}, 00452 {MTEX_CUBE, "CUBE", 0, "Cube", "Map using the normal vector"}, 00453 {MTEX_TUBE, "TUBE", 0, "Tube", "Map with Z as central axis"}, 00454 {MTEX_SPHERE, "SPHERE", 0, "Sphere", "Map with Z as central axis"}, 00455 {0, NULL, 0, NULL, NULL}}; 00456 00457 static EnumPropertyItem prop_xyz_mapping_items[] = { 00458 {0, "NONE", 0, "None", ""}, 00459 {1, "X", 0, "X", ""}, 00460 {2, "Y", 0, "Y", ""}, 00461 {3, "Z", 0, "Z", ""}, 00462 {0, NULL, 0, NULL, NULL}}; 00463 00464 StructRNA *srna; 00465 PropertyRNA *prop; 00466 00467 srna= RNA_def_struct(brna, "TexMapping", NULL); 00468 RNA_def_struct_ui_text(srna, "Texture Mapping", "Texture coordinate mapping settings"); 00469 00470 prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION); 00471 RNA_def_property_float_sdna(prop, NULL, "loc"); 00472 RNA_def_property_ui_text(prop, "Location", ""); 00473 RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); 00474 00475 prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER); /* Not PROP_XYZ, this is now in radians, no more degrees */ 00476 RNA_def_property_float_sdna(prop, NULL, "rot"); 00477 RNA_def_property_ui_text(prop, "Rotation", ""); 00478 RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); 00479 00480 prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); 00481 RNA_def_property_float_sdna(prop, NULL, "size"); 00482 RNA_def_property_ui_text(prop, "Scale", ""); 00483 RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); 00484 00485 prop= RNA_def_property(srna, "min", PROP_FLOAT, PROP_XYZ); 00486 RNA_def_property_float_sdna(prop, NULL, "min"); 00487 RNA_def_property_ui_text(prop, "Minimum", "Minimum value for clipping"); 00488 RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); 00489 00490 prop= RNA_def_property(srna, "max", PROP_FLOAT, PROP_XYZ); 00491 RNA_def_property_float_sdna(prop, NULL, "max"); 00492 RNA_def_property_ui_text(prop, "Maximum", "Maximum value for clipping"); 00493 RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); 00494 00495 prop= RNA_def_property(srna, "use_min", PROP_BOOLEAN, PROP_NONE); 00496 RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MIN); 00497 RNA_def_property_ui_text(prop, "Has Minimum", "Whether to use minimum clipping value"); 00498 RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); 00499 00500 prop= RNA_def_property(srna, "use_max", PROP_BOOLEAN, PROP_NONE); 00501 RNA_def_property_boolean_sdna(prop, NULL, "flag", TEXMAP_CLIP_MAX); 00502 RNA_def_property_ui_text(prop, "Has Maximum", "Whether to use maximum clipping value"); 00503 RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); 00504 00505 prop= RNA_def_property(srna, "mapping_x", PROP_ENUM, PROP_NONE); 00506 RNA_def_property_enum_sdna(prop, NULL, "projx"); 00507 RNA_def_property_enum_items(prop, prop_xyz_mapping_items); 00508 RNA_def_property_ui_text(prop, "X Mapping", ""); 00509 RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); 00510 00511 prop= RNA_def_property(srna, "mapping_y", PROP_ENUM, PROP_NONE); 00512 RNA_def_property_enum_sdna(prop, NULL, "projy"); 00513 RNA_def_property_enum_items(prop, prop_xyz_mapping_items); 00514 RNA_def_property_ui_text(prop, "Y Mapping", ""); 00515 RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); 00516 00517 prop= RNA_def_property(srna, "mapping_z", PROP_ENUM, PROP_NONE); 00518 RNA_def_property_enum_sdna(prop, NULL, "projz"); 00519 RNA_def_property_enum_items(prop, prop_xyz_mapping_items); 00520 RNA_def_property_ui_text(prop, "Z Mapping", ""); 00521 RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); 00522 00523 prop= RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE); 00524 RNA_def_property_enum_items(prop, prop_mapping_items); 00525 RNA_def_property_ui_text(prop, "Mapping", ""); 00526 RNA_def_property_update(prop, 0, "rna_Texture_mapping_update"); 00527 } 00528 00529 static void rna_def_colormapping(BlenderRNA *brna) 00530 { 00531 StructRNA *srna; 00532 PropertyRNA *prop; 00533 00534 srna= RNA_def_struct(brna, "ColorMapping", NULL); 00535 RNA_def_struct_ui_text(srna, "Color Mapping", "Color mapping settings"); 00536 00537 prop= RNA_def_property(srna, "use_color_ramp", PROP_BOOLEAN, PROP_NONE); 00538 RNA_def_property_boolean_sdna(prop, NULL, "flag", COLORMAP_USE_RAMP); 00539 RNA_def_property_ui_text(prop, "Use Color Ramp", "Toggle color ramp operations"); 00540 RNA_def_property_update(prop, 0, "rna_Color_mapping_update"); 00541 00542 prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL); 00543 RNA_def_property_pointer_sdna(prop, NULL, "coba"); 00544 RNA_def_property_struct_type(prop, "ColorRamp"); 00545 RNA_def_property_ui_text(prop, "Color Ramp", ""); 00546 RNA_def_property_update(prop, 0, "rna_Color_mapping_update"); 00547 00548 prop= RNA_def_property(srna, "brightness", PROP_FLOAT, PROP_NONE); 00549 RNA_def_property_float_sdna(prop, NULL, "bright"); 00550 RNA_def_property_range(prop, 0, 2); 00551 RNA_def_property_ui_text(prop, "Brightness", "Adjust the brightness of the texture"); 00552 RNA_def_property_update(prop, 0, "rna_Color_mapping_update"); 00553 00554 prop= RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE); 00555 RNA_def_property_range(prop, 0.01, 5); 00556 RNA_def_property_ui_text(prop, "Contrast", "Adjust the contrast of the texture"); 00557 RNA_def_property_update(prop, 0, "rna_Color_mapping_update"); 00558 00559 prop= RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE); 00560 RNA_def_property_range(prop, 0, 2); 00561 RNA_def_property_ui_text(prop, "Saturation", "Adjust the saturation of colors in the texture"); 00562 RNA_def_property_update(prop, 0, "rna_Color_mapping_update"); 00563 00564 prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE); 00565 RNA_def_property_enum_items(prop, blend_type_items); 00566 RNA_def_property_ui_text(prop, "Blend Type", "Mode used to mix with texture output color"); 00567 RNA_def_property_update(prop, 0, "rna_Color_mapping_update"); 00568 00569 prop= RNA_def_property(srna, "blend_color", PROP_FLOAT, PROP_COLOR); 00570 RNA_def_property_array(prop, 3); 00571 RNA_def_property_ui_text(prop, "Color", "Blend color to mix with texture output color"); 00572 RNA_def_property_update(prop, 0, "rna_Color_mapping_update"); 00573 00574 prop= RNA_def_property(srna, "blend_factor", PROP_FLOAT, PROP_NONE); 00575 RNA_def_property_ui_text(prop, "Blend Factor", ""); 00576 RNA_def_property_update(prop, 0, "rna_Color_mapping_update"); 00577 } 00578 00579 static void rna_def_mtex(BlenderRNA *brna) 00580 { 00581 StructRNA *srna; 00582 PropertyRNA *prop; 00583 00584 static EnumPropertyItem output_node_items[] = { 00585 {0, "DUMMY", 0, "Dummy", ""}, 00586 {0, NULL, 0, NULL, NULL}}; 00587 00588 srna= RNA_def_struct(brna, "TextureSlot", NULL); 00589 RNA_def_struct_sdna(srna, "MTex"); 00590 RNA_def_struct_ui_text(srna, "Texture Slot", "Texture slot defining the mapping and influence of a texture"); 00591 RNA_def_struct_path_func(srna, "rna_TextureSlot_path"); 00592 RNA_def_struct_ui_icon(srna, ICON_TEXTURE_DATA); 00593 00594 prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE); 00595 RNA_def_property_pointer_sdna(prop, NULL, "tex"); 00596 RNA_def_property_struct_type(prop, "Texture"); 00597 RNA_def_property_flag(prop, PROP_EDITABLE); 00598 RNA_def_property_ui_text(prop, "Texture", "Texture datablock used by this texture slot"); 00599 RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); 00600 00601 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); 00602 RNA_def_property_string_funcs(prop, "rna_TextureSlot_name_get", "rna_TextureSlot_name_length", NULL); 00603 RNA_def_property_ui_text(prop, "Name", "Texture slot name"); 00604 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 00605 RNA_def_struct_name_property(srna, prop); 00606 RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); 00607 00608 /* mapping */ 00609 prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TRANSLATION); 00610 RNA_def_property_float_sdna(prop, NULL, "ofs"); 00611 RNA_def_property_ui_range(prop, -10, 10, 10, 2); 00612 RNA_def_property_ui_text(prop, "Offset", "Fine tune of the texture mapping X, Y and Z locations"); 00613 RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); 00614 00615 prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ); 00616 RNA_def_property_float_sdna(prop, NULL, "size"); 00617 RNA_def_property_ui_range(prop, -100, 100, 10, 2); 00618 RNA_def_property_ui_text(prop, "Size", "Set scaling for the texture's X, Y and Z sizes"); 00619 RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); 00620 00621 prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); 00622 RNA_def_property_float_sdna(prop, NULL, "r"); 00623 RNA_def_property_array(prop, 3); 00624 RNA_def_property_ui_text(prop, "Color", 00625 "Default color for textures that don't return RGB or when RGB to intensity is enabled"); 00626 RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); 00627 00628 prop= RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE); 00629 RNA_def_property_enum_sdna(prop, NULL, "blendtype"); 00630 RNA_def_property_enum_items(prop, blend_type_items); 00631 RNA_def_property_ui_text(prop, "Blend Type", "Mode used to apply the texture"); 00632 RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); 00633 00634 prop= RNA_def_property(srna, "use_stencil", PROP_BOOLEAN, PROP_NONE); 00635 RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_STENCIL); 00636 RNA_def_property_ui_text(prop, "Stencil", "Use this texture as a blending value on the next texture"); 00637 RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); 00638 00639 prop= RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE); 00640 RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_NEGATIVE); 00641 RNA_def_property_ui_text(prop, "Negate", "Invert the values of the texture to reverse its effect"); 00642 RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); 00643 00644 prop= RNA_def_property(srna, "use_rgb_to_intensity", PROP_BOOLEAN, PROP_NONE); 00645 RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_RGBTOINT); 00646 RNA_def_property_ui_text(prop, "RGB to Intensity", "Convert texture RGB values to intensity (gray) values"); 00647 RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); 00648 00649 prop= RNA_def_property(srna, "default_value", PROP_FLOAT, PROP_NONE); 00650 RNA_def_property_float_sdna(prop, NULL, "def_var"); 00651 RNA_def_property_ui_range(prop, 0, 1, 10, 3); 00652 RNA_def_property_ui_text(prop, "Default Value", "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard"); 00653 RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); 00654 00655 prop= RNA_def_property(srna, "output_node", PROP_ENUM, PROP_NONE); 00656 RNA_def_property_enum_sdna(prop, NULL, "which_output"); 00657 RNA_def_property_enum_items(prop, output_node_items); 00658 RNA_def_property_enum_funcs(prop, "rna_TextureSlot_output_node_get", NULL, "rna_TextureSlot_output_node_itemf"); 00659 RNA_def_property_ui_text(prop, "Output Node", "Which output node to use, for node-based textures"); 00660 RNA_def_property_update(prop, 0, "rna_TextureSlot_update"); 00661 } 00662 00663 static void rna_def_filter_common(StructRNA *srna) 00664 { 00665 PropertyRNA *prop; 00666 00667 prop= RNA_def_property(srna, "use_mipmap", PROP_BOOLEAN, PROP_NONE); 00668 RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_MIPMAP); 00669 RNA_def_property_boolean_funcs(prop, NULL, "rna_ImageTexture_mipmap_set"); 00670 RNA_def_property_ui_text(prop, "MIP Map", "Use auto-generated MIP maps for the image"); 00671 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00672 00673 prop= RNA_def_property(srna, "use_mipmap_gauss", PROP_BOOLEAN, PROP_NONE); 00674 RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_GAUSS_MIP); 00675 RNA_def_property_ui_text(prop, "MIP Map Gaussian filter", "Use Gauss filter to sample down MIP maps"); 00676 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00677 00678 prop= RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE); 00679 RNA_def_property_enum_sdna(prop, NULL, "texfilter"); 00680 RNA_def_property_enum_items(prop, texture_filter_items); 00681 RNA_def_property_ui_text(prop, "Filter", "Texture filter to use for sampling image"); 00682 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00683 00684 prop= RNA_def_property(srna, "filter_probes", PROP_INT, PROP_NONE); 00685 RNA_def_property_int_sdna(prop, NULL, "afmax"); 00686 RNA_def_property_range(prop, 1, 256); 00687 RNA_def_property_ui_text(prop, "Filter Probes", 00688 "Maximum number of samples (higher gives less blur at distant/oblique angles, but is also slower)"); 00689 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00690 00691 prop= RNA_def_property(srna, "filter_eccentricity", PROP_INT, PROP_NONE); 00692 RNA_def_property_int_sdna(prop, NULL, "afmax"); 00693 RNA_def_property_range(prop, 1, 256); 00694 RNA_def_property_ui_text(prop, "Filter Eccentricity", 00695 "Maximum eccentricity (higher gives less blur at distant/oblique angles, but is also slower)"); 00696 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00697 00698 prop= RNA_def_property(srna, "use_filter_size_min", PROP_BOOLEAN, PROP_NONE); 00699 RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_FILTER_MIN); 00700 RNA_def_property_ui_text(prop, "Minimum Filter Size", "Use Filter Size as a minimal filter value in pixels"); 00701 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00702 00703 prop= RNA_def_property(srna, "filter_size", PROP_FLOAT, PROP_NONE); 00704 RNA_def_property_float_sdna(prop, NULL, "filtersize"); 00705 RNA_def_property_range(prop, 0.1, 50.0); 00706 RNA_def_property_ui_range(prop, 0.1, 50.0, 1, 0.2); 00707 RNA_def_property_ui_text(prop, "Filter Size", "Multiply the filter size used by MIP Map and Interpolation"); 00708 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00709 } 00710 00711 static void rna_def_environment_map(BlenderRNA *brna) 00712 { 00713 StructRNA *srna; 00714 PropertyRNA *prop; 00715 00716 static EnumPropertyItem prop_source_items[] = { 00717 {ENV_STATIC, "STATIC", 0, "Static", "Calculate environment map only once"}, 00718 {ENV_ANIM, "ANIMATED", 0, "Animated", "Calculate environment map at each rendering"}, 00719 {ENV_LOAD, "IMAGE_FILE", 0, "Image File", "Load a saved environment map image from disk"}, 00720 {0, NULL, 0, NULL, NULL}}; 00721 00722 static EnumPropertyItem prop_mapping_items[] = { 00723 {ENV_CUBE, "CUBE", 0, "Cube", "Use environment map with six cube sides"}, 00724 {ENV_PLANE, "PLANE", 0, "Plane", "Only one side is rendered, with Z axis pointing in direction of image"}, 00725 {0, NULL, 0, NULL, NULL}}; 00726 00727 srna= RNA_def_struct(brna, "EnvironmentMap", NULL); 00728 RNA_def_struct_sdna(srna, "EnvMap"); 00729 RNA_def_struct_ui_text(srna, "EnvironmentMap", "Environment map created by the renderer and cached for subsequent renders"); 00730 00731 prop= RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE); 00732 RNA_def_property_enum_sdna(prop, NULL, "stype"); 00733 RNA_def_property_enum_items(prop, prop_source_items); 00734 RNA_def_property_ui_text(prop, "Source", ""); 00735 RNA_def_property_update(prop, 0, "rna_Envmap_source_update"); 00736 00737 prop= RNA_def_property(srna, "viewpoint_object", PROP_POINTER, PROP_NONE); 00738 RNA_def_property_pointer_sdna(prop, NULL, "object"); 00739 RNA_def_property_ui_text(prop, "Viewpoint Object", "Object to use as the environment map's viewpoint location"); 00740 RNA_def_property_flag(prop, PROP_EDITABLE); 00741 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00742 00743 prop= RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE); 00744 RNA_def_property_enum_sdna(prop, NULL, "type"); 00745 RNA_def_property_enum_items(prop, prop_mapping_items); 00746 RNA_def_property_ui_text(prop, "Mapping", ""); 00747 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00748 00749 prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE); 00750 RNA_def_property_float_sdna(prop, NULL, "clipsta"); 00751 RNA_def_property_range(prop, 0.001, FLT_MAX); 00752 RNA_def_property_ui_range(prop, 0.01, 50, 100, 2); 00753 RNA_def_property_ui_text(prop, "Clip Start", "Objects nearer than this are not visible to map"); 00754 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00755 00756 prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_NONE); 00757 RNA_def_property_float_sdna(prop, NULL, "clipend"); 00758 RNA_def_property_range(prop, 0.01, FLT_MAX); 00759 RNA_def_property_ui_range(prop, 0.10, 20000, 100, 2); 00760 RNA_def_property_ui_text(prop, "Clip End", "Objects further than this are not visible to map"); 00761 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00762 00763 prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE); 00764 RNA_def_property_float_sdna(prop, NULL, "viewscale"); 00765 RNA_def_property_range(prop, 0.1, 5.0); 00766 RNA_def_property_ui_range(prop, 0.5, 1.5, 1, 2); 00767 RNA_def_property_ui_text(prop, "Zoom", ""); 00768 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00769 00770 prop= RNA_def_property(srna, "layers_ignore", PROP_BOOLEAN, PROP_LAYER_MEMBER); 00771 RNA_def_property_boolean_sdna(prop, NULL, "notlay", 1); 00772 RNA_def_property_array(prop, 20); 00773 RNA_def_property_ui_text(prop, "Ignore Layers", "Hide objects on these layers when generating the Environment Map"); 00774 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00775 00776 prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_UNSIGNED); 00777 RNA_def_property_int_sdna(prop, NULL, "cuberes"); 00778 RNA_def_property_range(prop, 50, 4096); 00779 RNA_def_property_ui_text(prop, "Resolution", "Pixel resolution of the rendered environment map"); 00780 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00781 00782 prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED); 00783 RNA_def_property_range(prop, 0, 5); 00784 RNA_def_property_ui_text(prop, "Depth", "Number of times a map will be rendered recursively (mirror effects)"); 00785 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00786 00787 prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, 0); 00788 RNA_def_property_boolean_sdna(prop, NULL, "ok", 2); 00789 RNA_def_property_clear_flag(prop, PROP_EDITABLE); 00790 RNA_def_property_ui_text(prop, "Validity", "True if this map is ready for use, False if it needs rendering"); 00791 00792 RNA_api_environment_map(srna); 00793 } 00794 00795 static EnumPropertyItem prop_noise_basis_items[] = { 00796 {TEX_BLENDER, "BLENDER_ORIGINAL", 0, "Blender Original", 00797 "Noise algorithm - Blender original: Smooth interpolated noise"}, 00798 {TEX_STDPERLIN, "ORIGINAL_PERLIN", 0, "Original Perlin", 00799 "Noise algorithm - Original Perlin: Smooth interpolated noise"}, 00800 {TEX_NEWPERLIN, "IMPROVED_PERLIN", 0, "Improved Perlin", 00801 "Noise algorithm - Improved Perlin: Smooth interpolated noise"}, 00802 {TEX_VORONOI_F1, "VORONOI_F1", 0, "Voronoi F1", 00803 "Noise algorithm - Voronoi F1: Returns distance to the closest feature point"}, 00804 {TEX_VORONOI_F2, "VORONOI_F2", 0, "Voronoi F2", 00805 "Noise algorithm - Voronoi F2: Returns distance to the 2nd closest feature point"}, 00806 {TEX_VORONOI_F3, "VORONOI_F3", 0, "Voronoi F3", 00807 "Noise algorithm - Voronoi F3: Returns distance to the 3rd closest feature point"}, 00808 {TEX_VORONOI_F4, "VORONOI_F4", 0, "Voronoi F4", 00809 "Noise algorithm - Voronoi F4: Returns distance to the 4th closest feature point"}, 00810 {TEX_VORONOI_F2F1, "VORONOI_F2_F1", 0, "Voronoi F2-F1", "Noise algorithm - Voronoi F1-F2"}, 00811 {TEX_VORONOI_CRACKLE, "VORONOI_CRACKLE", 0, "Voronoi Crackle", 00812 "Noise algorithm - Voronoi Crackle: Voronoi tessellation with sharp edges"}, 00813 {TEX_CELLNOISE, "CELL_NOISE", 0, "Cell Noise", 00814 "Noise algorithm - Cell Noise: Square cell tessellation"}, 00815 {0, NULL, 0, NULL, NULL}}; 00816 00817 static EnumPropertyItem prop_noise_type[] = { 00818 {TEX_NOISESOFT, "SOFT_NOISE", 0, "Soft", "Generate soft noise (smooth transitions)"}, 00819 {TEX_NOISEPERL, "HARD_NOISE", 0, "Hard", "Generate hard noise (sharp transitions)"}, 00820 {0, NULL, 0, NULL, NULL}}; 00821 00822 00823 static void rna_def_texture_clouds(BlenderRNA *brna) 00824 { 00825 StructRNA *srna; 00826 PropertyRNA *prop; 00827 00828 static EnumPropertyItem prop_clouds_stype[] = { 00829 {TEX_DEFAULT, "GREYSCALE", 0, "Greyscale", ""}, 00830 {TEX_COLOR, "COLOR", 0, "Color", ""}, 00831 {0, NULL, 0, NULL, NULL}}; 00832 00833 srna= RNA_def_struct(brna, "CloudsTexture", "Texture"); 00834 RNA_def_struct_ui_text(srna, "Clouds Texture", "Procedural noise texture"); 00835 RNA_def_struct_sdna(srna, "Tex"); 00836 00837 prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE); 00838 RNA_def_property_float_sdna(prop, NULL, "noisesize"); 00839 RNA_def_property_range(prop, 0.0001, FLT_MAX); 00840 RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); 00841 RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input"); 00842 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00843 00844 prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE); 00845 RNA_def_property_int_sdna(prop, NULL, "noisedepth"); 00846 RNA_def_property_range(prop, 0, 30); 00847 RNA_def_property_ui_range(prop, 0, 24, 0, 2); 00848 RNA_def_property_ui_text(prop, "Noise Depth", "Depth of the cloud calculation"); 00849 RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); 00850 00851 prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); 00852 RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); 00853 RNA_def_property_enum_items(prop, prop_noise_basis_items); 00854 RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence"); 00855 RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); 00856 00857 prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); 00858 RNA_def_property_enum_sdna(prop, NULL, "noisetype"); 00859 RNA_def_property_enum_items(prop, prop_noise_type); 00860 RNA_def_property_ui_text(prop, "Noise Type", ""); 00861 RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); 00862 00863 prop= RNA_def_property(srna, "cloud_type", PROP_ENUM, PROP_NONE); 00864 RNA_def_property_enum_sdna(prop, NULL, "stype"); 00865 RNA_def_property_enum_items(prop, prop_clouds_stype); 00866 RNA_def_property_ui_text(prop, "Color", "Determine whether Noise returns grayscale or RGB values"); 00867 RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); 00868 00869 prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE); 00870 RNA_def_property_range(prop, 0.001, 0.1); 00871 RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2); 00872 RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal"); 00873 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00874 } 00875 00876 static void rna_def_texture_wood(BlenderRNA *brna) 00877 { 00878 StructRNA *srna; 00879 PropertyRNA *prop; 00880 00881 static EnumPropertyItem prop_wood_stype[] = { 00882 {TEX_BAND, "BANDS", 0, "Bands", "Use standard wood texture in bands"}, 00883 {TEX_RING, "RINGS", 0, "Rings", "Use wood texture in rings"}, 00884 {TEX_BANDNOISE, "BANDNOISE", 0, "Band Noise", "Add noise to standard wood"}, 00885 {TEX_RINGNOISE, "RINGNOISE", 0, "Ring Noise", "Add noise to rings"}, 00886 {0, NULL, 0, NULL, NULL}}; 00887 00888 static EnumPropertyItem prop_wood_noisebasis2[] = { 00889 {TEX_SIN, "SIN", 0, "Sine", "Use a sine wave to produce bands"}, 00890 {TEX_SAW, "SAW", 0, "Saw", "Use a saw wave to produce bands"}, 00891 {TEX_TRI, "TRI", 0, "Tri", "Use a triangle wave to produce bands"}, 00892 {0, NULL, 0, NULL, NULL}}; 00893 00894 srna= RNA_def_struct(brna, "WoodTexture", "Texture"); 00895 RNA_def_struct_ui_text(srna, "Wood Texture", "Procedural noise texture"); 00896 RNA_def_struct_sdna(srna, "Tex"); 00897 00898 prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE); 00899 RNA_def_property_float_sdna(prop, NULL, "noisesize"); 00900 RNA_def_property_range(prop, 0.0001, FLT_MAX); 00901 RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); 00902 RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input"); 00903 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00904 00905 prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE); 00906 RNA_def_property_float_sdna(prop, NULL, "turbul"); 00907 RNA_def_property_range(prop, 0.0001, FLT_MAX); 00908 RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2); 00909 RNA_def_property_ui_text(prop, "Turbulence", "Turbulence of the bandnoise and ringnoise types"); 00910 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00911 00912 prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); 00913 RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); 00914 RNA_def_property_enum_items(prop, prop_noise_basis_items); 00915 RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence"); 00916 RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); 00917 00918 prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); 00919 RNA_def_property_enum_sdna(prop, NULL, "noisetype"); 00920 RNA_def_property_enum_items(prop, prop_noise_type); 00921 RNA_def_property_ui_text(prop, "Noise Type", ""); 00922 RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); 00923 00924 prop= RNA_def_property(srna, "wood_type", PROP_ENUM, PROP_NONE); 00925 RNA_def_property_enum_sdna(prop, NULL, "stype"); 00926 RNA_def_property_enum_items(prop, prop_wood_stype); 00927 RNA_def_property_ui_text(prop, "Pattern", ""); 00928 RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); 00929 00930 prop= RNA_def_property(srna, "noise_basis_2", PROP_ENUM, PROP_NONE); 00931 RNA_def_property_enum_sdna(prop, NULL, "noisebasis2"); 00932 RNA_def_property_enum_items(prop, prop_wood_noisebasis2); 00933 RNA_def_property_ui_text(prop, "Noise Basis 2", ""); 00934 RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); 00935 00936 prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE); 00937 RNA_def_property_range(prop, 0.001, 0.1); 00938 RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2); 00939 RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal"); 00940 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00941 00942 } 00943 00944 static void rna_def_texture_marble(BlenderRNA *brna) 00945 { 00946 StructRNA *srna; 00947 PropertyRNA *prop; 00948 00949 static EnumPropertyItem prop_marble_stype[] = { 00950 {TEX_SOFT, "SOFT", 0, "Soft", "Use soft marble"}, 00951 {TEX_SHARP, "SHARP", 0, "Sharp", "Use more clearly defined marble"}, 00952 {TEX_SHARPER, "SHARPER", 0, "Sharper", "Use very clearly defined marble"}, 00953 {0, NULL, 0, NULL, NULL}}; 00954 00955 static EnumPropertyItem prop_marble_noisebasis2[] = { 00956 {TEX_SIN, "SIN", 0, "Sin", "Use a sine wave to produce bands"}, 00957 {TEX_SAW, "SAW", 0, "Saw", "Use a saw wave to produce bands"}, 00958 {TEX_TRI, "TRI", 0, "Tri", "Use a triangle wave to produce bands"}, 00959 {0, NULL, 0, NULL, NULL}}; 00960 00961 srna= RNA_def_struct(brna, "MarbleTexture", "Texture"); 00962 RNA_def_struct_ui_text(srna, "Marble Texture", "Procedural noise texture"); 00963 RNA_def_struct_sdna(srna, "Tex"); 00964 00965 prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE); 00966 RNA_def_property_float_sdna(prop, NULL, "noisesize"); 00967 RNA_def_property_range(prop, 0.0001, FLT_MAX); 00968 RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); 00969 RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input"); 00970 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00971 00972 prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE); 00973 RNA_def_property_float_sdna(prop, NULL, "turbul"); 00974 RNA_def_property_range(prop, 0.0001, FLT_MAX); 00975 RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2); 00976 RNA_def_property_ui_text(prop, "Turbulence", "Turbulence of the bandnoise and ringnoise types"); 00977 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00978 00979 prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE); 00980 RNA_def_property_int_sdna(prop, NULL, "noisedepth"); 00981 RNA_def_property_range(prop, 0, 30); 00982 RNA_def_property_ui_range(prop, 0, 24, 0, 2); 00983 RNA_def_property_ui_text(prop, "Noise Depth", "Depth of the cloud calculation"); 00984 RNA_def_property_update(prop, 0, "rna_Texture_update"); 00985 00986 prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); 00987 RNA_def_property_enum_sdna(prop, NULL, "noisetype"); 00988 RNA_def_property_enum_items(prop, prop_noise_type); 00989 RNA_def_property_ui_text(prop, "Noise Type", ""); 00990 RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); 00991 00992 prop= RNA_def_property(srna, "marble_type", PROP_ENUM, PROP_NONE); 00993 RNA_def_property_enum_sdna(prop, NULL, "stype"); 00994 RNA_def_property_enum_items(prop, prop_marble_stype); 00995 RNA_def_property_ui_text(prop, "Pattern", ""); 00996 RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); 00997 00998 prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); 00999 RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); 01000 RNA_def_property_enum_items(prop, prop_noise_basis_items); 01001 RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence"); 01002 RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); 01003 01004 prop= RNA_def_property(srna, "noise_basis_2", PROP_ENUM, PROP_NONE); 01005 RNA_def_property_enum_sdna(prop, NULL, "noisebasis2"); 01006 RNA_def_property_enum_items(prop, prop_marble_noisebasis2); 01007 RNA_def_property_ui_text(prop, "Noise Basis 2", ""); 01008 RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); 01009 01010 prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE); 01011 RNA_def_property_range(prop, 0.001, 0.1); 01012 RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2); 01013 RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal"); 01014 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01015 01016 } 01017 01018 static void rna_def_texture_magic(BlenderRNA *brna) 01019 { 01020 StructRNA *srna; 01021 PropertyRNA *prop; 01022 01023 srna= RNA_def_struct(brna, "MagicTexture", "Texture"); 01024 RNA_def_struct_ui_text(srna, "Magic Texture", "Procedural noise texture"); 01025 RNA_def_struct_sdna(srna, "Tex"); 01026 01027 prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE); 01028 RNA_def_property_float_sdna(prop, NULL, "turbul"); 01029 RNA_def_property_range(prop, 0.0001, FLT_MAX); 01030 RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2); 01031 RNA_def_property_ui_text(prop, "Turbulence", "Turbulence of the noise"); 01032 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01033 01034 prop= RNA_def_property(srna, "noise_depth", PROP_INT, PROP_NONE); 01035 RNA_def_property_int_sdna(prop, NULL, "noisedepth"); 01036 RNA_def_property_range(prop, 0, 30); 01037 RNA_def_property_ui_range(prop, 0, 24, 0, 2); 01038 RNA_def_property_ui_text(prop, "Noise Depth", "Depth of the noise"); 01039 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01040 } 01041 01042 static void rna_def_texture_blend(BlenderRNA *brna) 01043 { 01044 StructRNA *srna; 01045 PropertyRNA *prop; 01046 01047 static EnumPropertyItem prop_blend_progression[] = { 01048 {TEX_LIN, "LINEAR", 0, "Linear", "Create a linear progression"}, 01049 {TEX_QUAD, "QUADRATIC", 0, "Quadratic", "Create a quadratic progression"}, 01050 {TEX_EASE, "EASING", 0, "Easing", "Create a progression easing from one step to the next"}, 01051 {TEX_DIAG, "DIAGONAL", 0, "Diagonal", "Create a diagonal progression"}, 01052 {TEX_SPHERE, "SPHERICAL", 0, "Spherical", "Create a spherical progression"}, 01053 {TEX_HALO, "QUADRATIC_SPHERE", 0, "Quadratic sphere", "Create a quadratic progression in the shape of a sphere"}, 01054 {TEX_RAD, "RADIAL", 0, "Radial", "Create a radial progression"}, 01055 {0, NULL, 0, NULL, NULL}}; 01056 01057 static const EnumPropertyItem prop_flip_axis_items[]= { 01058 {0, "HORIZONTAL", 0, "Horizontal", "No flipping"}, 01059 {TEX_FLIPBLEND, "VERTICAL", 0, "Vertical", "Flip the texture's X and Y axis"}, 01060 {0, NULL, 0, NULL, NULL}}; 01061 01062 srna= RNA_def_struct(brna, "BlendTexture", "Texture"); 01063 RNA_def_struct_ui_text(srna, "Blend Texture", "Procedural color blending texture"); 01064 RNA_def_struct_sdna(srna, "Tex"); 01065 01066 prop= RNA_def_property(srna, "progression", PROP_ENUM, PROP_NONE); 01067 RNA_def_property_enum_sdna(prop, NULL, "stype"); 01068 RNA_def_property_enum_items(prop, prop_blend_progression); 01069 RNA_def_property_ui_text(prop, "Progression", "Style of the color blending"); 01070 RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); 01071 01072 prop= RNA_def_property(srna, "use_flip_axis", PROP_ENUM, PROP_NONE); 01073 RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); 01074 RNA_def_property_enum_items(prop, prop_flip_axis_items); 01075 RNA_def_property_ui_text(prop, "Flip Axis", "Flip the texture's X and Y axis"); 01076 RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); 01077 01078 } 01079 01080 static void rna_def_texture_stucci(BlenderRNA *brna) 01081 { 01082 StructRNA *srna; 01083 PropertyRNA *prop; 01084 01085 static EnumPropertyItem prop_stucci_stype[] = { 01086 {TEX_PLASTIC, "PLASTIC", 0, "Plastic", "Use standard stucci"}, 01087 {TEX_WALLIN, "WALL_IN", 0, "Wall in", "Create Dimples"}, 01088 {TEX_WALLOUT, "WALL_OUT", 0, "Wall out", "Create Ridges"}, 01089 {0, NULL, 0, NULL, NULL}}; 01090 01091 srna= RNA_def_struct(brna, "StucciTexture", "Texture"); 01092 RNA_def_struct_ui_text(srna, "Stucci Texture", "Procedural noise texture"); 01093 RNA_def_struct_sdna(srna, "Tex"); 01094 01095 prop= RNA_def_property(srna, "turbulence", PROP_FLOAT, PROP_NONE); 01096 RNA_def_property_float_sdna(prop, NULL, "turbul"); 01097 RNA_def_property_range(prop, 0.0001, FLT_MAX); 01098 RNA_def_property_ui_range(prop, 0.0001, 200, 10, 2); 01099 RNA_def_property_ui_text(prop, "Turbulence", "Turbulence of the noise"); 01100 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01101 01102 prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); 01103 RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); 01104 RNA_def_property_enum_items(prop, prop_noise_basis_items); 01105 RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence"); 01106 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01107 01108 prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE); 01109 RNA_def_property_float_sdna(prop, NULL, "noisesize"); 01110 RNA_def_property_range(prop, 0.0001, FLT_MAX); 01111 RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); 01112 RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input"); 01113 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01114 01115 prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); 01116 RNA_def_property_enum_sdna(prop, NULL, "noisetype"); 01117 RNA_def_property_enum_items(prop, prop_noise_type); 01118 RNA_def_property_ui_text(prop, "Noise Type", ""); 01119 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01120 01121 prop= RNA_def_property(srna, "stucci_type", PROP_ENUM, PROP_NONE); 01122 RNA_def_property_enum_sdna(prop, NULL, "stype"); 01123 RNA_def_property_enum_items(prop, prop_stucci_stype); 01124 RNA_def_property_ui_text(prop, "Pattern", ""); 01125 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01126 } 01127 01128 static void rna_def_texture_noise(BlenderRNA *brna) 01129 { 01130 StructRNA *srna; 01131 01132 srna= RNA_def_struct(brna, "NoiseTexture", "Texture"); 01133 RNA_def_struct_ui_text(srna, "Noise Texture", "Procedural noise texture"); 01134 RNA_def_struct_sdna(srna, "Tex"); 01135 } 01136 01137 static void rna_def_texture_image(BlenderRNA *brna) 01138 { 01139 StructRNA *srna; 01140 PropertyRNA *prop; 01141 01142 static EnumPropertyItem prop_image_extension[] = { 01143 {TEX_EXTEND, "EXTEND", 0, "Extend", "Extend by repeating edge pixels of the image"}, 01144 {TEX_CLIP, "CLIP", 0, "Clip", "Clip to image size and set exterior pixels as transparent"}, 01145 {TEX_CLIPCUBE, "CLIP_CUBE", 0, "Clip Cube", 01146 "Clip to cubic-shaped area around the image and set exterior pixels as transparent"}, 01147 {TEX_REPEAT, "REPEAT", 0, "Repeat", "Cause the image to repeat horizontally and vertically"}, 01148 {TEX_CHECKER, "CHECKER", 0, "Checker", "Cause the image to repeat in checker board pattern"}, 01149 {0, NULL, 0, NULL, NULL}}; 01150 01151 srna= RNA_def_struct(brna, "ImageTexture", "Texture"); 01152 RNA_def_struct_ui_text(srna, "Image Texture", ""); 01153 RNA_def_struct_sdna(srna, "Tex"); 01154 01155 prop= RNA_def_property(srna, "use_interpolation", PROP_BOOLEAN, PROP_NONE); 01156 RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_INTERPOL); 01157 RNA_def_property_ui_text(prop, "Interpolation", "Interpolate pixels using selected filter"); 01158 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01159 01160 /* XXX: I think flip_axis should be a generic Texture property, enabled for all the texture types */ 01161 prop= RNA_def_property(srna, "use_flip_axis", PROP_BOOLEAN, PROP_NONE); 01162 RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_IMAROT); 01163 RNA_def_property_ui_text(prop, "Flip Axis", "Flip the texture's X and Y axis"); 01164 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01165 01166 prop= RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE); 01167 RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_USEALPHA); 01168 RNA_def_property_ui_text(prop, "Use Alpha", "Use the alpha channel information in the image"); 01169 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01170 01171 prop= RNA_def_property(srna, "use_calculate_alpha", PROP_BOOLEAN, PROP_NONE); 01172 RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_CALCALPHA); 01173 RNA_def_property_ui_text(prop, "Calculate Alpha", "Calculate an alpha channel based on RGB values in the image"); 01174 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01175 01176 prop= RNA_def_property(srna, "invert_alpha", PROP_BOOLEAN, PROP_NONE); 01177 RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_NEGALPHA); 01178 RNA_def_property_ui_text(prop, "Invert Alpha", "Invert all the alpha values in the image"); 01179 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01180 01181 rna_def_filter_common(srna); 01182 01183 prop= RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE); 01184 RNA_def_property_enum_sdna(prop, NULL, "extend"); 01185 RNA_def_property_enum_items(prop, prop_image_extension); 01186 RNA_def_property_ui_text(prop, "Extension", "How the image is extrapolated past its original bounds"); 01187 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01188 01189 prop= RNA_def_property(srna, "repeat_x", PROP_INT, PROP_NONE); 01190 RNA_def_property_int_sdna(prop, NULL, "xrepeat"); 01191 RNA_def_property_range(prop, 1, 512); 01192 RNA_def_property_ui_text(prop, "Repeat X", "Repetition multiplier in the X direction"); 01193 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01194 01195 prop= RNA_def_property(srna, "repeat_y", PROP_INT, PROP_NONE); 01196 RNA_def_property_int_sdna(prop, NULL, "yrepeat"); 01197 RNA_def_property_range(prop, 1, 512); 01198 RNA_def_property_ui_text(prop, "Repeat Y", "Repetition multiplier in the Y direction"); 01199 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01200 01201 prop= RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE); 01202 RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_REPEAT_XMIR); 01203 RNA_def_property_ui_text(prop, "Mirror X", "Mirror the image repetition on the X direction"); 01204 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01205 01206 prop= RNA_def_property(srna, "use_mirror_y", PROP_BOOLEAN, PROP_NONE); 01207 RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_REPEAT_YMIR); 01208 RNA_def_property_ui_text(prop, "Mirror Y", "Mirror the image repetition on the Y direction"); 01209 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01210 01211 prop= RNA_def_property(srna, "use_checker_odd", PROP_BOOLEAN, PROP_NONE); 01212 RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_CHECKER_ODD); 01213 RNA_def_property_ui_text(prop, "Checker Odd", "Odd checker tiles"); 01214 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01215 01216 prop= RNA_def_property(srna, "use_checker_even", PROP_BOOLEAN, PROP_NONE); 01217 RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_CHECKER_EVEN); 01218 RNA_def_property_ui_text(prop, "Checker Even", "Even checker tiles"); 01219 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01220 01221 prop= RNA_def_property(srna, "checker_distance", PROP_FLOAT, PROP_NONE); 01222 RNA_def_property_float_sdna(prop, NULL, "checkerdist"); 01223 RNA_def_property_range(prop, 0.0, 0.99); 01224 RNA_def_property_ui_range(prop, 0.0, 0.99, 0.1, 0.01); 01225 RNA_def_property_ui_text(prop, "Checker Distance", "Distance between checker tiles"); 01226 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01227 01228 #if 0 01229 01230 /* XXX: did this as an array, but needs better descriptions than "1 2 3 4" 01231 perhaps a new subtype could be added? 01232 --I actually used single values for this, maybe change later with a RNA_Rect thing? */ 01233 prop= RNA_def_property(srna, "crop_rectangle", PROP_FLOAT, PROP_NONE); 01234 RNA_def_property_float_sdna(prop, NULL, "cropxmin"); 01235 RNA_def_property_array(prop, 4); 01236 RNA_def_property_range(prop, -10, 10); 01237 RNA_def_property_ui_text(prop, "Crop Rectangle", ""); 01238 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01239 01240 #endif 01241 01242 prop= RNA_def_property(srna, "crop_min_x", PROP_FLOAT, PROP_NONE); 01243 RNA_def_property_float_sdna(prop, NULL, "cropxmin"); 01244 RNA_def_property_range(prop, -10.0, 10.0); 01245 RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2); 01246 RNA_def_property_ui_text(prop, "Crop Minimum X", "Minimum X value to crop the image"); 01247 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01248 01249 prop= RNA_def_property(srna, "crop_min_y", PROP_FLOAT, PROP_NONE); 01250 RNA_def_property_float_sdna(prop, NULL, "cropymin"); 01251 RNA_def_property_range(prop, -10.0, 10.0); 01252 RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2); 01253 RNA_def_property_ui_text(prop, "Crop Minimum Y", "Minimum Y value to crop the image"); 01254 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01255 01256 prop= RNA_def_property(srna, "crop_max_x", PROP_FLOAT, PROP_NONE); 01257 RNA_def_property_float_sdna(prop, NULL, "cropxmax"); 01258 RNA_def_property_range(prop, -10.0, 10.0); 01259 RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2); 01260 RNA_def_property_ui_text(prop, "Crop Maximum X", "Maximum X value to crop the image"); 01261 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01262 01263 prop= RNA_def_property(srna, "crop_max_y", PROP_FLOAT, PROP_NONE); 01264 RNA_def_property_float_sdna(prop, NULL, "cropymax"); 01265 RNA_def_property_range(prop, -10.0, 10.0); 01266 RNA_def_property_ui_range(prop, -10.0, 10.0, 1, 0.2); 01267 RNA_def_property_ui_text(prop, "Crop Maximum Y", "Maximum Y value to crop the image"); 01268 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01269 01270 prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); 01271 RNA_def_property_pointer_sdna(prop, NULL, "ima"); 01272 RNA_def_property_struct_type(prop, "Image"); 01273 RNA_def_property_flag(prop, PROP_EDITABLE); 01274 RNA_def_property_ui_text(prop, "Image", ""); 01275 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01276 01277 prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL); 01278 RNA_def_property_pointer_sdna(prop, NULL, "iuser"); 01279 RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed"); 01280 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01281 01282 /* Normal Map */ 01283 prop= RNA_def_property(srna, "use_normal_map", PROP_BOOLEAN, PROP_NONE); 01284 RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_NORMALMAP); 01285 RNA_def_property_ui_text(prop, "Normal Map", "Use image RGB values for normal mapping"); 01286 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01287 01288 /* Derivative Map */ 01289 prop= RNA_def_property(srna, "use_derivative_map", PROP_BOOLEAN, PROP_NONE); 01290 RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_DERIVATIVEMAP); 01291 RNA_def_property_ui_text(prop, "Derivative Map", "Use red and green as derivative values"); 01292 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01293 } 01294 01295 static void rna_def_texture_plugin(BlenderRNA *brna) 01296 { 01297 StructRNA *srna; 01298 01299 srna= RNA_def_struct(brna, "PluginTexture", "Texture"); 01300 RNA_def_struct_ui_text(srna, "Plugin", "External plugin texture"); 01301 RNA_def_struct_sdna(srna, "Tex"); 01302 01303 /* XXX: todo */ 01304 } 01305 01306 static void rna_def_texture_environment_map(BlenderRNA *brna) 01307 { 01308 StructRNA *srna; 01309 PropertyRNA *prop; 01310 01311 srna= RNA_def_struct(brna, "EnvironmentMapTexture", "Texture"); 01312 RNA_def_struct_ui_text(srna, "Environment Map", "Environment map texture"); 01313 RNA_def_struct_sdna(srna, "Tex"); 01314 01315 prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); 01316 RNA_def_property_pointer_sdna(prop, NULL, "ima"); 01317 RNA_def_property_struct_type(prop, "Image"); 01318 RNA_def_property_flag(prop, PROP_EDITABLE); 01319 RNA_def_property_ui_text(prop, "Image", "Source image file to read the environment map from"); 01320 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01321 01322 prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL); 01323 RNA_def_property_pointer_sdna(prop, NULL, "iuser"); 01324 RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed"); 01325 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01326 01327 rna_def_filter_common(srna); 01328 01329 prop= RNA_def_property(srna, "environment_map", PROP_POINTER, PROP_NONE); 01330 RNA_def_property_pointer_sdna(prop, NULL, "env"); 01331 RNA_def_property_struct_type(prop, "EnvironmentMap"); 01332 RNA_def_property_ui_text(prop, "Environment Map", "Get the environment map associated with this texture"); 01333 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01334 } 01335 01336 static void rna_def_texture_musgrave(BlenderRNA *brna) 01337 { 01338 StructRNA *srna; 01339 PropertyRNA *prop; 01340 01341 static EnumPropertyItem prop_musgrave_type[] = { 01342 {TEX_MFRACTAL, "MULTIFRACTAL", 0, "Multifractal", "Use Perlin noise as a basis"}, 01343 {TEX_RIDGEDMF, "RIDGED_MULTIFRACTAL", 0, "Ridged Multifractal", 01344 "Use Perlin noise with inflection as a basis"}, 01345 {TEX_HYBRIDMF, "HYBRID_MULTIFRACTAL", 0, "Hybrid Multifractal", 01346 "Use Perlin noise as a basis, with extended controls"}, 01347 {TEX_FBM, "FBM", 0, "fBM", "Fractal Brownian Motion, use Brownian noise as a basis"}, 01348 {TEX_HTERRAIN, "HETERO_TERRAIN", 0, "Hetero Terrain", "Similar to multifractal"}, 01349 {0, NULL, 0, NULL, NULL}}; 01350 01351 srna= RNA_def_struct(brna, "MusgraveTexture", "Texture"); 01352 RNA_def_struct_ui_text(srna, "Musgrave", "Procedural musgrave texture"); 01353 RNA_def_struct_sdna(srna, "Tex"); 01354 01355 prop= RNA_def_property(srna, "musgrave_type", PROP_ENUM, PROP_NONE); 01356 RNA_def_property_enum_sdna(prop, NULL, "stype"); 01357 RNA_def_property_enum_items(prop, prop_musgrave_type); 01358 RNA_def_property_ui_text(prop, "Type", "Fractal noise algorithm"); 01359 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01360 01361 prop= RNA_def_property(srna, "dimension_max", PROP_FLOAT, PROP_NONE); 01362 RNA_def_property_float_sdna(prop, NULL, "mg_H"); 01363 RNA_def_property_range(prop, 0.0001, 2); 01364 RNA_def_property_ui_text(prop, "Highest Dimension", "Highest fractal dimension"); 01365 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01366 01367 prop= RNA_def_property(srna, "lacunarity", PROP_FLOAT, PROP_NONE); 01368 RNA_def_property_float_sdna(prop, NULL, "mg_lacunarity"); 01369 RNA_def_property_range(prop, 0, 6); 01370 RNA_def_property_ui_text(prop, "Lacunarity", "Gap between successive frequencies"); 01371 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01372 01373 prop= RNA_def_property(srna, "octaves", PROP_FLOAT, PROP_NONE); 01374 RNA_def_property_float_sdna(prop, NULL, "mg_octaves"); 01375 RNA_def_property_range(prop, 0, 8); 01376 RNA_def_property_ui_text(prop, "Octaves", "Number of frequencies used"); 01377 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01378 01379 prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE); 01380 RNA_def_property_float_sdna(prop, NULL, "mg_offset"); 01381 RNA_def_property_range(prop, 0, 6); 01382 RNA_def_property_ui_text(prop, "Offset", "The fractal offset"); 01383 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01384 01385 prop= RNA_def_property(srna, "gain", PROP_FLOAT, PROP_NONE); 01386 RNA_def_property_float_sdna(prop, NULL, "mg_gain"); 01387 RNA_def_property_range(prop, 0, 6); 01388 RNA_def_property_ui_text(prop, "Gain", "The gain multiplier"); 01389 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01390 01391 prop= RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE); 01392 RNA_def_property_float_sdna(prop, NULL, "ns_outscale"); 01393 RNA_def_property_range(prop, 0, 10); 01394 RNA_def_property_ui_text(prop, "Noise Intensity", "Intensity of the noise"); 01395 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01396 01397 prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE); 01398 RNA_def_property_float_sdna(prop, NULL, "noisesize"); 01399 RNA_def_property_range(prop, 0.0001, FLT_MAX); 01400 RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); 01401 RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input"); 01402 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01403 01404 prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); 01405 RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); 01406 RNA_def_property_enum_items(prop, prop_noise_basis_items); 01407 RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence"); 01408 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01409 01410 prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE); 01411 RNA_def_property_range(prop, 0.001, 0.1); 01412 RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2); 01413 RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal"); 01414 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01415 } 01416 01417 static void rna_def_texture_voronoi(BlenderRNA *brna) 01418 { 01419 StructRNA *srna; 01420 PropertyRNA *prop; 01421 01422 static EnumPropertyItem prop_distance_metric_items[] = { 01423 {TEX_DISTANCE, "DISTANCE", 0, "Actual Distance", "sqrt(x*x+y*y+z*z)"}, 01424 {TEX_DISTANCE_SQUARED, "DISTANCE_SQUARED", 0, "Distance Squared", "(x*x+y*y+z*z)"}, 01425 {TEX_MANHATTAN, "MANHATTAN", 0, "Manhattan", 01426 "The length of the distance in axial directions"}, 01427 {TEX_CHEBYCHEV, "CHEBYCHEV", 0, "Chebychev", 01428 "The length of the longest Axial journey"}, 01429 {TEX_MINKOVSKY_HALF, "MINKOVSKY_HALF", 0, "Minkovsky 1/2", 01430 "Set Minkovsky variable to 0.5"}, 01431 {TEX_MINKOVSKY_FOUR, "MINKOVSKY_FOUR", 0, "Minkovsky 4", 01432 "Set Minkovsky variable to 4"}, 01433 {TEX_MINKOVSKY, "MINKOVSKY", 0, "Minkovsky", 01434 "Use the Minkowsky function to calculate distance " 01435 "(exponent value determines the shape of the boundaries)"}, 01436 {0, NULL, 0, NULL, NULL}}; 01437 01438 static EnumPropertyItem prop_coloring_items[] = { 01439 /* XXX: OK names / descriptions? */ 01440 {TEX_INTENSITY, "INTENSITY", 0, "Intensity", "Only calculate intensity"}, 01441 {TEX_COL1, "POSITION", 0, "Position", "Color cells by position"}, 01442 {TEX_COL2, "POSITION_OUTLINE", 0, "Position and Outline", "Use position plus an outline based on F2-F1"}, 01443 {TEX_COL3, "POSITION_OUTLINE_INTENSITY", 0, "Position, Outline, and Intensity", 01444 "Multiply position and outline by intensity"}, 01445 {0, NULL, 0, NULL, NULL}}; 01446 01447 srna= RNA_def_struct(brna, "VoronoiTexture", "Texture"); 01448 RNA_def_struct_ui_text(srna, "Voronoi", "Procedural voronoi texture"); 01449 RNA_def_struct_sdna(srna, "Tex"); 01450 01451 prop= RNA_def_property(srna, "weight_1", PROP_FLOAT, PROP_NONE); 01452 RNA_def_property_float_sdna(prop, NULL, "vn_w1"); 01453 RNA_def_property_range(prop, -2, 2); 01454 RNA_def_property_ui_text(prop, "Weight 1", "Voronoi feature weight 1"); 01455 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01456 01457 prop= RNA_def_property(srna, "weight_2", PROP_FLOAT, PROP_NONE); 01458 RNA_def_property_float_sdna(prop, NULL, "vn_w2"); 01459 RNA_def_property_range(prop, -2, 2); 01460 RNA_def_property_ui_text(prop, "Weight 2", "Voronoi feature weight 2"); 01461 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01462 01463 prop= RNA_def_property(srna, "weight_3", PROP_FLOAT, PROP_NONE); 01464 RNA_def_property_float_sdna(prop, NULL, "vn_w3"); 01465 RNA_def_property_range(prop, -2, 2); 01466 RNA_def_property_ui_text(prop, "Weight 3", "Voronoi feature weight 3"); 01467 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01468 01469 prop= RNA_def_property(srna, "weight_4", PROP_FLOAT, PROP_NONE); 01470 RNA_def_property_float_sdna(prop, NULL, "vn_w4"); 01471 RNA_def_property_range(prop, -2, 2); 01472 RNA_def_property_ui_text(prop, "Weight 4", "Voronoi feature weight 4"); 01473 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01474 01475 prop= RNA_def_property(srna, "minkovsky_exponent", PROP_FLOAT, PROP_NONE); 01476 RNA_def_property_float_sdna(prop, NULL, "vn_mexp"); 01477 RNA_def_property_range(prop, 0.01, 10); 01478 RNA_def_property_ui_text(prop, "Minkovsky Exponent", "Minkovsky exponent"); 01479 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01480 01481 prop= RNA_def_property(srna, "distance_metric", PROP_ENUM, PROP_NONE); 01482 RNA_def_property_enum_sdna(prop, NULL, "vn_distm"); 01483 RNA_def_property_enum_items(prop, prop_distance_metric_items); 01484 RNA_def_property_ui_text(prop, "Distance Metric", "Algorithm used to calculate distance of sample points to feature points"); 01485 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01486 01487 prop= RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE); 01488 RNA_def_property_enum_sdna(prop, NULL, "vn_coltype"); 01489 RNA_def_property_enum_items(prop, prop_coloring_items); 01490 RNA_def_property_ui_text(prop, "Coloring", ""); 01491 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01492 01493 prop= RNA_def_property(srna, "noise_intensity", PROP_FLOAT, PROP_NONE); 01494 RNA_def_property_float_sdna(prop, NULL, "ns_outscale"); 01495 RNA_def_property_range(prop, 0.01, 10); 01496 RNA_def_property_ui_text(prop, "Noise Intensity", "Scales the intensity of the noise"); 01497 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01498 01499 prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE); 01500 RNA_def_property_float_sdna(prop, NULL, "noisesize"); 01501 RNA_def_property_range(prop, 0.0001, FLT_MAX); 01502 RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); 01503 RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input"); 01504 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01505 01506 prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE); 01507 RNA_def_property_range(prop, 0.001, 0.1); 01508 RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2); 01509 RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal"); 01510 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01511 } 01512 01513 static void rna_def_texture_distorted_noise(BlenderRNA *brna) 01514 { 01515 StructRNA *srna; 01516 PropertyRNA *prop; 01517 01518 srna= RNA_def_struct(brna, "DistortedNoiseTexture", "Texture"); 01519 RNA_def_struct_ui_text(srna, "Distorted Noise", "Procedural distorted noise texture"); 01520 RNA_def_struct_sdna(srna, "Tex"); 01521 01522 prop= RNA_def_property(srna, "distortion", PROP_FLOAT, PROP_NONE); 01523 RNA_def_property_float_sdna(prop, NULL, "dist_amount"); 01524 RNA_def_property_range(prop, 0, 10); 01525 RNA_def_property_ui_text(prop, "Distortion Amount", "Amount of distortion"); 01526 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01527 01528 prop= RNA_def_property(srna, "noise_scale", PROP_FLOAT, PROP_NONE); 01529 RNA_def_property_float_sdna(prop, NULL, "noisesize"); 01530 RNA_def_property_range(prop, 0.0001, FLT_MAX); 01531 RNA_def_property_ui_range(prop, 0.0001, 2, 10, 2); 01532 RNA_def_property_ui_text(prop, "Noise Size", "Scaling for noise input"); 01533 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01534 01535 prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); 01536 RNA_def_property_enum_sdna(prop, NULL, "noisebasis2"); 01537 RNA_def_property_enum_items(prop, prop_noise_basis_items); 01538 RNA_def_property_ui_text(prop, "Noise Basis", "Noise basis used for turbulence"); 01539 RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); 01540 01541 prop= RNA_def_property(srna, "noise_distortion", PROP_ENUM, PROP_NONE); 01542 RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); 01543 RNA_def_property_enum_items(prop, prop_noise_basis_items); 01544 RNA_def_property_ui_text(prop, "Noise Distortion", "Noise basis for the distortion"); 01545 RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); 01546 01547 prop= RNA_def_property(srna, "nabla", PROP_FLOAT, PROP_NONE); 01548 RNA_def_property_range(prop, 0.001, 0.1); 01549 RNA_def_property_ui_range(prop, 0.001, 0.1, 1, 2); 01550 RNA_def_property_ui_text(prop, "Nabla", "Size of derivative offset used for calculating normal"); 01551 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01552 } 01553 01554 static void rna_def_texture_pointdensity(BlenderRNA *brna) 01555 { 01556 StructRNA *srna; 01557 PropertyRNA *prop; 01558 01559 static EnumPropertyItem point_source_items[] = { 01560 {TEX_PD_PSYS, "PARTICLE_SYSTEM", 0, "Particle System", "Generate point density from a particle system"}, 01561 {TEX_PD_OBJECT, "OBJECT", 0, "Object Vertices", "Generate point density from an object's vertices"}, 01562 //{TEX_PD_FILE, "FILE", 0 , "File", ""}, 01563 {0, NULL, 0, NULL, NULL}}; 01564 01565 static EnumPropertyItem particle_cache_items[] = { 01566 {TEX_PD_OBJECTLOC, "OBJECT_LOCATION", 0, "Emit Object Location", ""}, 01567 {TEX_PD_OBJECTSPACE, "OBJECT_SPACE", 0, "Emit Object Space", ""}, 01568 {TEX_PD_WORLDSPACE, "WORLD_SPACE", 0 , "Global Space", ""}, 01569 {0, NULL, 0, NULL, NULL}}; 01570 01571 static EnumPropertyItem vertice_cache_items[] = { 01572 {TEX_PD_OBJECTLOC, "OBJECT_LOCATION", 0, "Object Location", ""}, 01573 {TEX_PD_OBJECTSPACE, "OBJECT_SPACE", 0, "Object Space", ""}, 01574 {TEX_PD_WORLDSPACE, "WORLD_SPACE", 0 , "Global Space", ""}, 01575 {0, NULL, 0, NULL, NULL}}; 01576 01577 static EnumPropertyItem falloff_items[] = { 01578 {TEX_PD_FALLOFF_STD, "STANDARD", 0, "Standard", ""}, 01579 {TEX_PD_FALLOFF_SMOOTH, "SMOOTH", 0, "Smooth", ""}, 01580 {TEX_PD_FALLOFF_SOFT, "SOFT", 0, "Soft", ""}, 01581 {TEX_PD_FALLOFF_CONSTANT, "CONSTANT", 0, "Constant", "Density is constant within lookup radius"}, 01582 {TEX_PD_FALLOFF_ROOT, "ROOT", 0, "Root", ""}, 01583 {TEX_PD_FALLOFF_PARTICLE_AGE, "PARTICLE_AGE", 0, "Particle Age", ""}, 01584 {TEX_PD_FALLOFF_PARTICLE_VEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", ""}, 01585 {0, NULL, 0, NULL, NULL}}; 01586 01587 static EnumPropertyItem color_source_items[] = { 01588 {TEX_PD_COLOR_CONSTANT, "CONSTANT", 0, "Constant", ""}, 01589 {TEX_PD_COLOR_PARTAGE, "PARTICLE_AGE", 0, "Particle Age", "Lifetime mapped as 0.0 - 1.0 intensity"}, 01590 {TEX_PD_COLOR_PARTSPEED, "PARTICLE_SPEED", 0, "Particle Speed", 01591 "Particle speed (absolute magnitude of velocity) mapped as 0.0-1.0 intensity"}, 01592 {TEX_PD_COLOR_PARTVEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", "XYZ velocity mapped to RGB colors"}, 01593 {0, NULL, 0, NULL, NULL}}; 01594 01595 static EnumPropertyItem turbulence_influence_items[] = { 01596 {TEX_PD_NOISE_STATIC, "STATIC", 0, "Static", "Noise patterns will remain unchanged, faster and suitable for stills"}, 01597 {TEX_PD_NOISE_VEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", "Turbulent noise driven by particle velocity"}, 01598 {TEX_PD_NOISE_AGE, "PARTICLE_AGE", 0, "Particle Age", 01599 "Turbulent noise driven by the particle's age between birth and death"}, 01600 {TEX_PD_NOISE_TIME, "GLOBAL_TIME", 0, "Global Time", "Turbulent noise driven by the global current frame"}, 01601 {0, NULL, 0, NULL, NULL}}; 01602 01603 srna= RNA_def_struct(brna, "PointDensity", NULL); 01604 RNA_def_struct_sdna(srna, "PointDensity"); 01605 RNA_def_struct_ui_text(srna, "PointDensity", "Point density settings"); 01606 RNA_def_struct_path_func(srna, "rna_PointDensity_path"); 01607 01608 prop= RNA_def_property(srna, "point_source", PROP_ENUM, PROP_NONE); 01609 RNA_def_property_enum_sdna(prop, NULL, "source"); 01610 RNA_def_property_enum_items(prop, point_source_items); 01611 RNA_def_property_ui_text(prop, "Point Source", "Point data to use as renderable point density"); 01612 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01613 01614 prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); 01615 RNA_def_property_pointer_sdna(prop, NULL, "object"); 01616 RNA_def_property_ui_text(prop, "Object", "Object to take point data from"); 01617 RNA_def_property_flag(prop, PROP_EDITABLE); 01618 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01619 01620 prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE); 01621 RNA_def_property_ui_text(prop, "Particle System", "Particle System to render as points"); 01622 RNA_def_property_struct_type(prop, "ParticleSystem"); 01623 RNA_def_property_pointer_funcs(prop, "rna_PointDensity_psys_get", "rna_PointDensity_psys_set", NULL, NULL); 01624 RNA_def_property_flag(prop, PROP_EDITABLE); 01625 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01626 01627 prop= RNA_def_property(srna, "particle_cache_space", PROP_ENUM, PROP_NONE); 01628 RNA_def_property_enum_sdna(prop, NULL, "psys_cache_space"); 01629 RNA_def_property_enum_items(prop, particle_cache_items); 01630 RNA_def_property_ui_text(prop, "Particle Cache", "Coordinate system to cache particles in"); 01631 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01632 01633 prop= RNA_def_property(srna, "vertex_cache_space", PROP_ENUM, PROP_NONE); 01634 RNA_def_property_enum_sdna(prop, NULL, "ob_cache_space"); 01635 RNA_def_property_enum_items(prop, vertice_cache_items); 01636 RNA_def_property_ui_text(prop, "Vertices Cache", "Coordinate system to cache vertices in"); 01637 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01638 01639 prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE); 01640 RNA_def_property_float_sdna(prop, NULL, "radius"); 01641 RNA_def_property_range(prop, 0.001, FLT_MAX); 01642 RNA_def_property_ui_text(prop, "Radius", "Radius from the shaded sample to look for points within"); 01643 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01644 01645 prop= RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE); 01646 RNA_def_property_enum_sdna(prop, NULL, "falloff_type"); 01647 RNA_def_property_enum_items(prop, falloff_items); 01648 RNA_def_property_ui_text(prop, "Falloff", "Method of attenuating density by distance from the point"); 01649 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01650 01651 prop= RNA_def_property(srna, "falloff_soft", PROP_FLOAT, PROP_NONE); 01652 RNA_def_property_float_sdna(prop, NULL, "falloff_softness"); 01653 RNA_def_property_range(prop, 0.01, FLT_MAX); 01654 RNA_def_property_ui_text(prop, "Softness", "Softness of the 'soft' falloff option"); 01655 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01656 01657 prop= RNA_def_property(srna, "color_source", PROP_ENUM, PROP_NONE); 01658 RNA_def_property_enum_sdna(prop, NULL, "color_source"); 01659 RNA_def_property_enum_items(prop, color_source_items); 01660 RNA_def_property_ui_text(prop, "Color Source", "Data to derive color results from"); 01661 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01662 01663 prop= RNA_def_property(srna, "speed_scale", PROP_FLOAT, PROP_NONE); 01664 RNA_def_property_float_sdna(prop, NULL, "speed_scale"); 01665 RNA_def_property_range(prop, 0.001, 100.0); 01666 RNA_def_property_ui_text(prop, "Scale", "Multiplier to bring particle speed within an acceptable range"); 01667 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01668 01669 prop= RNA_def_property(srna, "falloff_speed_scale", PROP_FLOAT, PROP_NONE); 01670 RNA_def_property_float_sdna(prop, NULL, "falloff_speed_scale"); 01671 RNA_def_property_range(prop, 0.001, 100.0); 01672 RNA_def_property_ui_text(prop, "Velocity Scale", "Multiplier to bring particle speed within an acceptable range"); 01673 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01674 01675 01676 prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL); 01677 RNA_def_property_pointer_sdna(prop, NULL, "coba"); 01678 RNA_def_property_struct_type(prop, "ColorRamp"); 01679 RNA_def_property_ui_text(prop, "Color Ramp", ""); 01680 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01681 01682 prop= RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NEVER_NULL); 01683 RNA_def_property_pointer_sdna(prop, NULL, "falloff_curve"); 01684 RNA_def_property_struct_type(prop, "CurveMapping"); 01685 RNA_def_property_ui_text(prop, "Falloff Curve", ""); 01686 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01687 01688 prop= RNA_def_property(srna, "use_falloff_curve", PROP_BOOLEAN, PROP_NONE); 01689 RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PD_FALLOFF_CURVE); 01690 RNA_def_property_ui_text(prop, "Falloff Curve", "Use a custom falloff curve"); 01691 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01692 01693 /* Turbulence */ 01694 prop= RNA_def_property(srna, "use_turbulence", PROP_BOOLEAN, PROP_NONE); 01695 RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PD_TURBULENCE); 01696 RNA_def_property_ui_text(prop, "Turbulence", "Add directed noise to the density at render-time"); 01697 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01698 01699 prop= RNA_def_property(srna, "turbulence_scale", PROP_FLOAT, PROP_NONE); 01700 RNA_def_property_float_sdna(prop, NULL, "noise_size"); 01701 RNA_def_property_range(prop, 0.01, FLT_MAX); 01702 RNA_def_property_ui_text(prop, "Size", "Scale of the added turbulent noise"); 01703 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01704 01705 prop= RNA_def_property(srna, "turbulence_strength", PROP_FLOAT, PROP_NONE); 01706 RNA_def_property_float_sdna(prop, NULL, "noise_fac"); 01707 RNA_def_property_range(prop, 0.01, FLT_MAX); 01708 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01709 01710 prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE); 01711 RNA_def_property_int_sdna(prop, NULL, "noise_depth"); 01712 RNA_def_property_range(prop, 0, 30); 01713 RNA_def_property_ui_text(prop, "Depth", "Level of detail in the added turbulent noise"); 01714 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01715 01716 prop= RNA_def_property(srna, "turbulence_influence", PROP_ENUM, PROP_NONE); 01717 RNA_def_property_enum_sdna(prop, NULL, "noise_influence"); 01718 RNA_def_property_enum_items(prop, turbulence_influence_items); 01719 RNA_def_property_ui_text(prop, "Turbulence Influence", "Method for driving added turbulent noise"); 01720 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01721 01722 prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); 01723 RNA_def_property_enum_sdna(prop, NULL, "noise_basis"); 01724 RNA_def_property_enum_items(prop, prop_noise_basis_items); 01725 RNA_def_property_ui_text(prop, "Noise Basis", "Noise formula used for turbulence"); 01726 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01727 01728 01729 srna= RNA_def_struct(brna, "PointDensityTexture", "Texture"); 01730 RNA_def_struct_sdna(srna, "Tex"); 01731 RNA_def_struct_ui_text(srna, "Point Density", "Settings for the Point Density texture"); 01732 01733 prop= RNA_def_property(srna, "point_density", PROP_POINTER, PROP_NONE); 01734 RNA_def_property_pointer_sdna(prop, NULL, "pd"); 01735 RNA_def_property_struct_type(prop, "PointDensity"); 01736 RNA_def_property_ui_text(prop, "Point Density", "The point density settings associated with this texture"); 01737 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01738 } 01739 01740 static void rna_def_texture_voxeldata(BlenderRNA *brna) 01741 { 01742 StructRNA *srna; 01743 PropertyRNA *prop; 01744 01745 static EnumPropertyItem interpolation_type_items[] = { 01746 {TEX_VD_NEARESTNEIGHBOR, "NEREASTNEIGHBOR", 0, "Nearest Neighbor", "No interpolation, fast but blocky and low quality"}, 01747 {TEX_VD_LINEAR, "TRILINEAR", 0, "Linear", "Good smoothness and speed"}, 01748 {TEX_VD_QUADRATIC, "QUADRATIC", 0, "Quadratic", "Mid-range quality and speed"}, 01749 {TEX_VD_TRICUBIC_CATROM, "TRICUBIC_CATROM", 0, "Cubic Catmull-Rom", "High quality interpolation, but slower"}, 01750 {TEX_VD_TRICUBIC_BSPLINE, "TRICUBIC_BSPLINE", 0, "Cubic B-Spline", "Smoothed high quality interpolation, but slower"}, 01751 {0, NULL, 0, NULL, NULL}}; 01752 01753 static EnumPropertyItem file_format_items[] = { 01754 {TEX_VD_BLENDERVOXEL, "BLENDER_VOXEL", 0, "Blender Voxel", "Default binary voxel file format"}, 01755 {TEX_VD_RAW_8BIT, "RAW_8BIT", 0, "8 bit RAW", "8 bit greyscale binary data"}, 01756 //{TEX_VD_RAW_16BIT, "RAW_16BIT", 0, "16 bit RAW", ""}, 01757 {TEX_VD_IMAGE_SEQUENCE, "IMAGE_SEQUENCE", 0, "Image Sequence", "Generate voxels from a sequence of image slices"}, 01758 {TEX_VD_SMOKE, "SMOKE", 0, "Smoke", "Render voxels from a Blender smoke simulation"}, 01759 {0, NULL, 0, NULL, NULL}}; 01760 01761 static EnumPropertyItem voxeldata_extension[] = { 01762 {TEX_EXTEND, "EXTEND", 0, "Extend", "Extend by repeating edge pixels of the image"}, 01763 {TEX_CLIP, "CLIP", 0, "Clip", "Clip to image size and set exterior pixels as transparent"}, 01764 {TEX_REPEAT, "REPEAT", 0, "Repeat", "Cause the image to repeat horizontally and vertically"}, 01765 {0, NULL, 0, NULL, NULL}}; 01766 01767 static EnumPropertyItem smoked_type_items[] = { 01768 {TEX_VD_SMOKEDENSITY, "SMOKEDENSITY", 0, "Density", "Use smoke density as texture data"}, 01769 {TEX_VD_SMOKEHEAT, "SMOKEHEAT", 0, "Heat", "Use smoke heat as texture data. Values from -2.0 to 2.0 are used"}, 01770 {TEX_VD_SMOKEVEL, "SMOKEVEL", 0, "Velocity", "Use smoke velocity as texture data"}, 01771 {0, NULL, 0, NULL, NULL}}; 01772 01773 srna= RNA_def_struct(brna, "VoxelData", NULL); 01774 RNA_def_struct_sdna(srna, "VoxelData"); 01775 RNA_def_struct_ui_text(srna, "VoxelData", "Voxel data settings"); 01776 RNA_def_struct_path_func(srna, "rna_VoxelData_path"); 01777 01778 prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); 01779 RNA_def_property_enum_sdna(prop, NULL, "interp_type"); 01780 RNA_def_property_enum_items(prop, interpolation_type_items); 01781 RNA_def_property_ui_text(prop, "Interpolation", "Method to interpolate/smooth values between voxel cells"); 01782 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01783 01784 prop= RNA_def_property(srna, "smoke_data_type", PROP_ENUM, PROP_NONE); 01785 RNA_def_property_enum_sdna(prop, NULL, "smoked_type"); 01786 RNA_def_property_enum_items(prop, smoked_type_items); 01787 RNA_def_property_ui_text(prop, "Source", "Simulation value to be used as a texture"); 01788 RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); 01789 01790 prop= RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE); 01791 RNA_def_property_enum_sdna(prop, NULL, "extend"); 01792 RNA_def_property_enum_items(prop, voxeldata_extension); 01793 RNA_def_property_ui_text(prop, "Extension", "How the texture is extrapolated past its original bounds"); 01794 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01795 01796 prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE); 01797 RNA_def_property_float_sdna(prop, NULL, "int_multiplier"); 01798 RNA_def_property_range(prop, 0.01, FLT_MAX); 01799 RNA_def_property_ui_text(prop, "Intensity", "Multiplier for intensity values"); 01800 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01801 01802 prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE); 01803 RNA_def_property_enum_sdna(prop, NULL, "file_format"); 01804 RNA_def_property_enum_items(prop, file_format_items); 01805 RNA_def_property_ui_text(prop, "File Format", "Format of the source data set to render "); 01806 RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); 01807 01808 prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); 01809 RNA_def_property_string_sdna(prop, NULL, "source_path"); 01810 RNA_def_property_ui_text(prop, "Source Path", "The external source data file to use"); 01811 RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); 01812 01813 prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE); 01814 RNA_def_property_int_sdna(prop, NULL, "resol"); 01815 RNA_def_property_range(prop, 1, 100000); 01816 RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid"); 01817 RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); 01818 01819 prop= RNA_def_property(srna, "use_still_frame", PROP_BOOLEAN, PROP_NONE); 01820 RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_VD_STILL); 01821 RNA_def_property_ui_text(prop, "Still Frame Only", "Always render a still frame from the voxel data sequence"); 01822 RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); 01823 01824 prop= RNA_def_property(srna, "still_frame", PROP_INT, PROP_NONE); 01825 RNA_def_property_int_sdna(prop, NULL, "still_frame"); 01826 RNA_def_property_range(prop, -MAXFRAME, MAXFRAME); 01827 RNA_def_property_ui_text(prop, "Still Frame Number", "The frame number to always use"); 01828 RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); 01829 01830 prop= RNA_def_property(srna, "domain_object", PROP_POINTER, PROP_NONE); 01831 RNA_def_property_pointer_sdna(prop, NULL, "object"); 01832 RNA_def_property_ui_text(prop, "Domain Object", "Object used as the smoke simulation domain"); 01833 RNA_def_property_flag(prop, PROP_EDITABLE); 01834 RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); 01835 01836 01837 srna= RNA_def_struct(brna, "VoxelDataTexture", "Texture"); 01838 RNA_def_struct_sdna(srna, "Tex"); 01839 RNA_def_struct_ui_text(srna, "Voxel Data", "Settings for the Voxel Data texture"); 01840 01841 prop= RNA_def_property(srna, "voxel_data", PROP_POINTER, PROP_NONE); 01842 RNA_def_property_pointer_sdna(prop, NULL, "vd"); 01843 RNA_def_property_struct_type(prop, "VoxelData"); 01844 RNA_def_property_ui_text(prop, "Voxel Data", "The voxel data associated with this texture"); 01845 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01846 01847 prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); 01848 RNA_def_property_pointer_sdna(prop, NULL, "ima"); 01849 RNA_def_property_struct_type(prop, "Image"); 01850 RNA_def_property_flag(prop, PROP_EDITABLE); 01851 RNA_def_property_ui_text(prop, "Image", ""); 01852 RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_image_update"); 01853 01854 prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL); 01855 RNA_def_property_pointer_sdna(prop, NULL, "iuser"); 01856 RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed"); 01857 RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); 01858 } 01859 01860 static void rna_def_texture_ocean(BlenderRNA *brna) 01861 { 01862 StructRNA *srna; 01863 PropertyRNA *prop; 01864 01865 static EnumPropertyItem ocean_output_items[] = { 01866 {TEX_OCN_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", "Output XYZ displacement in RGB channels"}, 01867 //{TEX_OCN_NORMALS, "NORMALS", 0, "Normals", "Outputs wave normals"}, // these are in nor channel now 01868 {TEX_OCN_FOAM, "FOAM", 0, "Foam", "Output Foam (wave overlap) amount in single channel"}, 01869 {TEX_OCN_JPLUS, "JPLUS", 0, "Eigenvalues", "Positive Eigenvalues"}, 01870 {TEX_OCN_EMINUS, "EMINUS", 0, "Eigenvectors (-)", "Negative Eigenvectors"}, 01871 {TEX_OCN_EPLUS, "EPLUS", 0, "Eigenvectors (+)", "Positive Eigenvectors"}, 01872 {0, NULL, 0, NULL, NULL}}; 01873 01874 srna= RNA_def_struct(brna, "OceanTexData", NULL); 01875 RNA_def_struct_sdna(srna, "OceanTex"); 01876 RNA_def_struct_ui_text(srna, "Ocean", "Ocean Texture settings"); 01877 RNA_def_struct_path_func(srna, "rna_OceanTex_path"); 01878 01879 prop= RNA_def_property(srna, "output", PROP_ENUM, PROP_NONE); 01880 RNA_def_property_enum_sdna(prop, NULL, "output"); 01881 RNA_def_property_enum_items(prop, ocean_output_items); 01882 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); 01883 RNA_def_property_ui_text(prop, "Output", "The data that is output by the texture"); 01884 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01885 01886 prop= RNA_def_property(srna, "ocean_object", PROP_POINTER, PROP_NONE); 01887 RNA_def_property_pointer_sdna(prop, NULL, "object"); 01888 RNA_def_property_ui_text(prop, "Modifier Object", "Object containing the ocean modifier"); 01889 RNA_def_property_flag(prop, PROP_EDITABLE); 01890 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01891 01892 srna= RNA_def_struct(brna, "OceanTexture", "Texture"); 01893 RNA_def_struct_sdna(srna, "Tex"); 01894 RNA_def_struct_ui_text(srna, "Ocean", "Settings for the Ocean texture"); 01895 01896 prop= RNA_def_property(srna, "ocean", PROP_POINTER, PROP_NONE); 01897 RNA_def_property_pointer_sdna(prop, NULL, "ot"); 01898 RNA_def_property_struct_type(prop, "OceanTexData"); 01899 RNA_def_property_ui_text(prop, "Ocean", "The ocean data associated with this texture"); 01900 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01901 } 01902 01903 static void rna_def_texture(BlenderRNA *brna) 01904 { 01905 StructRNA *srna; 01906 PropertyRNA *prop; 01907 01908 srna= RNA_def_struct(brna, "Texture", "ID"); 01909 RNA_def_struct_sdna(srna, "Tex"); 01910 RNA_def_struct_ui_text(srna, "Texture", "Texture datablock used by materials, lamps, worlds and brushes"); 01911 RNA_def_struct_ui_icon(srna, ICON_TEXTURE_DATA); 01912 RNA_def_struct_refine_func(srna, "rna_Texture_refine"); 01913 01914 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); 01915 //RNA_def_property_clear_flag(prop, PROP_EDITABLE); 01916 RNA_def_property_enum_sdna(prop, NULL, "type"); 01917 RNA_def_property_enum_items(prop, texture_type_items); 01918 RNA_def_property_enum_funcs(prop, NULL, "rna_Texture_type_set", NULL); 01919 RNA_def_property_ui_text(prop, "Type", ""); 01920 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01921 01922 prop= RNA_def_property(srna, "use_color_ramp", PROP_BOOLEAN, PROP_NONE); 01923 RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_COLORBAND); 01924 RNA_def_property_boolean_funcs(prop, NULL, "rna_Texture_use_color_ramp_set"); 01925 RNA_def_property_ui_text(prop, "Use Color Ramp", "Toggle color ramp operations"); 01926 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01927 01928 prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL); 01929 RNA_def_property_pointer_sdna(prop, NULL, "coba"); 01930 RNA_def_property_struct_type(prop, "ColorRamp"); 01931 RNA_def_property_ui_text(prop, "Color Ramp", ""); 01932 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01933 01934 prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE); 01935 RNA_def_property_float_sdna(prop, NULL, "bright"); 01936 RNA_def_property_range(prop, 0, 2); 01937 RNA_def_property_ui_text(prop, "Brightness", "Adjust the brightness of the texture"); 01938 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01939 01940 prop= RNA_def_property(srna, "contrast", PROP_FLOAT, PROP_NONE); 01941 RNA_def_property_range(prop, 0.01, 5); 01942 RNA_def_property_ui_text(prop, "Contrast", "Adjust the contrast of the texture"); 01943 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01944 01945 prop= RNA_def_property(srna, "saturation", PROP_FLOAT, PROP_NONE); 01946 RNA_def_property_range(prop, 0, 2); 01947 RNA_def_property_ui_text(prop, "Saturation", "Adjust the saturation of colors in the texture"); 01948 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01949 01950 /* RGB Factor */ 01951 prop= RNA_def_property(srna, "factor_red", PROP_FLOAT, PROP_NONE); 01952 RNA_def_property_float_sdna(prop, NULL, "rfac"); 01953 RNA_def_property_range(prop, 0, 2); 01954 RNA_def_property_ui_text(prop, "Factor Red", ""); 01955 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01956 01957 prop= RNA_def_property(srna, "factor_green", PROP_FLOAT, PROP_NONE); 01958 RNA_def_property_float_sdna(prop, NULL, "gfac"); 01959 RNA_def_property_range(prop, 0, 2); 01960 RNA_def_property_ui_text(prop, "Factor Green", ""); 01961 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01962 01963 prop= RNA_def_property(srna, "factor_blue", PROP_FLOAT, PROP_NONE); 01964 RNA_def_property_float_sdna(prop, NULL, "bfac"); 01965 RNA_def_property_range(prop, 0, 2); 01966 RNA_def_property_ui_text(prop, "Factor Blue", ""); 01967 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01968 01969 /* Alpha for preview render */ 01970 prop= RNA_def_property(srna, "use_preview_alpha", PROP_BOOLEAN, PROP_NONE); 01971 RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PRV_ALPHA); 01972 RNA_def_property_ui_text(prop, "Show Alpha", "Show Alpha in Preview Render"); 01973 RNA_def_property_update(prop, 0, "rna_Texture_update"); 01974 01975 /* nodetree */ 01976 prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE); 01977 RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1); 01978 RNA_def_property_boolean_funcs(prop, NULL, "rna_Texture_use_nodes_set"); 01979 RNA_def_property_ui_text(prop, "Use Nodes", "Make this a node-based texture"); 01980 RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); 01981 01982 prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); 01983 RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); 01984 RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node-based textures"); 01985 RNA_def_property_update(prop, 0, "rna_Texture_nodes_update"); 01986 01987 rna_def_animdata_common(srna); 01988 01989 /* specific types */ 01990 rna_def_texture_clouds(brna); 01991 rna_def_texture_wood(brna); 01992 rna_def_texture_marble(brna); 01993 rna_def_texture_magic(brna); 01994 rna_def_texture_blend(brna); 01995 rna_def_texture_stucci(brna); 01996 rna_def_texture_noise(brna); 01997 rna_def_texture_image(brna); 01998 rna_def_texture_plugin(brna); 01999 rna_def_texture_environment_map(brna); 02000 rna_def_texture_musgrave(brna); 02001 rna_def_texture_voronoi(brna); 02002 rna_def_texture_distorted_noise(brna); 02003 rna_def_texture_pointdensity(brna); 02004 rna_def_texture_voxeldata(brna); 02005 rna_def_texture_ocean(brna); 02006 /* XXX add more types here .. */ 02007 02008 RNA_api_texture(srna); 02009 } 02010 02011 void RNA_def_texture(BlenderRNA *brna) 02012 { 02013 rna_def_texture(brna); 02014 rna_def_mtex(brna); 02015 rna_def_environment_map(brna); 02016 rna_def_texmapping(brna); 02017 rna_def_colormapping(brna); 02018 } 02019 02020 #endif