Cleanup: style

This commit is contained in:
Campbell Barton 2019-03-20 10:44:13 +11:00
parent 310a1f728c
commit 53f4fc7da9
12 changed files with 42 additions and 23 deletions

@ -48,7 +48,6 @@ class MotionPathButtonsPanel:
else: else:
row.operator("object.paths_range_update", text="", icon='TIME') row.operator("object.paths_range_update", text="", icon='TIME')
if mps.type == 'CURRENT_FRAME': if mps.type == 'CURRENT_FRAME':
col = layout.column(align=True) col = layout.column(align=True)
col.prop(mps, "frame_before", text="Frame Range Before") col.prop(mps, "frame_before", text="Frame Range Before")

@ -21,6 +21,10 @@ import bpy
from bpy.types import Panel, Menu from bpy.types import Panel, Menu
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
from .properties_animviz import (
MotionPathButtonsPanel,
MotionPathButtonsPanel_display,
)
class ArmatureButtonsPanel: class ArmatureButtonsPanel:
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
@ -257,12 +261,6 @@ class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel):
col.prop(itasc, "damping_epsilon", text="Damping Epsilon", slider=True) col.prop(itasc, "damping_epsilon", text="Damping Epsilon", slider=True)
from .properties_animviz import (
MotionPathButtonsPanel,
MotionPathButtonsPanel_display,
)
class DATA_PT_motion_paths(MotionPathButtonsPanel, Panel): class DATA_PT_motion_paths(MotionPathButtonsPanel, Panel):
#bl_label = "Bones Motion Paths" #bl_label = "Bones Motion Paths"
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}

@ -154,7 +154,10 @@ class DATA_PT_EEVEE_shadow(DataButtonsPanel, Panel):
def poll(cls, context): def poll(cls, context):
light = context.light light = context.light
engine = context.engine engine = context.engine
return (light and light.type in {'POINT', 'SUN', 'SPOT', 'AREA'}) and (engine in cls.COMPAT_ENGINES) return (
(light and light.type in {'POINT', 'SUN', 'SPOT', 'AREA'}) and
(engine in cls.COMPAT_ENGINES)
)
def draw_header(self, context): def draw_header(self, context):
light = context.light light = context.light
@ -219,7 +222,10 @@ class DATA_PT_EEVEE_shadow_contact(DataButtonsPanel, Panel):
def poll(cls, context): def poll(cls, context):
light = context.light light = context.light
engine = context.engine engine = context.engine
return (light and light.type in {'POINT', 'SUN', 'SPOT', 'AREA'}) and (engine in cls.COMPAT_ENGINES) return (
(light and light.type in {'POINT', 'SUN', 'SPOT', 'AREA'}) and
(engine in cls.COMPAT_ENGINES)
)
def draw_header(self, context): def draw_header(self, context):
light = context.light light = context.light
@ -303,7 +309,10 @@ class DATA_PT_falloff_curve(DataButtonsPanel, Panel):
light = context.light light = context.light
engine = context.engine engine = context.engine
return (light and light.type in {'POINT', 'SPOT'} and light.falloff_type == 'CUSTOM_CURVE') and (engine in cls.COMPAT_ENGINES) return (
(light and light.type in {'POINT', 'SPOT'} and light.falloff_type == 'CUSTOM_CURVE') and
(engine in cls.COMPAT_ENGINES)
)
def draw(self, context): def draw(self, context):
light = context.light light = context.light

@ -190,7 +190,15 @@ class VIEWLAYER_PT_freestyle_lineset(ViewLayerFreestyleEditorButtonsPanel, Panel
row = layout.row() row = layout.row()
rows = 4 if lineset else 2 rows = 4 if lineset else 2
row.template_list("VIEWLAYER_UL_linesets", "", freestyle, "linesets", freestyle.linesets, "active_index", rows=rows) row.template_list(
"VIEWLAYER_UL_linesets",
"",
freestyle,
"linesets",
freestyle.linesets,
"active_index",
rows=rows,
)
sub = row.column(align=True) sub = row.column(align=True)
sub.operator("scene.freestyle_lineset_add", icon='ADD', text="") sub.operator("scene.freestyle_lineset_add", icon='ADD', text="")

@ -786,6 +786,7 @@ class AnnotationOnionSkin:
row.prop(gpl, "annotation_onion_after_color", text="") row.prop(gpl, "annotation_onion_after_color", text="")
sub.prop(gpl, "annotation_onion_after_range", text="After") sub.prop(gpl, "annotation_onion_after_range", text="After")
class GreasePencilToolsPanel: class GreasePencilToolsPanel:
# For use in "2D" Editors without their own toolbar # For use in "2D" Editors without their own toolbar
# subclass must set # subclass must set

@ -17,6 +17,10 @@
# ##### END GPL LICENSE BLOCK ##### # ##### END GPL LICENSE BLOCK #####
# <pep8 compliant> # <pep8 compliant>
from .properties_animviz import (
MotionPathButtonsPanel,
MotionPathButtonsPanel_display,
)
import bpy import bpy
from bpy.types import Panel, Menu from bpy.types import Panel, Menu
from rna_prop_ui import PropertyPanel from rna_prop_ui import PropertyPanel
@ -311,12 +315,6 @@ class OBJECT_PT_instancing(ObjectButtonsPanel, Panel):
col.prop(ob, "show_instancer_for_render") col.prop(ob, "show_instancer_for_render")
from .properties_animviz import (
MotionPathButtonsPanel,
MotionPathButtonsPanel_display,
)
class OBJECT_PT_instancing_size(ObjectButtonsPanel, Panel): class OBJECT_PT_instancing_size(ObjectButtonsPanel, Panel):
bl_label = "Scale by Face Size" bl_label = "Scale by Face Size"
bl_parent_id = "OBJECT_PT_instancing" bl_parent_id = "OBJECT_PT_instancing"

@ -290,6 +290,7 @@ def brush_mask_texture_settings(layout, brush):
# #
# Share between topbar and brush panel. # Share between topbar and brush panel.
def brush_basic_wpaint_settings(layout, context, brush, *, compact=False): def brush_basic_wpaint_settings(layout, context, brush, *, compact=False):
capabilities = brush.weight_paint_capabilities capabilities = brush.weight_paint_capabilities
@ -319,7 +320,6 @@ def brush_basic_vpaint_settings(layout, context, brush, *, compact=False):
UnifiedPaintPanel.prop_unified_strength(row, context, brush, "strength") UnifiedPaintPanel.prop_unified_strength(row, context, brush, "strength")
UnifiedPaintPanel.prop_unified_strength(row, context, brush, "use_pressure_strength", text="") UnifiedPaintPanel.prop_unified_strength(row, context, brush, "use_pressure_strength", text="")
if capabilities.has_color: if capabilities.has_color:
layout.prop(brush, "blend", text="" if compact else "Blend") layout.prop(brush, "blend", text="" if compact else "Blend")

@ -1145,6 +1145,7 @@ class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):
col.prop(strip, "color_multiply", text="Multiply") col.prop(strip, "color_multiply", text="Multiply")
layout.prop(strip, "use_float", text="Convert to Float") layout.prop(strip, "use_float", text="Convert to Float")
class SEQUENCER_PT_proxy_settings(SequencerButtonsPanel, Panel): class SEQUENCER_PT_proxy_settings(SequencerButtonsPanel, Panel):
bl_label = "Proxy settings" bl_label = "Proxy settings"
bl_category = "Proxy" bl_category = "Proxy"

