[Bf-blender-cvs] [e7c4c28421e] temp-lanpr-cleanup: LANPR: Clean patch without freestyle changes.

YimingWu noreply at git.blender.org
Thu Sep 12 09:42:53 CEST 2019


Commit: e7c4c28421ed22cbd178b922c55166e10d9a1505
Author: YimingWu
Date:   Thu Sep 12 15:30:37 2019 +0800
Branches: temp-lanpr-cleanup
https://developer.blender.org/rBe7c4c28421ed22cbd178b922c55166e10d9a1505

LANPR: Clean patch without freestyle changes.

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

M	release/datafiles/locale
M	release/scripts/addons
M	release/scripts/addons_contrib
M	release/scripts/startup/bl_operators/__init__.py
A	release/scripts/startup/bl_operators/lanpr.py
M	release/scripts/startup/bl_ui/__init__.py
A	release/scripts/startup/bl_ui/properties_collection.py
A	release/scripts/startup/bl_ui/properties_lanpr.py
M	release/scripts/startup/bl_ui/properties_material.py
M	release/scripts/startup/bl_ui/properties_render.py
M	release/scripts/startup/bl_ui/space_view3d.py
M	source/blender/blenkernel/BKE_gpencil.h
M	source/blender/blenkernel/BKE_scene.h
M	source/blender/blenkernel/intern/gpencil.c
M	source/blender/blenkernel/intern/library_query.c
M	source/blender/blenkernel/intern/scene.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/draw/CMakeLists.txt
A	source/blender/draw/engines/lanpr/lanpr_all.h
A	source/blender/draw/engines/lanpr/lanpr_chain_draw.c
A	source/blender/draw/engines/lanpr/lanpr_cpu.c
A	source/blender/draw/engines/lanpr/lanpr_dpix.c
A	source/blender/draw/engines/lanpr/lanpr_engine.c
A	source/blender/draw/engines/lanpr/lanpr_snake.c
A	source/blender/draw/engines/lanpr/shaders/lanpr_dpix_preview_frag.glsl
A	source/blender/draw/engines/lanpr/shaders/lanpr_dpix_preview_geom.glsl
A	source/blender/draw/engines/lanpr/shaders/lanpr_dpix_project_clip_frag.glsl
A	source/blender/draw/engines/lanpr/shaders/lanpr_dpix_project_passthrough_vert.glsl
A	source/blender/draw/engines/lanpr/shaders/lanpr_snake_edge_frag.glsl
A	source/blender/draw/engines/lanpr/shaders/lanpr_snake_image_peel_frag.glsl
A	source/blender/draw/engines/lanpr/shaders/lanpr_snake_line_connection_frag.glsl
A	source/blender/draw/engines/lanpr/shaders/lanpr_snake_line_connection_geom.glsl
A	source/blender/draw/engines/lanpr/shaders/lanpr_snake_line_connection_vert.glsl
A	source/blender/draw/engines/lanpr/shaders/lanpr_snake_multichannel_frag.glsl
A	source/blender/draw/engines/lanpr/shaders/lanpr_software_chain_geom.glsl
A	source/blender/draw/engines/lanpr/shaders/lanpr_software_line_chain_geom.glsl
A	source/blender/draw/engines/lanpr/shaders/lanpr_software_passthrough_vert.glsl
M	source/blender/draw/intern/DRW_render.h
M	source/blender/draw/intern/draw_manager.c
M	source/blender/draw/intern/draw_manager_texture.c
M	source/blender/editors/CMakeLists.txt
A	source/blender/editors/include/ED_lanpr.h
A	source/blender/editors/lanpr/CMakeLists.txt
A	source/blender/editors/lanpr/lanpr_chain.c
A	source/blender/editors/lanpr/lanpr_cpu.c
A	source/blender/editors/lanpr/lanpr_intern.h
A	source/blender/editors/lanpr/lanpr_ops.c
A	source/blender/editors/lanpr/lanpr_util.c
M	source/blender/editors/render/render_update.c
M	source/blender/editors/space_api/spacetypes.c
M	source/blender/editors/space_buttons/buttons_context.c
M	source/blender/editors/space_buttons/space_buttons.c
M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/makesdna/DNA_collection_types.h
M	source/blender/makesdna/DNA_gpencil_types.h
A	source/blender/makesdna/DNA_lanpr_types.h
M	source/blender/makesdna/DNA_object_types.h
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesdna/intern/makesdna.c
M	source/blender/makesrna/RNA_access.h
M	source/blender/makesrna/intern/CMakeLists.txt
M	source/blender/makesrna/intern/makesrna.c
M	source/blender/makesrna/intern/rna_collection.c
M	source/blender/makesrna/intern/rna_internal.h
A	source/blender/makesrna/intern/rna_lanpr.c
M	source/blender/makesrna/intern/rna_object.c
M	source/blender/makesrna/intern/rna_scene.c
M	source/blender/makesrna/intern/rna_space.c
A	source/blender/modifiers/intern/MOD_featureline.c
M	source/tools

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

