Index: release/scripts/startup/bl_ui/properties_material.py =================================================================== --- release/scripts/startup/bl_ui/properties_material.py (revision 38485) +++ release/scripts/startup/bl_ui/properties_material.py (working copy) @@ -174,6 +174,7 @@ row.prop(mat, "use_transparency") sub = row.column() sub.prop(mat, "offset_z") + sub.active = mat_type and mat.use_transparency and mat.transparency_method == 'Z_TRANSPARENCY' row = layout.row() @@ -199,6 +200,7 @@ col.prop(mat, "shadow_cast_alpha", text="Casting Alpha") col.prop(mat, "use_cast_buffer_shadows") col.prop(mat, "use_cast_approximate") + col.prop(mat, "pass_index") class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel): @@ -729,7 +731,8 @@ col.prop(mat, "use_vertex_color_paint") col.prop(mat, "use_vertex_color_light") col.prop(mat, "use_object_color") - col.prop(mat, "pass_index") + if simple_material(base_mat): + col.prop(mat, "pass_index") class MATERIAL_PT_shadow(MaterialButtonsPanel, bpy.types.Panel): Index: source/blender/nodes/intern/SHD_util.c =================================================================== --- source/blender/nodes/intern/SHD_util.c (revision 38485) +++ source/blender/nodes/intern/SHD_util.c (working copy) @@ -83,7 +83,11 @@ void ntreeShaderExecTree(bNodeTree *ntree, ShadeInput *shi, ShadeResult *shr) { ShaderCallData scd; - + /* + @note: preserve the material what was hit, this will be pointer will be modified by the shade tree + fix for bug "[#28012] Mat ID messy with shader nodes" + */ + Material* mat = shi->mat; /* convert caller data to struct */ scd.shi= shi; scd.shr= shr; @@ -92,7 +96,8 @@ memset(shr, 0, sizeof(ShadeResult)); ntreeExecTree(ntree, &scd, shi->thread); /* threads */ - + // @note: reset the material to original hit + shi->mat = mat; /* better not allow negative for now */ if(shr->combined[0]<0.0f) shr->combined[0]= 0.0f; if(shr->combined[1]<0.0f) shr->combined[1]= 0.0f;