Index: release/scripts/presets/transparency/glass.py =================================================================== --- release/scripts/presets/transparency/glass.py (revision 0) +++ release/scripts/presets/transparency/glass.py (revision 0) @@ -0,0 +1 @@ +bpy.context.active_object.active_material.raytrace_transparency.ior = 1.52 Index: release/scripts/presets/transparency/diamond.py =================================================================== --- release/scripts/presets/transparency/diamond.py (revision 0) +++ release/scripts/presets/transparency/diamond.py (revision 0) @@ -0,0 +1 @@ +bpy.context.active_object.active_material.raytrace_transparency.ior = 2.419 Index: release/scripts/presets/transparency/beer.py =================================================================== --- release/scripts/presets/transparency/beer.py (revision 0) +++ release/scripts/presets/transparency/beer.py (revision 0) @@ -0,0 +1 @@ +bpy.context.active_object.active_material.raytrace_transparency.ior = 1.345 Index: release/scripts/presets/transparency/crystal.py =================================================================== --- release/scripts/presets/transparency/crystal.py (revision 0) +++ release/scripts/presets/transparency/crystal.py (revision 0) @@ -0,0 +1 @@ +bpy.context.active_object.active_material.raytrace_transparency.ior = 2.000 Index: release/scripts/presets/transparency/water.py =================================================================== --- release/scripts/presets/transparency/water.py (revision 0) +++ release/scripts/presets/transparency/water.py (revision 0) @@ -0,0 +1 @@ +bpy.context.active_object.active_material.raytrace_transparency.ior = 1.333 Index: release/scripts/ui/properties_material.py =================================================================== --- release/scripts/ui/properties_material.py (revision 26762) +++ release/scripts/ui/properties_material.py (working copy) @@ -43,6 +43,13 @@ draw = bpy.types.Menu.draw_preset +class MATERIAL_MT_transparency_presets(bpy.types.Menu): + bl_label = "Transparency Presets" + preset_subdir = "transparency" + preset_operator = "script.python_file_run" + draw = bpy.types.Menu.draw_preset + + class MATERIAL_MT_specials(bpy.types.Menu): bl_label = "Material Specials" @@ -634,6 +641,11 @@ if mat.transparency_method == 'RAYTRACE': layout.separator() + + row = layout.row(align=True).split(percentage=0.75) + row.menu("MATERIAL_MT_transparency_presets", text="Presets") + row.operator("material.transparency_preset_add", text="Add") + split = layout.split() split.active = mat.transparency @@ -928,6 +940,7 @@ col.prop(vol, "depth_cutoff") bpy.types.register(MATERIAL_MT_sss_presets) +bpy.types.register(MATERIAL_MT_transparency_presets) bpy.types.register(MATERIAL_MT_specials) bpy.types.register(MATERIAL_PT_volume_density) Index: release/scripts/op/presets.py =================================================================== --- release/scripts/op/presets.py (revision 26762) +++ release/scripts/op/presets.py (working copy) @@ -154,8 +154,29 @@ preset_subdir = "sunsky" +class AddPresetTransparency(AddPresetBase): + '''Add a Transparency Preset.''' + bl_idname = "material.transparency_preset_add" + bl_label = "Add Transparency Preset" + name = AddPresetBase.name + preset_values = [ + "bpy.context.material.raytrace_transparency.fresnel", + "bpy.context.material.raytrace_transparency.fresnel_factor", + "bpy.context.material.raytrace_transparency.ior", + "bpy.context.material.raytrace_transparency.filter", + "bpy.context.material.raytrace_transparency.falloff", + "bpy.context.material.raytrace_transparency.limit", + "bpy.context.material.raytrace_transparency.depth", + "bpy.context.material.raytrace_transparency.gloss_factor", + "bpy.context.material.raytrace_transparency.gloss_threshold", + "bpy.context.material.raytrace_transparency.gloss_samples", + ] + + preset_subdir = "transparency" + bpy.types.register(AddPresetRender) bpy.types.register(AddPresetSSS) bpy.types.register(AddPresetCloth) bpy.types.register(AddPresetSunSky) +bpy.types.register(AddPresetTransparency) Index: source/blender/makesrna/intern/rna_material.c =================================================================== --- source/blender/makesrna/intern/rna_material.c (revision 26762) +++ source/blender/makesrna/intern/rna_material.c (working copy) @@ -1665,7 +1665,7 @@ RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "MaterialRaytraceTransparency"); RNA_def_property_pointer_funcs(prop, "rna_Material_transp_get", NULL, NULL); - RNA_def_property_ui_text(prop, "Raytrace Transparency", "Raytraced reflection settings for the material."); + RNA_def_property_ui_text(prop, "Raytrace Transparency", "Raytraced transparency settings for the material."); prop= RNA_def_property(srna, "volume", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL);