Page Menu
Home
Search
Configure Global Search
Log In
Files
F15470
transparency-panel.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Ervin Weber (lusque)
Nov 13 2013, 3:11 PM
Size
11 KB
Subscribers
None
transparency-panel.patch
View Options
Index: release/scripts/op/animsys_update.py
===================================================================
--- release/scripts/op/animsys_update.py (revision 34050)
+++ release/scripts/op/animsys_update.py (working copy)
@@ -160,7 +160,6 @@
("Material", "traceable", "use_raytrace"),
("Material", "shadeless", "use_shadeless"),
("Material", "tangent_shading", "use_tangent_shading"),
- ("Material", "transparency", "use_transparency"),
("Material", "receive_transparent_shadows", "use_transparent_shadows"),
("Material", "vertex_color_light", "use_vertex_color_light"),
("Material", "vertex_color_paint", "use_vertex_color_paint"),
@@ -701,4 +700,4 @@
def register():
- pass
+ pass
\ No newline at end of file
Index: release/scripts/op/io_scene_obj/import_obj.py
===================================================================
--- release/scripts/op/io_scene_obj/import_obj.py (revision 34050)
+++ release/scripts/op/io_scene_obj/import_obj.py (working copy)
@@ -306,7 +306,7 @@
texture.mipmap = True
texture.interpolation = True
texture.use_alpha = True
- blender_material.use_transparency = True
+ blender_material.transparency_method = 'Z_TRANSPARENCY'
blender_material.alpha = 0.0
else:
mtex = blender_material.texture_slots.add()
@@ -341,7 +341,6 @@
mtex.texture = texture
mtex.texture_coords = 'UV'
mtex.use_map_alpha = True
- blender_material.use_transparency = True
blender_material.transparency_method = 'Z_TRANSPARENCY'
blender_material.alpha = 0.0
# Todo, unset deffuse material alpha if it has an alpha channel
@@ -401,7 +400,6 @@
context_material.raytrace_transparency.ior = max(1, min(float(line_split[1]), 3)) # between 1 and 3
elif line_lower.startswith('d') or line_lower.startswith('tr'):
context_material.alpha = float(line_split[1])
- context_material.use_transparency = True
context_material.transparency_method = 'Z_TRANSPARENCY'
elif line_lower.startswith('map_ka'):
img_filepath= line_value(line.split())
@@ -1216,4 +1214,4 @@
# uses bpy.sys.time()
if __name__ == "__main__":
- register()
+ register()
\ No newline at end of file
Index: release/scripts/op/uv.py
===================================================================
--- release/scripts/op/uv.py (revision 34050)
+++ release/scripts/op/uv.py (working copy)
@@ -195,7 +195,7 @@
mat_solid.diffuse_color = mesh_source.materials[i].diffuse_color
mat_solid.use_shadeless = True
- mat_solid.use_transparency = True
+ mat_solid.transparency_method = 'Z_TRANSPARENCY'
mat_solid.alpha = 0.25
material_wire.type = 'WIRE'
@@ -376,4 +376,4 @@
bpy.types.IMAGE_MT_uvs.remove(menu_func)
if __name__ == "__main__":
- register()
+ register()
\ No newline at end of file
Index: release/scripts/ui/properties_material.py
===================================================================
--- release/scripts/ui/properties_material.py (revision 34050)
+++ release/scripts/ui/properties_material.py (working copy)
@@ -305,58 +305,49 @@
mat = active_node_mat(context.material)
engine = context.scene.render.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in cls.COMPAT_ENGINES)
-
- def draw_header(self, context):
- mat = active_node_mat(context.material)
-
- self.layout.prop(mat, "use_transparency", text="")
-
+
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
rayt = mat.raytrace_transparency
-
- row = layout.row()
- row.active = mat.use_transparency and (not mat.use_shadeless)
- row.prop(mat, "transparency_method", expand=True)
-
- split = layout.split()
-
- col = split.column()
+
+ col = layout.column()
col.prop(mat, "alpha")
row = col.row()
- row.active = mat.use_transparency and (not mat.use_shadeless)
- row.prop(mat, "specular_alpha", text="Specular")
-
- col = split.column()
- col.active = (not mat.use_shadeless)
- col.prop(rayt, "fresnel")
- sub = col.column()
+ row.active = (not mat.use_shadeless)
+ row.prop(rayt, "fresnel")
+ sub = row.row()
sub.active = rayt.fresnel > 0
sub.prop(rayt, "fresnel_factor", text="Blend")
+
+ row = layout.row()
+ row.prop(mat, "transparency_method", expand=True)
+
+ if mat.transparency_method != 'NONE':
+ row = layout.row()
+ row.active = (not mat.use_shadeless)
+ row.prop(mat, "specular_alpha", text="Specular")
+
+ if (mat.transparency_method == 'RAYTRACE'):
+ split = layout.split()
+
+ col = split.column()
+ col.prop(rayt, "ior")
+ col.prop(rayt, "filter")
+ col.prop(rayt, "falloff")
+ col.prop(rayt, "depth_max")
+ col.prop(rayt, "depth")
+
+ col = split.column()
+ col.label(text="Gloss:")
+ col.prop(rayt, "gloss_factor", text="Amount")
+ sub = col.column()
+ sub.active = rayt.gloss_factor < 1.0
+ sub.prop(rayt, "gloss_threshold", text="Threshold")
+ sub.prop(rayt, "gloss_samples", text="Samples")
- if mat.transparency_method == 'RAYTRACE':
- layout.separator()
- split = layout.split()
- split.active = mat.use_transparency
- col = split.column()
- col.prop(rayt, "ior")
- col.prop(rayt, "filter")
- col.prop(rayt, "falloff")
- col.prop(rayt, "depth_max")
- col.prop(rayt, "depth")
-
- col = split.column()
- col.label(text="Gloss:")
- col.prop(rayt, "gloss_factor", text="Amount")
- sub = col.column()
- sub.active = rayt.gloss_factor < 1.0
- sub.prop(rayt, "gloss_threshold", text="Threshold")
- sub.prop(rayt, "gloss_samples", text="Samples")
-
-
class MATERIAL_PT_mirror(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Mirror"
bl_options = {'DEFAULT_CLOSED'}
@@ -652,7 +643,7 @@
col.prop(mat, "invert_z")
sub = col.row()
sub.prop(mat, "offset_z")
- sub.active = mat.use_transparency and mat.transparency_method == 'Z_TRANSPARENCY'
+ sub.active = (mat.transparency_method == 'Z_TRANSPARENCY')
sub = col.column(align=True)
sub.label(text="Light Group:")
sub.prop(mat, "light_group", text="")
@@ -719,11 +710,6 @@
engine = context.scene.render.engine
return mat and (engine in cls.COMPAT_ENGINES)
- def draw_header(self, context):
- mat = active_node_mat(context.material)
-
- self.layout.prop(mat, "use_transparency", text="")
-
def draw(self, context):
layout = self.layout
@@ -731,7 +717,7 @@
rayt = mat.raytrace_transparency
row = layout.row()
- row.active = mat.use_transparency and (not mat.use_shadeless)
+ row.active = (mat.transparency_method != 'NONE') and (not mat.use_shadeless)
row.prop(mat, "transparency_method", expand=True)
split = layout.split()
@@ -903,4 +889,4 @@
pass
if __name__ == "__main__":
- register()
+ register()
\ No newline at end of file
Index: source/blender/blenkernel/intern/material.c
===================================================================
--- source/blender/blenkernel/intern/material.c (revision 34050)
+++ source/blender/blenkernel/intern/material.c (working copy)
@@ -182,7 +182,7 @@
ma->vol.ms_diff = 1.f;
ma->vol.ms_intensity = 1.f;
- ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RAYBIAS|MA_TANGENT_STR|MA_ZTRANSP;
+ ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RAYBIAS|MA_TANGENT_STR;
ma->shade_flag= MA_APPROX_OCCLUSION;
ma->preview = NULL;
}
Index: source/blender/blenloader/intern/readfile.c
===================================================================
--- source/blender/blenloader/intern/readfile.c (revision 34050)
+++ source/blender/blenloader/intern/readfile.c (working copy)
@@ -11226,6 +11226,12 @@
/* put compatibility code here until next subversion bump */
{
+ Material *mat;
+
+ for(mat=main->mat.first; mat; mat= mat->id.next){
+ if((mat->mode & MA_TRANSP) == 0)
+ mat->mode &= ~(MA_ZTRANSP|MA_RAYTRANSP);
+ }
Key *key;
/* old files could have been saved with slidermin = slidermax = 0.0, but the UI in
Index: source/blender/makesrna/intern/rna_material.c
===================================================================
--- source/blender/makesrna/intern/rna_material.c (revision 34050)
+++ source/blender/makesrna/intern/rna_material.c (working copy)
@@ -74,6 +74,18 @@
WM_main_add_notifier(NC_MATERIAL|ND_SHADING, ma);
}
+static void rna_Material_transparency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Material *data= (Material*)(ptr->data);
+
+ if(data->mode & (MA_ZTRANSP|MA_RAYTRANSP))
+ data->mode |= MA_TRANSP;
+ else
+ data->mode &= ~MA_TRANSP;
+
+ rna_Material_update(bmain,scene,ptr);
+}
+
static void rna_Material_draw_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Material *ma= ptr->id.data;
@@ -1533,6 +1545,7 @@
{MA_TYPE_HALO, "HALO", 0, "Halo", "Render object as halo particles"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem transparency_items[] = {
+ {0, "NONE", 0, "None", "Transparency rendering disabled"},
{MA_ZTRANSP, "Z_TRANSPARENCY", 0, "Z Transparency", "Use alpha buffer for transparent faces"},
{MA_RAYTRANSP, "RAYTRACE", 0, "Raytrace", "Use raytracing for transparent refraction rendering"},
{0, NULL, 0, NULL, NULL}};
@@ -1557,17 +1570,12 @@
RNA_def_property_ui_text(prop, "Type", "Material type defining how the object is rendered");
RNA_def_property_enum_funcs(prop, NULL, "rna_Material_type_set", NULL);
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
-
- prop= RNA_def_property(srna, "use_transparency", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_TRANSP);
- RNA_def_property_ui_text(prop, "Transparency", "Render material as transparent");
- RNA_def_property_update(prop, 0, "rna_Material_update");
-
+
prop= RNA_def_property(srna, "transparency_method", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
RNA_def_property_enum_items(prop, transparency_items);
RNA_def_property_ui_text(prop, "Transparency Method", "Method to use for rendering transparency");
- RNA_def_property_update(prop, 0, "rna_Material_update");
+ RNA_def_property_update(prop, 0, "rna_Material_transparency_update");
/* For Preview Render */
prop= RNA_def_property(srna, "preview_render_type", PROP_ENUM, PROP_NONE);
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
6f/97/afc7d8d8c9bf1acb80a495f5bb52
Event Timeline
Log In to Comment