diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-03-23 04:28:35 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-03-23 04:41:45 +0300 |
commit | 80c86e274dca98177cfb44937c1f8a1b851ae4c9 (patch) | |
tree | 9dd3531d4764ef6bdda6f175c27e609612cf6bf8 /release | |
parent | b787581c9cda5a0cd4bc8b03bbdd1f9832438db4 (diff) |
Cleanup: move line art panel into properties_objects
No need for a module to define a single panel, since this is an
object panel it can be included with other object panels.
If centralizing line-art properties is needed in the future,
this can be done in a `*_common` module.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/__init__.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_lineart.py | 59 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_object.py | 24 |
3 files changed, 24 insertions, 61 deletions
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index 86c376bcb21..ef705f8fe37 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -105,8 +105,6 @@ import bpy if bpy.app.build_options.freestyle: _modules.append("properties_freestyle") -_modules.append("properties_lineart") - __import__(name=__name__, fromlist=_modules) _namespace = globals() _modules_loaded = [_namespace[name] for name in _modules] diff --git a/release/scripts/startup/bl_ui/properties_lineart.py b/release/scripts/startup/bl_ui/properties_lineart.py deleted file mode 100644 index 7c4d6c7be0b..00000000000 --- a/release/scripts/startup/bl_ui/properties_lineart.py +++ /dev/null @@ -1,59 +0,0 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -# <pep8 compliant> -from bpy.types import Panel - - -class LineartButtonsPanel: - bl_space_type = 'PROPERTIES' - bl_region_type = 'WINDOW' - bl_context = "object" - - -class OBJECT_PT_lineart(LineartButtonsPanel, Panel): - bl_label = "Line Art" - bl_options = {'DEFAULT_CLOSED'} - - @classmethod - def poll(cls, context): - ob = context.object - return (ob.type in {'MESH', 'FONT', 'CURVE', 'SURFACE'}) - - def draw(self, context): - layout = self.layout - lineart = context.object.lineart - - layout.use_property_split = True - - layout.prop(lineart, 'usage') - layout.use_property_split = True - - row = layout.row(heading="Override Crease") - row.prop(lineart, "use_crease_override", text="") - row.prop(lineart, "crease_threshold", slider=True, text="") - - -classes = ( - OBJECT_PT_lineart, -) - -if __name__ == "__main__": # only for live edit. - from bpy.utils import register_class - for cls in classes: - register_class(cls) diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py index 7101a78e18f..b74100aa570 100644 --- a/release/scripts/startup/bl_ui/properties_object.py +++ b/release/scripts/startup/bl_ui/properties_object.py @@ -308,6 +308,29 @@ class OBJECT_PT_instancing_size(ObjectButtonsPanel, Panel): layout.prop(ob, "instance_faces_scale", text="Factor") +class OBJECT_PT_lineart(ObjectButtonsPanel, Panel): + bl_label = "Line Art" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + ob = context.object + return (ob.type in {'MESH', 'FONT', 'CURVE', 'SURFACE'}) + + def draw(self, context): + layout = self.layout + lineart = context.object.lineart + + layout.use_property_split = True + + layout.prop(lineart, "usage") + layout.use_property_split = True + + row = layout.row(heading="Override Crease") + row.prop(lineart, "use_crease_override", text="") + row.prop(lineart, "crease_threshold", slider=True, text="") + + class OBJECT_PT_motion_paths(MotionPathButtonsPanel, Panel): #bl_label = "Object Motion Paths" bl_context = "object" @@ -393,6 +416,7 @@ classes = ( OBJECT_PT_motion_paths_display, OBJECT_PT_display, OBJECT_PT_visibility, + OBJECT_PT_lineart, OBJECT_PT_custom_props, ) |