diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_texture.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_texture.c | 611 |
1 files changed, 0 insertions, 611 deletions
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 42e3e2c83fb..5449b67c040 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -67,19 +67,14 @@ const EnumPropertyItem rna_enum_texture_type_items[] = { {TEX_CLOUDS, "CLOUDS", ICON_TEXTURE, "Clouds", "Procedural - create a cloud-like fractal noise texture"}, {TEX_DISTNOISE, "DISTORTED_NOISE", ICON_TEXTURE, "Distorted Noise", "Procedural - noise texture distorted by two noise algorithms"}, - {TEX_ENVMAP, "ENVIRONMENT_MAP", ICON_IMAGE_DATA, - "Environment Map", "Create a render of the environment mapped to a texture"}, {TEX_IMAGE, "IMAGE", ICON_IMAGE_DATA, "Image or Movie", "Allow for images or movies to be used as textures"}, {TEX_MAGIC, "MAGIC", ICON_TEXTURE, "Magic", "Procedural - color texture based on trigonometric functions"}, {TEX_MARBLE, "MARBLE", ICON_TEXTURE, "Marble", "Procedural - marble-like noise texture with wave generated bands"}, {TEX_MUSGRAVE, "MUSGRAVE", ICON_TEXTURE, "Musgrave", "Procedural - highly flexible fractal noise texture"}, {TEX_NOISE, "NOISE", ICON_TEXTURE, "Noise", "Procedural - random noise, gives a different result every time, for every frame, for every pixel"}, - {TEX_OCEAN, "OCEAN", ICON_TEXTURE, "Ocean", "Use a texture generated by an Ocean modifier"}, - {TEX_POINTDENSITY, "POINT_DENSITY", ICON_TEXTURE, "Point Density", ""}, {TEX_STUCCI, "STUCCI", ICON_TEXTURE, "Stucci", "Procedural - create a fractal noise texture"}, {TEX_VORONOI, "VORONOI", ICON_TEXTURE, "Voronoi", "Procedural - create cell-like patterns based on Worley noise"}, - {TEX_VOXELDATA, "VOXEL_DATA", ICON_TEXTURE, "Voxel Data", "Create a 3D texture based on volumetric data"}, {TEX_WOOD, "WOOD", ICON_TEXTURE, "Wood", "Procedural - wave generated bands or rings, with optional noise"}, {0, NULL, 0, NULL, NULL} }; @@ -134,8 +129,6 @@ static StructRNA *rna_Texture_refine(struct PointerRNA *ptr) return &RNA_CloudsTexture; case TEX_DISTNOISE: return &RNA_DistortedNoiseTexture; - case TEX_ENVMAP: - return &RNA_EnvironmentMapTexture; case TEX_IMAGE: return &RNA_ImageTexture; case TEX_MAGIC: @@ -146,18 +139,12 @@ static StructRNA *rna_Texture_refine(struct PointerRNA *ptr) return &RNA_MusgraveTexture; case TEX_NOISE: return &RNA_NoiseTexture; - case TEX_POINTDENSITY: - return &RNA_PointDensityTexture; case TEX_STUCCI: return &RNA_StucciTexture; case TEX_VORONOI: return &RNA_VoronoiTexture; - case TEX_VOXELDATA: - return &RNA_VoxelDataTexture; case TEX_WOOD: return &RNA_WoodTexture; - case TEX_OCEAN: - return &RNA_OceanTexture; default: return &RNA_Texture; } @@ -192,25 +179,6 @@ static void rna_Color_mapping_update(Main *UNUSED(bmain), Scene *UNUSED(scene), /* nothing to do */ } -static void rna_Texture_voxeldata_update(Main *bmain, Scene *scene, PointerRNA *ptr) -{ - Tex *tex = ptr->id.data; - - tex->vd->ok = 0; - rna_Texture_update(bmain, scene, ptr); -} - -static void rna_Texture_voxeldata_image_update(Main *bmain, Scene *scene, PointerRNA *ptr) -{ - Tex *tex = ptr->id.data; - - if (tex->ima) { /* may be getting cleared too */ - tex->ima->source = IMA_SRC_SEQUENCE; - } - rna_Texture_voxeldata_update(bmain, scene, ptr); -} - - /* Used for Texture Properties, used (also) for/in Nodes */ static void rna_Texture_nodes_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { @@ -433,54 +401,6 @@ static void rna_ImageTexture_mipmap_set(PointerRNA *ptr, int value) else tex->imaflag &= ~TEX_MIPMAP; } -static void rna_Envmap_update_generic(Main *bmain, Scene *scene, PointerRNA *ptr) -{ - Tex *tex = ptr->id.data; - if (tex->env) { - ED_preview_kill_jobs(bmain->wm.first, bmain); - BKE_texture_envmap_free_data(tex->env); - } - rna_Texture_update(bmain, scene, ptr); -} - -static PointerRNA rna_PointDensity_psys_get(PointerRNA *ptr) -{ - PointDensity *pd = ptr->data; - Object *ob = pd->object; - ParticleSystem *psys = NULL; - PointerRNA value; - - if (ob && pd->psys) - psys = BLI_findlink(&ob->particlesystem, pd->psys - 1); - - RNA_pointer_create(&ob->id, &RNA_ParticleSystem, psys, &value); - return value; -} - -static void rna_PointDensity_psys_set(PointerRNA *ptr, PointerRNA value) -{ - PointDensity *pd = ptr->data; - Object *ob = pd->object; - - if (ob && value.id.data == ob) - pd->psys = BLI_findindex(&ob->particlesystem, value.data) + 1; -} - -static char *rna_PointDensity_path(PointerRNA *UNUSED(ptr)) -{ - return BLI_sprintfN("point_density"); -} - -static char *rna_VoxelData_path(PointerRNA *UNUSED(ptr)) -{ - return BLI_sprintfN("voxel_data"); -} - -static char *rna_OceanTex_path(PointerRNA *UNUSED(ptr)) -{ - return BLI_sprintfN("ocean"); -} - #else static void rna_def_texmapping(BlenderRNA *brna) @@ -779,94 +699,6 @@ static void rna_def_filter_common(StructRNA *srna) RNA_def_property_update(prop, 0, "rna_Texture_update"); } -static void rna_def_environment_map(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem prop_source_items[] = { - {ENV_STATIC, "STATIC", 0, "Static", "Calculate environment map only once"}, - {ENV_ANIM, "ANIMATED", 0, "Animated", "Calculate environment map at each rendering"}, - {ENV_LOAD, "IMAGE_FILE", 0, "Image File", "Load a saved environment map image from disk"}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem prop_mapping_items[] = { - {ENV_CUBE, "CUBE", 0, "Cube", "Use environment map with six cube sides"}, - {ENV_PLANE, "PLANE", 0, "Plane", "Only one side is rendered, with Z axis pointing in direction of image"}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "EnvironmentMap", NULL); - RNA_def_struct_sdna(srna, "EnvMap"); - RNA_def_struct_ui_text(srna, "EnvironmentMap", - "Environment map created by the renderer and cached for subsequent renders"); - - prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "stype"); - RNA_def_property_enum_items(prop, prop_source_items); - RNA_def_property_ui_text(prop, "Source", ""); - RNA_def_property_update(prop, 0, "rna_Envmap_update_generic"); - - prop = RNA_def_property(srna, "viewpoint_object", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "object"); - RNA_def_property_ui_text(prop, "Viewpoint Object", "Object to use as the environment map's viewpoint location"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "type"); - RNA_def_property_enum_items(prop, prop_mapping_items); - RNA_def_property_ui_text(prop, "Mapping", ""); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "clipsta"); - RNA_def_property_range(prop, 0.001, FLT_MAX); - RNA_def_property_ui_range(prop, 0.01, 50, 100, 2); - RNA_def_property_ui_text(prop, "Clip Start", "Objects nearer than this are not visible to map"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "clipend"); - RNA_def_property_range(prop, 0.01, FLT_MAX); - RNA_def_property_ui_range(prop, 0.10, 20000, 100, 2); - RNA_def_property_ui_text(prop, "Clip End", "Objects further than this are not visible to map"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "viewscale"); - RNA_def_property_range(prop, 0.1, 5.0); - RNA_def_property_ui_range(prop, 0.5, 1.5, 1, 2); - RNA_def_property_ui_text(prop, "Zoom", ""); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "layers_ignore", PROP_BOOLEAN, PROP_LAYER_MEMBER); - RNA_def_property_boolean_sdna(prop, NULL, "notlay", 1); - RNA_def_property_array(prop, 20); - RNA_def_property_ui_text(prop, "Ignore Layers", - "Hide objects on these layers when generating the Environment Map"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "resolution", PROP_INT, PROP_UNSIGNED); - RNA_def_property_int_sdna(prop, NULL, "cuberes"); - RNA_def_property_range(prop, 50, 4096); - RNA_def_property_ui_text(prop, "Resolution", "Pixel resolution of the rendered environment map"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED); - RNA_def_property_range(prop, 0, 5); - RNA_def_property_ui_text(prop, "Depth", "Number of times a map will be rendered recursively (mirror effects)"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "is_valid", PROP_BOOLEAN, 0); - RNA_def_property_boolean_sdna(prop, NULL, "ok", 2); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Validity", "True if this map is ready for use, False if it needs rendering"); - - RNA_api_environment_map(srna); -} - static const EnumPropertyItem prop_noise_basis_items[] = { {TEX_BLENDER, "BLENDER_ORIGINAL", 0, "Blender Original", "Noise algorithm - Blender original: Smooth interpolated noise"}, @@ -1372,43 +1204,6 @@ static void rna_def_texture_image(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_NORMALMAP); RNA_def_property_ui_text(prop, "Normal Map", "Use image RGB values for normal mapping"); RNA_def_property_update(prop, 0, "rna_Texture_update"); - - /* Derivative Map */ - prop = RNA_def_property(srna, "use_derivative_map", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_DERIVATIVEMAP); - RNA_def_property_ui_text(prop, "Derivative Map", "Use red and green as derivative values"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); -} - -static void rna_def_texture_environment_map(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "EnvironmentMapTexture", "Texture"); - RNA_def_struct_ui_text(srna, "Environment Map", "Environment map texture"); - RNA_def_struct_sdna(srna, "Tex"); - - prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "ima"); - RNA_def_property_struct_type(prop, "Image"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Image", "Source image file to read the environment map from"); - RNA_def_property_update(prop, 0, "rna_Envmap_update_generic"); - - prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "iuser"); - RNA_def_property_ui_text(prop, "Image User", - "Parameters defining which layer, pass and frame of the image is displayed"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - rna_def_filter_common(srna); - - prop = RNA_def_property(srna, "environment_map", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "env"); - RNA_def_property_struct_type(prop, "EnvironmentMap"); - RNA_def_property_ui_text(prop, "Environment Map", "Get the environment map associated with this texture"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); } static void rna_def_texture_musgrave(BlenderRNA *brna) @@ -1633,407 +1428,6 @@ static void rna_def_texture_distorted_noise(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Texture_update"); } -static void rna_def_texture_pointdensity(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem point_source_items[] = { - {TEX_PD_PSYS, "PARTICLE_SYSTEM", 0, "Particle System", "Generate point density from a particle system"}, - {TEX_PD_OBJECT, "OBJECT", 0, "Object Vertices", "Generate point density from an object's vertices"}, - /*{TEX_PD_FILE, "FILE", 0, "File", ""}, */ - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem particle_cache_items[] = { - {TEX_PD_OBJECTLOC, "OBJECT_LOCATION", 0, "Emit Object Location", ""}, - {TEX_PD_OBJECTSPACE, "OBJECT_SPACE", 0, "Emit Object Space", ""}, - {TEX_PD_WORLDSPACE, "WORLD_SPACE", 0, "Global Space", ""}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem vertex_cache_items[] = { - {TEX_PD_OBJECTLOC, "OBJECT_LOCATION", 0, "Object Location", ""}, - {TEX_PD_OBJECTSPACE, "OBJECT_SPACE", 0, "Object Space", ""}, - {TEX_PD_WORLDSPACE, "WORLD_SPACE", 0, "Global Space", ""}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem falloff_items[] = { - {TEX_PD_FALLOFF_STD, "STANDARD", 0, "Standard", ""}, - {TEX_PD_FALLOFF_SMOOTH, "SMOOTH", 0, "Smooth", ""}, - {TEX_PD_FALLOFF_SOFT, "SOFT", 0, "Soft", ""}, - {TEX_PD_FALLOFF_CONSTANT, "CONSTANT", 0, "Constant", "Density is constant within lookup radius"}, - {TEX_PD_FALLOFF_ROOT, "ROOT", 0, "Root", ""}, - {TEX_PD_FALLOFF_PARTICLE_AGE, "PARTICLE_AGE", 0, "Particle Age", ""}, - {TEX_PD_FALLOFF_PARTICLE_VEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", ""}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem particle_color_source_items[] = { - {TEX_PD_COLOR_CONSTANT, "CONSTANT", 0, "Constant", ""}, - {TEX_PD_COLOR_PARTAGE, "PARTICLE_AGE", 0, "Particle Age", "Lifetime mapped as 0.0 - 1.0 intensity"}, - {TEX_PD_COLOR_PARTSPEED, "PARTICLE_SPEED", 0, "Particle Speed", - "Particle speed (absolute magnitude of velocity) mapped as 0.0-1.0 intensity"}, - {TEX_PD_COLOR_PARTVEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", "XYZ velocity mapped to RGB colors"}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem vertex_color_source_items[] = { - {TEX_PD_COLOR_CONSTANT, "CONSTANT", 0, "Constant", ""}, - {TEX_PD_COLOR_VERTCOL, "VERTEX_COLOR", 0, "Vertex Color", "Vertex color layer"}, - {TEX_PD_COLOR_VERTWEIGHT, "VERTEX_WEIGHT", 0, "Vertex Weight", "Vertex group weight"}, - {TEX_PD_COLOR_VERTNOR, "VERTEX_NORMAL", 0, "Vertex Normal", "XYZ normal vector mapped to RGB colors"}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem turbulence_influence_items[] = { - {TEX_PD_NOISE_STATIC, "STATIC", 0, "Static", - "Noise patterns will remain unchanged, faster and suitable for stills"}, - {TEX_PD_NOISE_VEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", - "Turbulent noise driven by particle velocity"}, - {TEX_PD_NOISE_AGE, "PARTICLE_AGE", 0, "Particle Age", - "Turbulent noise driven by the particle's age between birth and death"}, - {TEX_PD_NOISE_TIME, "GLOBAL_TIME", 0, "Global Time", "Turbulent noise driven by the global current frame"}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "PointDensity", NULL); - RNA_def_struct_sdna(srna, "PointDensity"); - RNA_def_struct_ui_text(srna, "PointDensity", "Point density settings"); - RNA_def_struct_path_func(srna, "rna_PointDensity_path"); - - prop = RNA_def_property(srna, "point_source", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "source"); - RNA_def_property_enum_items(prop, point_source_items); - RNA_def_property_ui_text(prop, "Point Source", "Point data to use as renderable point density"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "object"); - RNA_def_property_ui_text(prop, "Object", "Object to take point data from"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE); - RNA_def_property_ui_text(prop, "Particle System", "Particle System to render as points"); - RNA_def_property_struct_type(prop, "ParticleSystem"); - RNA_def_property_pointer_funcs(prop, "rna_PointDensity_psys_get", "rna_PointDensity_psys_set", NULL, NULL); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "particle_cache_space", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "psys_cache_space"); - RNA_def_property_enum_items(prop, particle_cache_items); - RNA_def_property_ui_text(prop, "Particle Cache", "Coordinate system to cache particles in"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "vertex_cache_space", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "ob_cache_space"); - RNA_def_property_enum_items(prop, vertex_cache_items); - RNA_def_property_ui_text(prop, "Vertices Cache", "Coordinate system to cache vertices in"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "radius"); - RNA_def_property_range(prop, 0.001, FLT_MAX); - RNA_def_property_ui_text(prop, "Radius", "Radius from the shaded sample to look for points within"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "falloff_type"); - RNA_def_property_enum_items(prop, falloff_items); - RNA_def_property_ui_text(prop, "Falloff", "Method of attenuating density by distance from the point"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "falloff_soft", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "falloff_softness"); - RNA_def_property_range(prop, 0.01, FLT_MAX); - RNA_def_property_ui_text(prop, "Softness", "Softness of the 'soft' falloff option"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "particle_color_source", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "color_source"); - RNA_def_property_enum_items(prop, particle_color_source_items); - RNA_def_property_ui_text(prop, "Color Source", "Data to derive color results from"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "vertex_color_source", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "ob_color_source"); - RNA_def_property_enum_items(prop, vertex_color_source_items); - RNA_def_property_ui_text(prop, "Color Source", "Data to derive color results from"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "vertex_attribute_name", PROP_STRING, PROP_NONE); - RNA_def_property_ui_text(prop, "Vertex Attribute Name", "Vertex attribute to use for color"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "speed_scale", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "speed_scale"); - RNA_def_property_range(prop, 0.001, 100.0); - RNA_def_property_ui_text(prop, "Scale", "Multiplier to bring particle speed within an acceptable range"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "falloff_speed_scale", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "falloff_speed_scale"); - RNA_def_property_range(prop, 0.001, 100.0); - RNA_def_property_ui_text(prop, "Velocity Scale", "Multiplier to bring particle speed within an acceptable range"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - - prop = RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "coba"); - RNA_def_property_struct_type(prop, "ColorRamp"); - RNA_def_property_ui_text(prop, "Color Ramp", ""); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "falloff_curve"); - RNA_def_property_struct_type(prop, "CurveMapping"); - RNA_def_property_ui_text(prop, "Falloff Curve", ""); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "use_falloff_curve", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PD_FALLOFF_CURVE); - RNA_def_property_ui_text(prop, "Falloff Curve", "Use a custom falloff curve"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - /* Turbulence */ - prop = RNA_def_property(srna, "use_turbulence", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PD_TURBULENCE); - RNA_def_property_ui_text(prop, "Turbulence", "Add directed noise to the density at render-time"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "turbulence_scale", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "noise_size"); - RNA_def_property_range(prop, 0.01, FLT_MAX); - RNA_def_property_ui_text(prop, "Size", "Scale of the added turbulent noise"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "turbulence_strength", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "noise_fac"); - RNA_def_property_range(prop, 0.01, FLT_MAX); - RNA_def_property_ui_text(prop, "Turbulence Strength", "Strength of the added turbulent noise"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "noise_depth"); - RNA_def_property_range(prop, 0, 30); - RNA_def_property_ui_text(prop, "Depth", "Level of detail in the added turbulent noise"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "turbulence_influence", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "noise_influence"); - RNA_def_property_enum_items(prop, turbulence_influence_items); - RNA_def_property_ui_text(prop, "Turbulence Influence", "Method for driving added turbulent noise"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "noise_basis"); - RNA_def_property_enum_items(prop, prop_noise_basis_items); - RNA_def_property_ui_text(prop, "Noise Basis", "Noise formula used for turbulence"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - - srna = RNA_def_struct(brna, "PointDensityTexture", "Texture"); - RNA_def_struct_sdna(srna, "Tex"); - RNA_def_struct_ui_text(srna, "Point Density", "Settings for the Point Density texture"); - - prop = RNA_def_property(srna, "point_density", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "pd"); - RNA_def_property_struct_type(prop, "PointDensity"); - RNA_def_property_ui_text(prop, "Point Density", "The point density settings associated with this texture"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); -} - -static void rna_def_texture_voxeldata(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem interpolation_type_items[] = { - {TEX_VD_NEARESTNEIGHBOR, "NEREASTNEIGHBOR", 0, "Nearest Neighbor", - "No interpolation, fast but blocky and low quality"}, - {TEX_VD_LINEAR, "TRILINEAR", 0, "Linear", "Good smoothness and speed"}, - {TEX_VD_QUADRATIC, "QUADRATIC", 0, "Quadratic", "Mid-range quality and speed"}, - {TEX_VD_TRICUBIC_CATROM, "TRICUBIC_CATROM", 0, "Cubic Catmull-Rom", "High quality interpolation, but slower"}, - {TEX_VD_TRICUBIC_BSPLINE, "TRICUBIC_BSPLINE", 0, "Cubic B-Spline", - "Smoothed high quality interpolation, but slower"}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem file_format_items[] = { - {TEX_VD_BLENDERVOXEL, "BLENDER_VOXEL", 0, "Blender Voxel", "Default binary voxel file format"}, - {TEX_VD_RAW_8BIT, "RAW_8BIT", 0, "8 bit RAW", "8 bit grayscale binary data"}, - /*{TEX_VD_RAW_16BIT, "RAW_16BIT", 0, "16 bit RAW", ""}, */ - {TEX_VD_IMAGE_SEQUENCE, "IMAGE_SEQUENCE", 0, "Image Sequence", - "Generate voxels from a sequence of image slices"}, - {TEX_VD_SMOKE, "SMOKE", 0, "Smoke", "Render voxels from a Blender smoke simulation"}, - {TEX_VD_HAIR, "HAIR", 0, "Hair", "Render voxels from a Blender hair simulation"}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem voxeldata_extension[] = { - {TEX_EXTEND, "EXTEND", 0, "Extend", "Extend by repeating edge pixels of the image"}, - {TEX_CLIP, "CLIP", 0, "Clip", "Clip to image size and set exterior pixels as transparent"}, - {TEX_REPEAT, "REPEAT", 0, "Repeat", "Cause the image to repeat horizontally and vertically"}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem smoked_type_items[] = { - {TEX_VD_SMOKEDENSITY, "SMOKEDENSITY", 0, "Smoke", "Use smoke density and color as texture data"}, - {TEX_VD_SMOKEFLAME, "SMOKEFLAME", 0, "Flame", "Use flame temperature as texture data"}, - {TEX_VD_SMOKEHEAT, "SMOKEHEAT", 0, "Heat", "Use smoke heat as texture data. Values from -2.0 to 2.0 are used"}, - {TEX_VD_SMOKEVEL, "SMOKEVEL", 0, "Velocity", "Use smoke velocity as texture data"}, - {0, NULL, 0, NULL, NULL} - }; - - static const EnumPropertyItem hair_type_items[] = { - {TEX_VD_HAIRDENSITY, "HAIRDENSITY", 0, "Density", "Use hair density as texture data"}, - {TEX_VD_HAIRRESTDENSITY, "HAIRRESTDENSITY", 0, "Rest Density", "Use hair rest density as texture data"}, - {TEX_VD_HAIRVELOCITY, "HAIRVELOCITY", 0, "Velocity", "Use hair velocity as texture data"}, - {TEX_VD_HAIRENERGY, "HAIRENERGY", 0, "Energy", "Use potential hair energy as texture data"}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "VoxelData", NULL); - RNA_def_struct_sdna(srna, "VoxelData"); - RNA_def_struct_ui_text(srna, "VoxelData", "Voxel data settings"); - RNA_def_struct_path_func(srna, "rna_VoxelData_path"); - - prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "interp_type"); - RNA_def_property_enum_items(prop, interpolation_type_items); - RNA_def_property_ui_text(prop, "Interpolation", "Method to interpolate/smooth values between voxel cells"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "smoke_data_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "smoked_type"); - RNA_def_property_enum_items(prop, smoked_type_items); - RNA_def_property_ui_text(prop, "Source", "Simulation value to be used as a texture"); - RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); - - prop = RNA_def_property(srna, "hair_data_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "hair_type"); - RNA_def_property_enum_items(prop, hair_type_items); - RNA_def_property_ui_text(prop, "Source", "Simulation value to be used as a texture"); - RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); - - prop = RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "extend"); - RNA_def_property_enum_items(prop, voxeldata_extension); - RNA_def_property_ui_text(prop, "Extension", "How the texture is extrapolated past its original bounds"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "int_multiplier"); - RNA_def_property_range(prop, 0.01, FLT_MAX); - RNA_def_property_ui_text(prop, "Intensity", "Multiplier for intensity values"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "file_format"); - RNA_def_property_enum_items(prop, file_format_items); - RNA_def_property_ui_text(prop, "File Format", "Format of the source data set to render"); - RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); - - prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); - RNA_def_property_string_sdna(prop, NULL, "source_path"); - RNA_def_property_ui_text(prop, "Source Path", "The external source data file to use"); - RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); - - prop = RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "resol"); - RNA_def_property_range(prop, 1, 100000); - RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid"); - RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); - - prop = RNA_def_property(srna, "use_still_frame", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_VD_STILL); - RNA_def_property_ui_text(prop, "Still Frame Only", "Always render a still frame from the voxel data sequence"); - RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); - - prop = RNA_def_property(srna, "still_frame", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "still_frame"); - RNA_def_property_range(prop, -MAXFRAME, MAXFRAME); - RNA_def_property_ui_text(prop, "Still Frame Number", "The frame number to always use"); - RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); - - prop = RNA_def_property(srna, "domain_object", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "object"); - RNA_def_property_ui_text(prop, "Domain Object", "Object used as the smoke simulation domain"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); - - - srna = RNA_def_struct(brna, "VoxelDataTexture", "Texture"); - RNA_def_struct_sdna(srna, "Tex"); - RNA_def_struct_ui_text(srna, "Voxel Data", "Settings for the Voxel Data texture"); - - prop = RNA_def_property(srna, "voxel_data", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "vd"); - RNA_def_property_struct_type(prop, "VoxelData"); - RNA_def_property_ui_text(prop, "Voxel Data", "The voxel data associated with this texture"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "ima"); - RNA_def_property_struct_type(prop, "Image"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Image", ""); - RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_image_update"); - - prop = RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "iuser"); - RNA_def_property_ui_text(prop, "Image User", - "Parameters defining which layer, pass and frame of the image is displayed"); - RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); -} - -static void rna_def_texture_ocean(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static const EnumPropertyItem ocean_output_items[] = { - {TEX_OCN_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", "Output XYZ displacement in RGB channels"}, - /*{TEX_OCN_NORMALS, "NORMALS", 0, "Normals", "Outputs wave normals"}, *//* these are in nor channel now */ - {TEX_OCN_FOAM, "FOAM", 0, "Foam", "Output Foam (wave overlap) amount in single channel"}, - {TEX_OCN_JPLUS, "JPLUS", 0, "Eigenvalues", "Positive Eigenvalues"}, - {TEX_OCN_EMINUS, "EMINUS", 0, "Eigenvectors (-)", "Negative Eigenvectors"}, - {TEX_OCN_EPLUS, "EPLUS", 0, "Eigenvectors (+)", "Positive Eigenvectors"}, - {0, NULL, 0, NULL, NULL} - }; - - srna = RNA_def_struct(brna, "OceanTexData", NULL); - RNA_def_struct_sdna(srna, "OceanTex"); - RNA_def_struct_ui_text(srna, "Ocean", "Ocean Texture settings"); - RNA_def_struct_path_func(srna, "rna_OceanTex_path"); - - prop = RNA_def_property(srna, "output", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "output"); - RNA_def_property_enum_items(prop, ocean_output_items); - RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); - RNA_def_property_ui_text(prop, "Output", "The data that is output by the texture"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - prop = RNA_def_property(srna, "ocean_object", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "object"); - RNA_def_property_ui_text(prop, "Modifier Object", "Object containing the ocean modifier"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, 0, "rna_Texture_update"); - - srna = RNA_def_struct(brna, "OceanTexture", "Texture"); - RNA_def_struct_sdna(srna, "Tex"); - RNA_def_struct_ui_text(srna, "Ocean", "Settings for the Ocean texture"); - - prop = RNA_def_property(srna, "ocean", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "ot"); - RNA_def_property_struct_type(prop, "OceanTexData"); - RNA_def_property_ui_text(prop, "Ocean", "The ocean data associated with this texture"); - RNA_def_property_update(prop, 0, "rna_Texture_update"); -} - static void rna_def_texture(BlenderRNA *brna) { StructRNA *srna; @@ -2134,13 +1528,9 @@ static void rna_def_texture(BlenderRNA *brna) rna_def_texture_stucci(brna); rna_def_texture_noise(brna); rna_def_texture_image(brna); - rna_def_texture_environment_map(brna); rna_def_texture_musgrave(brna); rna_def_texture_voronoi(brna); rna_def_texture_distorted_noise(brna); - rna_def_texture_pointdensity(brna); - rna_def_texture_voxeldata(brna); - rna_def_texture_ocean(brna); /* XXX add more types here .. */ RNA_api_texture(srna); @@ -2150,7 +1540,6 @@ void RNA_def_texture(BlenderRNA *brna) { rna_def_texture(brna); rna_def_mtex(brna); - rna_def_environment_map(brna); rna_def_texmapping(brna); rna_def_colormapping(brna); } |