[Durian-svn] [1358] remove raytrace hack
campbell
institute at blender.org
Tue Mar 16 12:39:47 CET 2010
Revision: 1358
https://blenderinstitute.dyndns.org/durian-svn/?do=log&project=durian&path=/&rev=1358
Author: campbell
Date: 2010-03-16 12:39:46 +0100 (Tue, 16 Mar 2010)
Log Message:
-----------
remove raytrace hack
Removed Paths:
-------------
pro/scripts/ui/material_raytrace_hack.py
Deleted: pro/scripts/ui/material_raytrace_hack.py
===================================================================
--- pro/scripts/ui/material_raytrace_hack.py 2010-03-16 11:08:21 UTC (rev 1357)
+++ pro/scripts/ui/material_raytrace_hack.py 2010-03-16 11:39:46 UTC (rev 1358)
@@ -1,111 +0,0 @@
-import bpy
-
-class MaterialNew(bpy.types.Operator):
- bl_idname = "material.new_noray"
- bl_label = "Material New"
-
- def execute(self, context):
- bpy.ops.material.new()
- mat = context.object.active_material
- mat.traceable = False
- return {'FINISHED'}
-
-
-class MaterialRayOff(bpy.types.Operator):
- bl_idname = "material.ray_off"
- bl_label = "Material Trace Off"
-
- def execute(self, context):
- for mat in bpy.data.materials:
- if "_eye_" in mat.name:
- continue
-
- if mat.traceable:
- if not mat.library:
- mat.traceable = False
- else:
- self.report({'WARNING'}, "Trace Could not be disabled for '%s' of '%s'\n" % (mat.name, mat.library.filename))
-
- return {'FINISHED'}
-
-# keep in sync with properties_material.py
-narrowui = 180
-import properties_material
-class MATERIAL_PT_context_material(properties_material.MaterialButtonsPanel):
- bl_label = ""
- bl_show_header = False
- COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
-
- def poll(self, context):
- # An exception, dont call the parent poll func because
- # this manages materials for all engine types
-
- engine = context.scene.render.engine
- return (context.material or context.object) and (engine in self.COMPAT_ENGINES)
-
- def draw(self, context):
- layout = self.layout
-
- mat = context.material
- ob = context.object
- slot = context.material_slot
- space = context.space_data
- wide_ui = context.region.width > narrowui
-
- if ob:
- row = layout.row()
-
- row.template_list(ob, "material_slots", ob, "active_material_index", rows=2)
-
- col = row.column(align=True)
- col.operator("object.material_slot_add", icon='ZOOMIN', text="")
- col.operator("object.material_slot_remove", icon='ZOOMOUT', text="")
-
- col.menu("MATERIAL_MT_specials", icon='DOWNARROW_HLT', text="")
-
- if ob.mode == 'EDIT':
- row = layout.row(align=True)
- row.operator("object.material_slot_assign", text="Assign")
- row.operator("object.material_slot_select", text="Select")
- row.operator("object.material_slot_deselect", text="Deselect")
-
- if wide_ui:
- split = layout.split(percentage=0.65)
-
- if ob:
- split.template_ID(ob, "active_material", new="material.new_noray") # ----------------------- < only changed line
- row = split.row()
- if slot:
- row.prop(slot, "link", text="")
- else:
- row.label()
- elif mat:
- split.template_ID(space, "pin_id")
- split.separator()
- else:
- if ob:
- layout.template_ID(ob, "active_material", new="material.new_noray") # ----------------------- < only changed line
- elif mat:
- layout.template_ID(space, "pin_id")
-
- if mat:
- if wide_ui:
- layout.prop(mat, "type", expand=True)
- else:
- layout.prop(mat, "type", text="")
-
-
-menu_func = (lambda self, context: self.layout.operator(MaterialRayOff.bl_idname))
-
-def register():
- bpy.types.register(MATERIAL_PT_context_material)
- bpy.types.register(MaterialNew)
- bpy.types.register(MaterialRayOff)
- bpy.types.MATERIAL_MT_specials.append(menu_func)
-
-def unregister():
- bpy.types.unregister(MATERIAL_PT_context_material)
- bpy.types.unregister(MaterialNew)
- bpy.types.unregister(MaterialRayOff)
- bpy.types.MATERIAL_MT_specials.remove(menu_func)
-
More information about the Durian-svn
mailing list