@ -1839,8 +1839,8 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
_defs_weight_paint.gradient, _defs_weight_paint.gradient,
None, None,
( (
_defs_weight_paint.sample_weight, _defs_weight_paint.sample_weight,
_defs_weight_paint.sample_weight_group, _defs_weight_paint.sample_weight_group,
), ),
None, None,
lambda context: ( lambda context: (

@ -1043,6 +1043,7 @@ class TOPBAR_PT_gpencil_primitive(Panel):
# Curve # Curve
layout.template_curve_mapping(settings, "thickness_primitive_curve", brush=True) layout.template_curve_mapping(settings, "thickness_primitive_curve", brush=True)
# Grease Pencil Fill # Grease Pencil Fill
class TOPBAR_PT_gpencil_fill(Panel): class TOPBAR_PT_gpencil_fill(Panel):
bl_space_type = 'VIEW_3D' bl_space_type = 'VIEW_3D'

@ -286,6 +286,7 @@ class USERPREF_PT_edit_objects(Panel):
def draw(self, context): def draw(self, context):
pass pass
class USERPREF_PT_edit_objects_new(PreferencePanel, Panel): class USERPREF_PT_edit_objects_new(PreferencePanel, Panel):
bl_label = "New Objects" bl_label = "New Objects"
bl_parent_id = "USERPREF_PT_edit_objects" bl_parent_id = "USERPREF_PT_edit_objects"
@ -383,6 +384,7 @@ class USERPREF_PT_edit_annotations(PreferencePanel, Panel):
flow.prop(edit, "grease_pencil_eraser_radius", text="Eraser Radius") flow.prop(edit, "grease_pencil_eraser_radius", text="Eraser Radius")
flow.prop(edit, "use_grease_pencil_simplify_stroke", text="Simplify Stroke") flow.prop(edit, "use_grease_pencil_simplify_stroke", text="Simplify Stroke")
class USERPREF_PT_edit_weight_paint(PreferencePanel, Panel): class USERPREF_PT_edit_weight_paint(PreferencePanel, Panel):
bl_label = "Weight Paint" bl_label = "Weight Paint"
bl_options = {'DEFAULT_CLOSED'} bl_options = {'DEFAULT_CLOSED'}

@ -213,6 +213,7 @@ class View3DPaintPanel(UnifiedPaintPanel):
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW' bl_region_type = 'WINDOW'
class VIEW3D_PT_tools_particlemode(Panel, View3DPaintPanel): class VIEW3D_PT_tools_particlemode(Panel, View3DPaintPanel):
bl_context = ".paint_common" # dot on purpose (access from topbar) bl_context = ".paint_common" # dot on purpose (access from topbar)
bl_label = "Particle tools" bl_label = "Particle tools"
@ -233,7 +234,7 @@ class VIEW3D_PT_tools_particlemode(Panel, View3DPaintPanel):
layout.use_property_split = True layout.use_property_split = True
layout.use_property_decorate = False # No animation. layout.use_property_decorate = False # No animation.
if tool != None: if tool is not None:
col = layout.column() col = layout.column()
col.prop(brush, "size", slider=True) col.prop(brush, "size", slider=True)
if tool == 'ADD': if tool == 'ADD':
@ -300,8 +301,9 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
brush_basic_sculpt_settings(col, context, brush) brush_basic_sculpt_settings(col, context, brush)
# topology_rake_factor # topology_rake_factor
if (capabilities.has_topology_rake and if (
context.sculpt_object.use_dynamic_topology_sculpting capabilities.has_topology_rake and
context.sculpt_object.use_dynamic_topology_sculpting
): ):
row = col.row() row = col.row()
row.prop(brush, "topology_rake_factor", slider=True) row.prop(brush, "topology_rake_factor", slider=True)