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-05-30 18:16:36 +0300
committerClément Foucault <foucault.clem@gmail.com>2017-05-30 18:18:00 +0300
commit9f43b36f1c81fc361d9f9c38a85665a49e7b8c44 (patch)
tree0dd3be95fe8af360faab8cf47ed0fa0cc67a2322
parent7b379313ded90b58422497bac5af5dfda440aeb8 (diff)
Eevee: UI add world and material nodetree layout.
-rw-r--r--release/scripts/startup/bl_ui/properties_material.py32
-rw-r--r--release/scripts/startup/bl_ui/properties_world.py16
2 files changed, 44 insertions, 4 deletions
diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py
index b13f5eee62a..18f92fc5268 100644
--- a/release/scripts/startup/bl_ui/properties_material.py
+++ b/release/scripts/startup/bl_ui/properties_material.py
@@ -21,7 +21,7 @@ import bpy
from bpy.types import Menu, Panel, UIList
from rna_prop_ui import PropertyPanel
from bpy.app.translations import pgettext_iface as iface_
-
+from bpy_extras.node_utils import find_node_input, find_output_node
def active_node_mat(mat):
# TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
@@ -1114,6 +1114,28 @@ class EEVEE_MATERIAL_PT_context_material(MaterialButtonsPanel, Panel):
split.separator()
+def panel_node_draw(layout, ntree, output_type):
+ node = find_output_node(ntree, output_type)
+
+ if node:
+ def display_input(layout, ntree, node, input_name):
+ input = find_node_input(node, input_name)
+ layout.template_node_view(ntree, node, input)
+
+ display_input(layout, ntree, node, 'Base Color')
+ if output_type == 'OUTPUT_METALLIC':
+ display_input(layout, ntree, node, 'Metallic')
+ display_input(layout, ntree, node, 'Specular')
+ display_input(layout, ntree, node, 'Roughness')
+ display_input(layout, ntree, node, 'Emissive Color')
+ display_input(layout, ntree, node, 'Transparency')
+ display_input(layout, ntree, node, 'Normal')
+ display_input(layout, ntree, node, 'Ambient Occlusion')
+ return True
+
+ return False
+
+
class EEVEE_MATERIAL_PT_surface(MaterialButtonsPanel, Panel):
bl_label = "Surface"
bl_context = "material"
@@ -1132,9 +1154,13 @@ class EEVEE_MATERIAL_PT_surface(MaterialButtonsPanel, Panel):
layout.prop(mat, "use_nodes", icon='NODETREE')
layout.separator()
- if not mat.use_nodes:
+ if mat.use_nodes:
+ if not panel_node_draw(layout, mat.node_tree, 'OUTPUT_METALLIC'):
+ if not panel_node_draw(layout, mat.node_tree, 'OUTPUT_SPECULAR'):
+ layout.label(text="No output node")
+ else:
raym = mat.raytrace_mirror
- layout.prop(mat, "diffuse_color", text="Diffuse")
+ layout.prop(mat, "diffuse_color", text="Base Color")
layout.prop(raym, "reflect_factor", text="Metallic")
layout.prop(mat, "specular_intensity", text="Specular")
layout.prop(raym, "gloss_factor", text="Roughness")
diff --git a/release/scripts/startup/bl_ui/properties_world.py b/release/scripts/startup/bl_ui/properties_world.py
index e419f8d1df3..1f0cbe35689 100644
--- a/release/scripts/startup/bl_ui/properties_world.py
+++ b/release/scripts/startup/bl_ui/properties_world.py
@@ -20,6 +20,7 @@
import bpy
from bpy.types import Panel
from rna_prop_ui import PropertyPanel
+from bpy_extras.node_utils import find_node_input, find_output_node
class WorldButtonsPanel:
@@ -264,7 +265,20 @@ class EEVEE_WORLD_PT_surface(WorldButtonsPanel, Panel):
world = context.world
- layout.prop(world, "horizon_color", text="Color")
+ layout.prop(world, "use_nodes", icon='NODETREE')
+ layout.separator()
+
+ if world.use_nodes:
+ ntree = world.node_tree
+ node = find_output_node(ntree, 'OUTPUT_WORLD')
+
+ if not node:
+ layout.label(text="No output node")
+ else:
+ input = find_node_input(node, 'Surface')
+ layout.template_node_view(ntree, node, input)
+ else:
+ layout.prop(world, "horizon_color", text="Color")
classes = (