UI: hierarchical nesting
Use correct hierarchical nesting in camera and mesh obdata properties
This commit is contained in:
@@ -374,12 +374,8 @@ class DATA_PT_camera_display(CameraButtonsPanel, Panel):
|
||||
col = layout.column(align=True)
|
||||
|
||||
col.separator()
|
||||
|
||||
col.prop(cam, "display_size", text="Size")
|
||||
col.separator()
|
||||
col.prop(cam, "show_passepartout", text="Passepartout")
|
||||
sub = col.column()
|
||||
sub.active = cam.show_passepartout
|
||||
sub.prop(cam, "passepartout_alpha", text="Alpha", slider=True)
|
||||
|
||||
col.separator()
|
||||
|
||||
@@ -389,6 +385,27 @@ class DATA_PT_camera_display(CameraButtonsPanel, Panel):
|
||||
col.prop(cam, "show_name", text="Name")
|
||||
|
||||
|
||||
class DATA_PT_camera_display_passepartout(CameraButtonsPanel, Panel):
|
||||
bl_label = "Passepartout"
|
||||
bl_parent_id = "DATA_PT_camera_display"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
||||
|
||||
def draw_header(self, context):
|
||||
cam = context.camera
|
||||
|
||||
self.layout.prop(cam, "show_passepartout", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
cam = context.camera
|
||||
|
||||
layout.active = cam.show_passepartout
|
||||
layout.prop(cam, "passepartout_alpha", text="Opacity", slider=True)
|
||||
|
||||
|
||||
class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel):
|
||||
bl_label = "Safe Areas"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
@@ -407,7 +424,41 @@ class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel):
|
||||
safe_data = context.scene.safe_areas
|
||||
camera = context.camera
|
||||
|
||||
draw_display_safe_settings(layout, safe_data, camera)
|
||||
layout.use_property_split = True
|
||||
|
||||
layout.active = camera.show_safe_areas
|
||||
|
||||
col = layout.column()
|
||||
|
||||
sub = col.column()
|
||||
sub.prop(safe_data, "title", slider=True)
|
||||
sub.prop(safe_data, "action", slider=True)
|
||||
|
||||
|
||||
class DATA_PT_camera_safe_areas_center_cut(CameraButtonsPanel, Panel):
|
||||
bl_label = "Center-Cut Safe Areas"
|
||||
bl_parent_id = "DATA_PT_camera_safe_areas"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
||||
|
||||
def draw_header(self, context):
|
||||
cam = context.camera
|
||||
|
||||
layout = self.layout
|
||||
layout.active = cam.show_safe_areas
|
||||
layout.prop(cam, "show_safe_center", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
safe_data = context.scene.safe_areas
|
||||
camera = context.camera
|
||||
|
||||
layout.use_property_split = True
|
||||
|
||||
layout.active = camera.show_safe_areas and camera.show_safe_center
|
||||
|
||||
col = layout.column()
|
||||
col.prop(safe_data, "title_center", slider=True)
|
||||
|
||||
|
||||
class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, Panel):
|
||||
@@ -449,8 +500,10 @@ classes = (
|
||||
DATA_PT_camera,
|
||||
DATA_PT_camera_stereoscopy,
|
||||
DATA_PT_camera_safe_areas,
|
||||
DATA_PT_camera_safe_areas_center_cut,
|
||||
DATA_PT_camera_background_image,
|
||||
DATA_PT_camera_display,
|
||||
DATA_PT_camera_display_passepartout,
|
||||
DATA_PT_custom_props_camera,
|
||||
)
|
||||
|
||||
|
||||
@@ -183,10 +183,26 @@ class DATA_PT_normals(MeshButtonsPanel, Panel):
|
||||
col = layout.column()
|
||||
col.prop(mesh, "show_double_sided")
|
||||
|
||||
col.prop(mesh, "use_auto_smooth")
|
||||
sub = col.column()
|
||||
sub.active = mesh.use_auto_smooth and not mesh.has_custom_normals
|
||||
sub.prop(mesh, "auto_smooth_angle", text="Angle")
|
||||
|
||||
class DATA_PT_normals_auto_smooth(MeshButtonsPanel, Panel):
|
||||
bl_label = "Auto Smooth"
|
||||
bl_parent_id = "DATA_PT_normals"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
||||
|
||||
def draw_header(self, context):
|
||||
mesh = context.mesh
|
||||
|
||||
self.layout.prop(mesh, "use_auto_smooth", text="")
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
|
||||
mesh = context.mesh
|
||||
|
||||
layout.active = mesh.use_auto_smooth and not mesh.has_custom_normals
|
||||
layout.prop(mesh, "auto_smooth_angle", text="Angle")
|
||||
|
||||
|
||||
class DATA_PT_texture_space(MeshButtonsPanel, Panel):
|
||||
@@ -489,6 +505,7 @@ classes = (
|
||||
DATA_PT_vertex_colors,
|
||||
DATA_PT_face_maps,
|
||||
DATA_PT_normals,
|
||||
DATA_PT_normals_auto_smooth,
|
||||
DATA_PT_texture_space,
|
||||
DATA_PT_customdata,
|
||||
DATA_PT_custom_props_mesh,
|
||||
|
||||
Reference in New Issue
Block a user