From 4cc8123377b1502e028a8f9e6132b78e46e0520f Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Fri, 1 May 2020 15:21:41 +0200 Subject: UI: Use property split layout and decorators for material properties Use the automatic property split layout (hence, change to the new 40/60% split ratio) and add decorator buttons for animatable properties. This actually applies to all node input buttons in the properties, e.g. world shading, light shading, texture nodes. Doing this makes the layout more consistent with other layouts in the properties. But the decorators are also a useful hint for users that these options can be animated. Previously using decorators and the automatic split layout wasn't possible, I've done a number of changes now to have it supported. Before I moved the socket icons to the left side, the decorators also looked weird (two circle icons next to each other). {F8497704} With nested items: {F8497708} Reviewed By: William Reynish, Pablo Vazquez Differential Revision: https://developer.blender.org/D7544 --- intern/cycles/blender/addon/ui.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'intern') diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 9c125f7fc9e..08641c05941 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -1410,6 +1410,8 @@ class CYCLES_LIGHT_PT_nodes(CyclesButtonsPanel, Panel): def draw(self, context): layout = self.layout + layout.use_property_split = True + light = context.light panel_node_draw(layout, light, 'OUTPUT_LIGHT', 'Surface') @@ -1459,6 +1461,8 @@ class CYCLES_WORLD_PT_surface(CyclesButtonsPanel, Panel): def draw(self, context): layout = self.layout + layout.use_property_split = True + world = context.world if not panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Surface'): @@ -1478,6 +1482,8 @@ class CYCLES_WORLD_PT_volume(CyclesButtonsPanel, Panel): def draw(self, context): layout = self.layout + layout.use_property_split = True + world = context.world panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Volume') @@ -1665,6 +1671,8 @@ class CYCLES_MATERIAL_PT_surface(CyclesButtonsPanel, Panel): def draw(self, context): layout = self.layout + layout.use_property_split = True + mat = context.material if not panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Surface'): layout.prop(mat, "diffuse_color") @@ -1683,6 +1691,8 @@ class CYCLES_MATERIAL_PT_volume(CyclesButtonsPanel, Panel): def draw(self, context): layout = self.layout + layout.use_property_split = True + mat = context.material # cmat = mat.cycles @@ -1701,6 +1711,8 @@ class CYCLES_MATERIAL_PT_displacement(CyclesButtonsPanel, Panel): def draw(self, context): layout = self.layout + layout.use_property_split = True + mat = context.material panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Displacement') -- cgit v1.2.3