update addons (for 5.2)
This commit is contained in:
@@ -8,9 +8,9 @@ def update_sidebar_category(self, context):
|
||||
"""Change sidebar category of add-ons panel."""
|
||||
|
||||
panel_classes = [
|
||||
ui.VIEW3D_PT_boolean,
|
||||
ui.VIEW3D_PT_boolean_properties,
|
||||
ui.VIEW3D_PT_boolean_cutters,
|
||||
ui.panels.VIEW3D_PT_boolean,
|
||||
ui.panels.VIEW3D_PT_boolean_helpers,
|
||||
ui.panels.VIEW3D_PT_boolean_cutters,
|
||||
]
|
||||
|
||||
for cls in panel_classes:
|
||||
@@ -29,14 +29,22 @@ class BoolToolPreferences(bpy.types.AddonPreferences):
|
||||
bl_idname = __package__
|
||||
|
||||
# UI
|
||||
category: bpy.props.EnumProperty(
|
||||
name = "Category",
|
||||
items = (('ADDON', "Add-on", "General add-on features"),
|
||||
('SHARED', "Shared", "Features shared by all of add-ons operators and tools"),
|
||||
('OPERATORS', "Boolean Operators", "Features for brush and auto Boolean operators")),
|
||||
default = 'OPERATORS'
|
||||
)
|
||||
|
||||
show_in_sidebar: bpy.props.BoolProperty(
|
||||
name = "Show Addon Panel in Sidebar",
|
||||
name = "Show Add-on Panel in Sidebar",
|
||||
description = "Add a sidebar panel in 3D Viewport with add-ons operators and properties",
|
||||
default = True,
|
||||
)
|
||||
sidebar_category: bpy.props.StringProperty(
|
||||
name = "Category Name",
|
||||
description = "Sidebar category name. Using the name of the existing category will add panel there",
|
||||
description = "Sidebar category name. Using the name of the existing category will add the panel there",
|
||||
default = "Edit",
|
||||
update = update_sidebar_category,
|
||||
)
|
||||
@@ -44,87 +52,67 @@ class BoolToolPreferences(bpy.types.AddonPreferences):
|
||||
# Defaults
|
||||
solver: bpy.props.EnumProperty(
|
||||
name = "Boolean Solver",
|
||||
description = "Which solver to use for automatic and brush booleans",
|
||||
description = "Which solver to use for automatic and brush Boolean operators",
|
||||
items = [('FLOAT', "Float", ""),
|
||||
('EXACT', "Exact", ""),
|
||||
('MANIFOLD', "Manifold", "")],
|
||||
default = 'FLOAT',
|
||||
)
|
||||
wireframe: bpy.props.BoolProperty(
|
||||
name = "Display Cutters as Wireframe",
|
||||
description = ("When enabled cutters will be displayed as wireframes, instead of bounding boxes.\n"
|
||||
"It's better for visualizating the shape, but might be harder to see and have performance cost"),
|
||||
default = False,
|
||||
display: bpy.props.EnumProperty(
|
||||
name = "Cutter Display",
|
||||
items = (('WIRE', "Wire", "Display the cutter object as a wireframe"),
|
||||
('BOUNDS', "Bounds", "Display only the bounds of the cutter object")),
|
||||
default = 'BOUNDS'
|
||||
)
|
||||
show_in_editmode: bpy.props.BoolProperty(
|
||||
name = "Enable 'Show in Edit Mode' by Default",
|
||||
description = "Every new boolean modifier created with brush boolean wil have 'Show in Edit Mode' enabled by default",
|
||||
description = "Added Boolean modifiers will have 'Show in Edit Mode' enabled by default",
|
||||
default = True,
|
||||
)
|
||||
|
||||
# Advanced
|
||||
use_collection: bpy.props.BoolProperty(
|
||||
name = "Put Cutters in Collection",
|
||||
description = ("Brush boolean operators will put all cutters in same collection, and create one if it doesn't exist.\n"
|
||||
"Useful for scene management, and quickly selecting and removing all clutter when needed"),
|
||||
description = ("Put all cutters in the same collection, and create one if it doesn't exist"),
|
||||
default = True,
|
||||
)
|
||||
collection_name: bpy.props.StringProperty(
|
||||
name = "Collection Name",
|
||||
description = "Name of the collection where cutters will be added",
|
||||
default = "boolean_cutters",
|
||||
)
|
||||
parent: bpy.props.BoolProperty(
|
||||
name = "Parent Cutters to Object",
|
||||
description = ("Cutters will be parented to first canvas they're applied to. Works best when one cutter is used one canvas.\n"
|
||||
"NOTE: This doesn't affect Carver tool, which has its own property for this"),
|
||||
description = ("Cutters will be parented to first canvas they're applied to"),
|
||||
default = True,
|
||||
)
|
||||
apply_order: bpy.props.EnumProperty(
|
||||
name = "When Applying Cutters...",
|
||||
description = ("What happens when boolean cutters are applied on object.\n"
|
||||
"Either when performing auto-boolean, using 'Apply All Cutters' operator.\n"
|
||||
"NOTE: This doesn't apply to Carver tool on 'Destructive' mode; or when applying individual cutters"),
|
||||
items = (('ALL', "Apply All Modifiers", "All modifiers on object will be applied (this includes shape keys as well)"),
|
||||
('BEFORE', "Apply Booleans & Everything Before", "Alongside boolean modifiers all modifiers will be applied that come before the last boolean"),
|
||||
('BOOLEANS', "Only Apply Booleans", "Only apply boolean modifiers. This method will fail if object has shape keys")),
|
||||
name = "Apply Modifiers",
|
||||
description = ("Which modifiers to apply when using add-ons destructive operators.\n"
|
||||
"NOTE: This option is not used when applying individual cutters"),
|
||||
items = (('ALL', "All",
|
||||
"All modifiers on object (and shape keys) will be applied during destructive operators"),
|
||||
('BEFORE', "Booleans & Everything Before",
|
||||
"Apply all modifiers that come before the last Boolean modifier in the stack"),
|
||||
('BOOLEANS', "Booleans",
|
||||
"Only apply Boolean modifiers")),
|
||||
default = 'ALL',
|
||||
)
|
||||
pin: bpy.props.BoolProperty(
|
||||
name = "Pin Boolean Modifiers",
|
||||
description = ("When enabled boolean modifiers will be placed above every other modifier on the object (if there are any).\n"
|
||||
"Order of modifiers can drastically affect the result (especially when performing auto boolean).\n"
|
||||
"NOTE: This doesn't affect Carver tool, which has its own property for this"),
|
||||
description = ("Always make new Boolean modifiers first in the modifier stack.\n"
|
||||
"NOTE: Order of modifiers can drastically affect the final result"),
|
||||
default = False,
|
||||
)
|
||||
|
||||
# Features
|
||||
fast_modifier_apply: bpy.props.BoolProperty(
|
||||
name = "Faster Destructive Booleans",
|
||||
description = ("Experimental method of applying modifiers that results in 30-50% faster destructive booleans.\n"
|
||||
"Performance improvements also affect the add-ons operators that apply cutters.\n"
|
||||
description = ("Experimental method of applying modifiers that results in 30-50% faster destructive Booleans.\n"
|
||||
"However, changing modifier properties in the redo panel (like material transfer)\n"
|
||||
"is not available for this method yet."),
|
||||
default = False,
|
||||
)
|
||||
double_click: bpy.props.BoolProperty(
|
||||
name = "Double-click Select",
|
||||
description = ("Select boolean cutters by dbl-clicking on the boolean modifier.\n"
|
||||
"This feature works in entire modifier properties area, not just on boolean modifier header,\n"
|
||||
"therefore can result in lot of misclicks and unintended selections."),
|
||||
default = False,
|
||||
)
|
||||
|
||||
# Debug
|
||||
versioning: bpy.props.BoolProperty(
|
||||
name = "Versioning",
|
||||
description = ("Because of the drastic changes in add-on data, it's necessary to do versioning when loading old files\n"
|
||||
"where Bool Tool cutters(brushes) are not applied. If you don't have files like that, you can ignore this")
|
||||
)
|
||||
experimental: bpy.props.BoolProperty(
|
||||
name = "Experimental",
|
||||
description = "Enable experimental features",
|
||||
default = False,
|
||||
)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -132,55 +120,57 @@ class BoolToolPreferences(bpy.types.AddonPreferences):
|
||||
layout.use_property_decorate = False
|
||||
|
||||
# UI
|
||||
col = layout.column(align=True, heading="Show in Sidebar")
|
||||
row = col.row(align=True)
|
||||
sub = row.row(align=True)
|
||||
sub.prop(self, "show_in_sidebar", text="")
|
||||
sub = sub.row(align=True)
|
||||
sub.active = self.show_in_sidebar
|
||||
sub.prop(self, "sidebar_category", text="")
|
||||
|
||||
# Defaults
|
||||
row = layout.row()
|
||||
row.prop(self, "category", expand=True)
|
||||
layout.separator()
|
||||
col = layout.column(align=True)
|
||||
row = col.row(align=True)
|
||||
row.prop(self, "solver", text="Solver", expand=True)
|
||||
col.prop(self, "wireframe")
|
||||
col.prop(self, "show_in_editmode")
|
||||
|
||||
# Advanced
|
||||
layout.separator()
|
||||
col = layout.column(align=True, heading="Put Cutters in Collection")
|
||||
row = col.row(align=True)
|
||||
sub = row.row(align=True)
|
||||
sub.prop(self, "use_collection", text="")
|
||||
sub = sub.row(align=True)
|
||||
sub.active = self.show_in_sidebar
|
||||
sub.prop(self, "collection_name", text="")
|
||||
# Add-on Properties
|
||||
if self.category == 'ADDON':
|
||||
col = layout.column(align=True, heading="Show in Sidebar")
|
||||
row = col.row(align=True)
|
||||
sub = row.row(align=True)
|
||||
sub.prop(self, "show_in_sidebar", text="")
|
||||
sub = sub.row(align=True)
|
||||
sub.active = self.show_in_sidebar
|
||||
sub.prop(self, "sidebar_category", text="")
|
||||
|
||||
col.prop(self, "parent")
|
||||
col.prop(self, "apply_order")
|
||||
col.prop(self, "pin")
|
||||
col.separator()
|
||||
col = layout.column(align=True, heading="Features")
|
||||
col.prop(self, "fast_modifier_apply")
|
||||
|
||||
# Features
|
||||
layout.separator()
|
||||
col = layout.column(align=True, heading="Features")
|
||||
col.prop(self, "fast_modifier_apply")
|
||||
col.prop(self, "double_click")
|
||||
# Shared Properties
|
||||
if self.category == 'SHARED':
|
||||
col = layout.column()
|
||||
col.prop(self, "show_in_editmode")
|
||||
col.prop(self, "apply_order")
|
||||
|
||||
# Experimentals
|
||||
layout.separator()
|
||||
col = layout.column(align=True)
|
||||
col.prop(self, "versioning", text="⚠ Versioning")
|
||||
col.prop(self, "experimental", text="⚠ Experimental")
|
||||
# Boolean Operator Properties
|
||||
if self.category == 'OPERATORS':
|
||||
col = layout.column(align=True, heading="Put Cutters in Collection")
|
||||
row = col.row(align=True)
|
||||
sub = row.row(align=True)
|
||||
sub.prop(self, "use_collection", text="")
|
||||
sub = sub.row(align=True)
|
||||
sub.active = self.show_in_sidebar
|
||||
sub.prop(self, "collection_name", text="", placeholder="boolean_cutters")
|
||||
|
||||
col = layout.column()
|
||||
row = col.row(align=True)
|
||||
row.prop(self, "solver", text="Solver", expand=True)
|
||||
row = col.row(align=True)
|
||||
row.prop(self, "display", expand=True)
|
||||
|
||||
col = layout.column()
|
||||
col.prop(self, "parent")
|
||||
col.prop(self, "pin")
|
||||
|
||||
|
||||
|
||||
#### ------------------------------ REGISTRATION ------------------------------ ####
|
||||
|
||||
classes = [
|
||||
classes = (
|
||||
BoolToolPreferences,
|
||||
]
|
||||
)
|
||||
|
||||
def register():
|
||||
for cls in classes:
|
||||
|
||||
Reference in New Issue
Block a user