diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-11-13 16:17:27 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-11-13 16:17:27 +0400 |
commit | 11c83d843206648a33bcc8b4d754577ec0a51d2a (patch) | |
tree | 58af33c372ba5d77f68d6ed7b37e5aecd6e6c678 /source/blender/makesrna/intern/rna_texture.c | |
parent | b1019a56b54294fc91293c5c43ef46d54950ae84 (diff) |
Ocean Sim modifier patch
by Matt Ebb, Hamed Zaghaghi
This adds a new Modifier "Ocean" to simulate large-scale wave motion.
Details can be found in the wiki documentation [1], the project homepage [2] and the patch tracker [3]
The modifier is disabled by default for now. To enable it, the WITH_OCEANSIM (cmake) / WITH_BF_OCEANSIM (scons) flags have to be set. The code depends on fftw3, so this also has to be enabled.
[1]
http://wiki.blender.org/index.php/Doc:2.6/Manual/Modifiers/Simulation/Ocean
[2]
http://www.savetheoceansim.com
[3]
http://projects.blender.org/tracker/?group_id=9&atid=127&func=detail&aid=28338
Diffstat (limited to 'source/blender/makesrna/intern/rna_texture.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_texture.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index aac4da9e6f6..249bdb4a366 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -73,6 +73,7 @@ EnumPropertyItem texture_type_items[] = { {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"}, + {TEX_OCEAN, "OCEAN", ICON_TEXTURE, "Ocean", ""}, {0, NULL, 0, NULL, NULL}}; EnumPropertyItem blend_type_items[] = { @@ -145,6 +146,8 @@ static StructRNA *rna_Texture_refine(struct PointerRNA *ptr) return &RNA_VoxelDataTexture; case TEX_WOOD: return &RNA_WoodTexture; + case TEX_OCEAN: + return &RNA_OceanTexture; default: return &RNA_Texture; } @@ -435,6 +438,11 @@ static char *rna_VoxelData_path(PointerRNA *UNUSED(ptr)) return BLI_sprintfN("voxel_data"); } +static char *rna_OceanTex_path(PointerRNA *ptr) +{ + return BLI_sprintfN("ocean"); +} + #else static void rna_def_texmapping(BlenderRNA *brna) @@ -1860,6 +1868,49 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); } +static void rna_def_texture_ocean(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem ocean_output_items[] = { + {TEX_OCN_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", "Outputs 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", "Outputs 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; @@ -1962,6 +2013,7 @@ static void rna_def_texture(BlenderRNA *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); |