[Bf-blender-cvs] [80c86e274dc] master: Cleanup: move line art panel into properties_objects
Campbell Barton
noreply at git.blender.org
Tue Mar 23 02:42:27 CET 2021
Commit: 80c86e274dca98177cfb44937c1f8a1b851ae4c9
Author: Campbell Barton
Date: Tue Mar 23 12:28:35 2021 +1100
Branches: master
https://developer.blender.org/rB80c86e274dca98177cfb44937c1f8a1b851ae4c9
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.
===================================================================
M release/scripts/startup/bl_ui/__init__.py
D release/scripts/startup/bl_ui/properties_lineart.py
M release/scripts/startup/bl_ui/properties_object.py
===================================================================
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,
)
More information about the Bf-blender-cvs
mailing list