Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2017-04-25 19:46:59 +0300
committerClément Foucault <foucault.clem@gmail.com>2017-04-25 19:47:20 +0300
commit041a50291b73b727fdf8bc3192de2917e8563ce0 (patch)
tree4a01f82c9241b3fa3037ccdaac113d4a86be447e /release
parent00f5c621a65b6bc9847776b2542588835fb4054c (diff)
Eevee: Make default shaders works.
- Added New Batch cache routine to get the split mesh for each material. (optimization needed) - Did some shader modifications to create default_frag and support a somwhat correct fresnel for lamps (to finish)
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/properties_material.py84
1 files changed, 84 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py
index 06ae1847d06..0e8acf6e6c5 100644
--- a/release/scripts/startup/bl_ui/properties_material.py
+++ b/release/scripts/startup/bl_ui/properties_material.py
@@ -1054,6 +1054,88 @@ class MATERIAL_PT_custom_props(MaterialButtonsPanel, PropertyPanel, Panel):
_property_type = bpy.types.Material
+class EEVEE_MATERIAL_PT_context_material(MaterialButtonsPanel, Panel):
+ bl_label = ""
+ bl_context = "material"
+ bl_options = {'HIDE_HEADER'}
+ COMPAT_ENGINES = {'BLENDER_EEVEE'}
+
+ @classmethod
+ def poll(cls, context):
+ engine = context.scene.render.engine
+ return (context.material or context.object) and (engine in cls.COMPAT_ENGINES)
+
+ def draw(self, context):
+ layout = self.layout
+
+ mat = context.material
+ ob = context.object
+ slot = context.material_slot
+ space = context.space_data
+
+ if ob:
+ is_sortable = len(ob.material_slots) > 1
+ rows = 1
+ if (is_sortable):
+ rows = 4
+
+ row = layout.row()
+
+ row.template_list("MATERIAL_UL_matslots", "", ob, "material_slots", ob, "active_material_index", rows=rows)
+
+ 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 is_sortable:
+ col.separator()
+
+ col.operator("object.material_slot_move", icon='TRIA_UP', text="").direction = 'UP'
+ col.operator("object.material_slot_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
+
+ 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")
+
+ split = layout.split(percentage=0.65)
+
+ if ob:
+ split.template_ID(ob, "active_material", new="material.new")
+ row = split.row()
+
+ if slot:
+ row.prop(slot, "link", text="")
+ else:
+ row.label()
+ elif mat:
+ split.template_ID(space, "pin_id")
+ split.separator()
+
+
+class EEVEE_MATERIAL_PT_surface(MaterialButtonsPanel, Panel):
+ bl_label = "Surface"
+ bl_context = "material"
+ COMPAT_ENGINES = {'BLENDER_EEVEE'}
+
+ @classmethod
+ def poll(cls, context):
+ engine = context.scene.render.engine
+ return context.material and (engine in cls.COMPAT_ENGINES)
+
+ def draw(self, context):
+ layout = self.layout
+
+ mat = context.material
+ if not mat.use_nodes:
+ layout.prop(mat, "diffuse_color", text="Diffuse")
+ layout.prop(mat, "specular_color", text="Specular")
+ layout.prop(mat, "specular_hardness", text="Glossiness")
+
+
classes = (
MATERIAL_MT_sss_presets,
MATERIAL_MT_specials,
@@ -1082,6 +1164,8 @@ classes = (
MATERIAL_PT_volume_integration,
MATERIAL_PT_volume_options,
MATERIAL_PT_custom_props,
+ EEVEE_MATERIAL_PT_context_material,
+ EEVEE_MATERIAL_PT_surface,
)
if __name__ == "__main__": # only for live edit.