[Bf-blender-cvs] [caab047f9c6] soc-2019-npr: LANPR: UI refactor: added script for object lanpr tab.

YimingWu noreply at git.blender.org
Wed Jul 24 11:11:11 CEST 2019


Commit: caab047f9c649e261cb0d8f0fa8fb06e0c1b1ca6
Author: YimingWu
Date:   Wed Jul 24 17:10:44 2019 +0800
Branches: soc-2019-npr
https://developer.blender.org/rBcaab047f9c649e261cb0d8f0fa8fb06e0c1b1ca6

LANPR: UI refactor: added script for object lanpr tab.

===================================================================

M	release/scripts/startup/bl_ui/__init__.py
A	release/scripts/startup/bl_ui/properties_lanpr.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py
index b11a6bfcc8f..3d3511e0035 100644
--- a/release/scripts/startup/bl_ui/__init__.py
+++ b/release/scripts/startup/bl_ui/__init__.py
@@ -66,6 +66,7 @@ _modules = [
     "properties_texture",
     "properties_world",
     "properties_collection",
+    "properties_lanpr",
 
     # Generic Space Modules
     #
diff --git a/release/scripts/startup/bl_ui/properties_lanpr.py b/release/scripts/startup/bl_ui/properties_lanpr.py
new file mode 100644
index 00000000000..21da841f195
--- /dev/null
+++ b/release/scripts/startup/bl_ui/properties_lanpr.py
@@ -0,0 +1,59 @@
+# ##### 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
+from bpy import data
+from mathutils import Vector
+
+
+class LanprButtonsPanel:
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "lanpr"
+    # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
+
+    @classmethod
+    def poll(cls, context):
+        return (context.engine in cls.COMPAT_ENGINES)
+
+
+class OBJECT_PT_lanpr_settings(LanprButtonsPanel, Panel):
+    bl_label = "Object LANPR Settings"
+
+    @classmethod
+    def poll(cls, context):
+        return context.scene.render.engine == 'BLENDER_LANPR' or context.scene.lanpr.enabled
+
+    def draw(self,context):
+        layout = self.layout
+        collection = context.collection
+        lanpr = collection.lanpr
+        ob = context.object
+
+        layout.label(text="Waiting to be implemented")
+
+
+classes = (
+    OBJECT_PT_lanpr_settings,
+)
+
+if __name__ == "__main__":  # only for live edit.
+    from bpy.utils import register_class
+    for cls in classes:
+        register_class(cls)



More information about the Bf-blender-cvs mailing list