diff --git a/release/datafiles/locale b/release/datafiles/locale
index 1f6ec7f7a14..ad82c4ce43e 160000
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 1f6ec7f7a145c36808231090c8666febb49db220
+Subproject commit ad82c4ce43ef2801ef51e75af1f9702992478b02
diff --git a/release/scripts/addons b/release/scripts/addons
index eb9bab0e715..8e6f485cf5b 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit eb9bab0e7153fda8de113af9e3c54eca74c986ef
+Subproject commit 8e6f485cf5b160c425d7da7c743879b20f3d6a96
diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib
index 23b744fa47d..7077ff07384 160000
--- a/release/scripts/addons_contrib
+++ b/release/scripts/addons_contrib
@@ -1 +1 @@
-Subproject commit 23b744fa47da73c0b6c5b41b02cfe0efa008ec5c
+Subproject commit 7077ff07384491d1f7630484995557f1c7302dae
diff --git a/release/scripts/startup/bl_operators/__init__.py b/release/scripts/startup/bl_operators/__init__.py
index bb92e070d00..3cdded79fd2 100644
--- a/release/scripts/startup/bl_operators/__init__.py
+++ b/release/scripts/startup/bl_operators/__init__.py
@@ -32,6 +32,7 @@ _modules = [
     "constraint",
     "file",
     "image",
+    "lanpr",
     "mask",
     "mesh",
     "node",
diff --git a/release/scripts/startup/bl_operators/lanpr.py b/release/scripts/startup/bl_operators/lanpr.py
new file mode 100644
index 00000000000..8cdf0842ae7
--- /dev/null
+++ b/release/scripts/startup/bl_operators/lanpr.py
@@ -0,0 +1,41 @@
+# ##### 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>
+
+import bpy
+import string
+
+class LANPR_reset_object_transfromations(bpy.types.Operator):
+    """Reset Transformations"""
+    bl_idname = "lanpr.reset_object_transfromations"
+    bl_label = "Reset Transformations"
+
+    obj = bpy.props.StringProperty(name="Target Object")
+    
+    def execute(self, context):
+        print(self.obj)
+        ob = bpy.data.objects[self.obj]
+        ob.location.zero()
+        ob.rotation_euler.zero()
+        ob.scale.xyz=[1,1,1]
+        return {'FINISHED'}
+
+classes=(
+    LANPR_reset_object_transfromations,
+)
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py
index 5daacbb2e44..a4096741b4c 100644
--- a/release/scripts/startup/bl_ui/__init__.py
+++ b/release/scripts/startup/bl_ui/__init__.py
@@ -65,6 +65,8 @@ _modules = [
     "properties_scene",
     "properties_texture",
     "properties_world",
+    "properties_collection",
+    "properties_lanpr",
 
     # Generic Space Modules
     #
diff --git a/release/scripts/startup/bl_ui/properties_collection.py b/release/scripts/startup/bl_ui/properties_collection.py
new file mode 100644
index 00000000000..aab7d3be9cb
--- /dev/null
+++ b/release/scripts/startup/bl_ui/properties_collection.py
@@ -0,0 +1,129 @@
+# ##### 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 CollectionButtonsPanel:
+    bl_space_type = 'PROPERTIES'
+    bl_region_type = 'WINDOW'
+    bl_context = "collection"
+    # 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)
+
+
+def lanpr_make_line_type_entry(col, line_type, text_disp, expand, search_from):
+    col.prop(line_type, "use", text=text_disp)
+    if expand:
+        col.prop_search(line_type, "layer", search_from, "layers")
+        col.prop_search(line_type, "material",  search_from, "materials")
+
+class COLLECTION_PT_collection_flags(CollectionButtonsPanel, Panel):
+    bl_label = "Collection Flags"
+
+    def draw(self, context):
+        layout=self.layout
+        collection=context.collection
+        vl = context.view_layer
+        vlc = vl.active_layer_collection
+        if vlc.name == 'Master Collection':
+            row = layout.row()
+            row.label(text="This is the master collection")
+            return
+        
+        row = layout.row()
+        col = row.column(align=True)
+        col.prop(vlc,"hide_viewport")
+        col.prop(vlc,"holdout")
+        col.prop(vlc,"indirect_only")
+        row = layout.row()
+        col = row.column(align=True)
+        col.prop(collection,"hide_select")
+        col.prop(collection,"hide_viewport")
+        col.prop(collection,"hide_render")
+
+def is_unit_transformation(ob):
+    if ob.scale.xyz==Vector((1,1,1)) and ob.location.xyz==Vector((0,0,0)) and \
+        ob.rotation_euler.x == 0.0 and ob.rotation_euler.y == 0.0 and ob.rotation_euler.z == 0.0:
+        return True
+    return False
+
+
+class COLLECTION_PT_lanpr_collection(CollectionButtonsPanel, Panel):
+    bl_label = "Collection LANPR"
+
+    @classmethod
+    def poll(cls, context):
+        return context.scene.render.engine == 'BLENDER_LANPR' or context.scene.lanpr.enabled
+
+    def draw(self,context):
+        layout = self.layout
+        layout.use_property_split = True
+        layout.use_property_decorate = False
+        collection = context.collection
+        lanpr = collection.lanpr
+        row = layout.row()
+        row.prop(lanpr,"usage")
+        if lanpr.usage!='INCLUDE':
+            layout.prop(lanpr,"force")
+        else:
+            layout.prop(lanpr,"target")
+            
+            if lanpr.target:
+
+                if not is_unit_transformation(lanpr.target):
+                    layout.label(text = "Target GP has self transformations.")
+                    layout.operator("lanpr.reset_object_transfromations").obj=lanpr.target.name
+
+                layout.prop(lanpr,'use_multiple_levels', text="Multiple Levels")
+                
+                if lanpr.use_multiple_levels:
+                    col = layout.column(align=True)
+                    col.prop(lanpr,'level_start',text="Level Begin")
+                    col.prop(lanpr,'level_end',text="End")
+                else:
+                    layout.prop(lanpr,'level_start',text="Level")
+                
+                layout.prop(lanpr, "use_same_style")
+
+                if lanpr.use_same_style:
+                    layout.prop_search(lanpr, 'target_layer', lanpr.target.data, "layers", icon='GREASEPENCIL')
+                    layout.prop_search(lanpr, 'target_material', lanpr.target.data, "materials", icon='SHADING_TEXTURE')
+
+                expand = not lanpr.use_same_style
+                lanpr_make_line_type_entry(layout, lanpr.contour, "Contour", expand, lanpr.target.data)
+                lanpr_make_line_type_entry(layout, lanpr.crease, "Crease", expand, lanpr.target.data)
+                lanpr_make_line_type_entry(layout, lanpr.material, "Material", expand, lanpr.target.data)
+                lanpr_make_line_type_entry(layout, lanpr.edge_mark, "Edge Mark", expand, lanpr.target.data)
+                lanpr_make_line_type_entry(layout, lanpr.intersection, "Intersection", expand, lanpr.target.data)
+
+classes = (
+    COLLECTION_PT_collection_flags,
+    COLLECTION_PT_lanpr_collection,
+)
+
+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_lanpr.py b/release/scripts/startup/bl_ui/properties_lanpr.py
new file mode 100644
index 00000000000..22f969cd894
--- /dev/null
+++ b/release/scripts/startup/bl_ui/properties_lanpr.py
@@ -0,0 +1,105 @@
+# ##### 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(

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list