UI: add light/world settings in shader node editor.

Material was already there. Implementation was changed so it's just a
single line of code to adapt a panel to the node editor.
This commit is contained in:
2019-03-17 17:52:05 +01:00
parent f79ad42808
commit df96455c55
5 changed files with 96 additions and 109 deletions

View File

@@ -69,7 +69,13 @@ class DATA_PT_light(DataButtonsPanel, Panel):
light = context.light
layout.row().prop(light, "type", expand=True)
# Compact layout for node editor.
if self.bl_space_type == 'PROPERTIES':
layout.row().prop(light, "type", expand=True)
layout.use_property_split = True
else:
layout.use_property_split = True
layout.row().prop(light, "type")
class DATA_PT_EEVEE_light(DataButtonsPanel, Panel):
@@ -80,9 +86,13 @@ class DATA_PT_EEVEE_light(DataButtonsPanel, Panel):
layout = self.layout
light = context.light
layout.row().prop(light, "type", expand=True)
layout.use_property_split = True
# Compact layout for node editor.
if self.bl_space_type == 'PROPERTIES':
layout.row().prop(light, "type", expand=True)
layout.use_property_split = True
else:
layout.use_property_split = True
layout.row().prop(light, "type")
col = layout.column()
col.prop(light, "color")