diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_texture.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_texture.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 188a30d23ce..c1882e7767d 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -440,15 +440,13 @@ static void rna_ImageTexture_mipmap_set(PointerRNA *ptr, int value) else tex->imaflag &= ~TEX_MIPMAP; } -static void rna_Envmap_source_update(Main *bmain, Scene *scene, PointerRNA *ptr) +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_free_envmapdata(tex->env); } - rna_Texture_update(bmain, scene, ptr); } @@ -806,7 +804,7 @@ static void rna_def_environment_map(BlenderRNA *brna) 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_source_update"); + 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"); @@ -1394,7 +1392,7 @@ static void rna_def_texture_environment_map(BlenderRNA *brna) 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_Texture_update"); + 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"); @@ -1851,6 +1849,7 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna) {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} }; @@ -1869,6 +1868,14 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; + static 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"); @@ -1886,6 +1893,12 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna) 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); |