Cycles: show viewport hair settings when using Cycles

Before this patch, users had to switch render engines just to change how the
hair should be displayed in solid and material preview viewport shading modes.

Differential Revision: https://developer.blender.org/D14290
This commit is contained in:
Ethan-Hall 2022-03-09 17:00:22 +01:00 committed by Brecht Van Lommel
parent 3902bebf18
commit 3b28c785d4
2 changed files with 23 additions and 8 deletions

View File

@ -11,6 +11,7 @@ from bl_ui.utils import PresetPanel
from bpy.types import Panel
from bl_ui.properties_grease_pencil_common import GreasePencilSimplifyPanel
from bl_ui.properties_render import draw_hair_settings
from bl_ui.properties_view_layer import ViewLayerCryptomattePanel, ViewLayerAOVPanel
class CyclesPresetPanel(PresetPanel, Panel):
@ -355,6 +356,13 @@ class CYCLES_RENDER_PT_hair(CyclesButtonsPanel, Panel):
if ccscene.shape == 'RIBBONS':
col.prop(ccscene, "subdivisions", text="Curve Subdivisions")
class CYCLES_RENDER_PT_hair_viewport_display(CyclesButtonsPanel, Panel):
bl_label = "Viewport Display"
bl_parent_id = "CYCLES_RENDER_PT_hair"
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
draw_hair_settings(self, context)
class CYCLES_RENDER_PT_volumes(CyclesButtonsPanel, Panel):
bl_label = "Volumes"
@ -2153,6 +2161,7 @@ classes = (
CYCLES_RENDER_PT_volumes,
CYCLES_RENDER_PT_subdivision,
CYCLES_RENDER_PT_hair,
CYCLES_RENDER_PT_hair_viewport_display,
CYCLES_RENDER_PT_simplify,
CYCLES_RENDER_PT_simplify_viewport,
CYCLES_RENDER_PT_simplify_render,

View File

@ -484,6 +484,18 @@ class RENDER_PT_eevee_film(RenderButtonsPanel, Panel):
sub.prop(props, "overscan_size", text="")
def draw_hair_settings(self, context):
layout = self.layout
scene = context.scene
rd = scene.render
layout.use_property_split = True
layout.use_property_decorate = False # No animation.
layout.prop(rd, "hair_type", text="Shape", expand=True)
layout.prop(rd, "hair_subdiv")
class RENDER_PT_eevee_hair(RenderButtonsPanel, Panel):
bl_label = "Hair"
bl_options = {'DEFAULT_CLOSED'}
@ -494,14 +506,7 @@ class RENDER_PT_eevee_hair(RenderButtonsPanel, Panel):
return (context.engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
scene = context.scene
rd = scene.render
layout.use_property_split = True
layout.prop(rd, "hair_type", expand=True)
layout.prop(rd, "hair_subdiv")
draw_hair_settings(self, context)
class RENDER_PT_eevee_performance(RenderButtonsPanel, Panel):
@ -519,6 +524,7 @@ class RENDER_PT_eevee_performance(RenderButtonsPanel, Panel):
rd = scene.render
layout.use_property_split = True
layout.use_property_decorate = False # No animation.
layout.prop(rd, "use_high_quality_normals")