Commit: f04a173d7b5a7f1540ec64906e8314922300cd96 Author: YimingWu Date: Sun Aug 11 16:12:04 2019 +0800 Branches: temp-lanpr-staging https://developer.blender.org/rBf04a173d7b5a7f1540ec64906e8314922300cd96
Diff for adding LANPR only. =================================================================== M release/datafiles/locale M release/scripts/addons M release/scripts/addons_contrib M release/scripts/startup/bl_operators/__init__.py M release/scripts/startup/bl_operators/freestyle.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 M release/scripts/startup/bl_ui/properties_data_modifier.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/customdata.c M source/blender/blenkernel/intern/data_transfer.c M source/blender/blenkernel/intern/gpencil.c M source/blender/blenkernel/intern/scene.c M source/blender/blenlib/BLI_math_base.h M source/blender/blenlib/BLI_math_vector.h M source/blender/blenlib/intern/math_base_inline.c M source/blender/blenlib/intern/math_vector.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_cache_impl_mesh.c M source/blender/draw/intern/draw_common.c 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 M source/blender/editors/include/UI_resources.h M source/blender/editors/interface/resources.c 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_ops.c A source/blender/editors/lanpr/lanpr_util.c M source/blender/editors/mesh/editmesh_path.c M source/blender/editors/mesh/editmesh_select_similar.c M source/blender/editors/mesh/editmesh_tools.c M source/blender/editors/mesh/mesh_intern.h M source/blender/editors/mesh/mesh_ops.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/freestyle/intern/blender_interface/BlenderFileLoader.cpp M source/blender/makesdna/DNA_collection_types.h M source/blender/makesdna/DNA_customdata_types.h M source/blender/makesdna/DNA_gpencil_types.h A source/blender/makesdna/DNA_lanpr_types.h M source/blender/makesdna/DNA_material_types.h M source/blender/makesdna/DNA_meshdata_types.h M source/blender/makesdna/DNA_modifier_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_material.c M source/blender/makesrna/intern/rna_mesh.c M source/blender/makesrna/intern/rna_modifier.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 M source/blender/modifiers/CMakeLists.txt M source/blender/modifiers/MOD_modifiertypes.h M source/blender/modifiers/intern/MOD_edgesplit.c A source/blender/modifiers/intern/MOD_featureline.c M source/blender/modifiers/intern/MOD_util.c M source/blender/python/bmesh/bmesh_py_types_customdata.c M source/tools =================================================================== diff --git a/release/datafiles/locale b/release/datafiles/locale index 63f65770e67..ad82c4ce43e 160000 --- a/release/datafiles/locale +++ b/release/datafiles/locale @@ -1 +1 @@ -Subproject commit 63f65770e67f38db29f76ac910dd87bd9841b919 +Subproject commit ad82c4ce43ef2801ef51e75af1f9702992478b02 diff --git a/release/scripts/addons b/release/scripts/addons index 37a8bdc6616..8e6f485cf5b 160000 --- a/release/scripts/addons +++ b/release/scripts/addons @@ -1 +1 @@ -Subproject commit 37a8bdc661649cb6197e73b5eb96481cd5fb0c5e +Subproject commit 8e6f485cf5b160c425d7da7c743879b20f3d6a96 diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib index d9ed9d4d064..7077ff07384 160000 --- a/release/scripts/addons_contrib +++ b/release/scripts/addons_contrib @@ -1 +1 @@ -Subproject commit d9ed9d4d064c74c86e2767cd4be32d602a0ee317 +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/freestyle.py b/release/scripts/startup/bl_operators/freestyle.py index 3d619f97e6e..14456941eb8 100644 --- a/release/scripts/startup/bl_operators/freestyle.py +++ b/release/scripts/startup/bl_operators/freestyle.py @@ -148,7 +148,7 @@ class SCENE_OT_freestyle_add_edge_marks_to_keying_set(bpy.types.Operator): scene = context.scene ks = scene.keying_sets.active if ks is None: - ks = scene.keying_sets.new(idname="FreestyleEdgeMarkKeyingSet", name="Freestyle Edge Mark Keying Set") + ks = scene.keying_sets.new(idname="LanprEdgeMarkKeyingSet", name="Freestyle Edge Mark Keying Set") ks.bl_description = "" # add data paths to the keying set ob = context.active_object @@ -179,7 +179,7 @@ class SCENE_OT_freestyle_add_face_marks_to_keying_set(bpy.types.Operator): scene = context.scene ks = scene.keying_sets.active if ks is None: - ks = scene.keying_sets.new(idname="FreestyleFaceMarkKeyingSet", name="Freestyle Face Mark Keying Set") + ks = scene.keying_sets.new(idname="LanprFaceMarkKeyingSet", name="Freestyle Face Mark Keying Set") ks.bl_description = "" # add data paths to the keying set ob = context.active_object 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 44229b2afdf..3d3511e0035 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..94b2a1aabd8 --- /dev/null +++ b/release/scripts/startup/bl_ui/properties_collection.py @@ -0,0 +1,119 @@ +# ##### 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) + +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_begin',text="Level Begin") + col.prop(lanpr,'level_end',text="End") + else: + layout.prop(lanpr,'level_begin',text="Level") + + layout.prop(lanpr,'enable_contour') + layout.prop(lanpr,'enable_crease') + layout.prop(lanpr,'enable_mark') + layout.prop(lanpr,'enable_material') + layout.prop(lanpr,'enable_intersection') + + layout.prop(lanpr,'layer') + layout.prop(lanpr,'material') + + +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_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 1d1ee2e52be..396d0a5db88 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -20,6 +20,7 @@ import bpy from bpy.types import Panel from bpy.app.translations import pgettext_iface as iface_ +from mathutils import Vector class ModifierButtonsPanel: @@ -400,6 +401,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): split.prop(md, "use_edge_sharp", text="Sharp Edges") + layout.prop(md, "ignore_lanpr") + if md.ignore_lanpr: + layout.label(text="Enabeling edge split may cause problems in LANPR.") + def EXPLODE(self, layout, ob, md): split = layout.split() @@ -1641,6 +1646,12 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col.prop(m @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs