diff options
813 files changed, 4517 insertions, 12476 deletions
diff --git a/add_camera_rigs/__init__.py b/add_camera_rigs/__init__.py index 7f4accee..878d4555 100644 --- a/add_camera_rigs/__init__.py +++ b/add_camera_rigs/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Add Camera Rigs", diff --git a/add_camera_rigs/build_rigs.py b/add_camera_rigs/build_rigs.py index 9acce660..94848361 100644 --- a/add_camera_rigs/build_rigs.py +++ b/add_camera_rigs/build_rigs.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.types import Operator diff --git a/add_camera_rigs/composition_guides_menu.py b/add_camera_rigs/composition_guides_menu.py index 16537525..c689929b 100644 --- a/add_camera_rigs/composition_guides_menu.py +++ b/add_camera_rigs/composition_guides_menu.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.types import Panel diff --git a/add_camera_rigs/create_widgets.py b/add_camera_rigs/create_widgets.py index 4aeea272..1f14dfab 100644 --- a/add_camera_rigs/create_widgets.py +++ b/add_camera_rigs/create_widgets.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from mathutils import Vector diff --git a/add_camera_rigs/operators.py b/add_camera_rigs/operators.py index 058ed146..646566ae 100644 --- a/add_camera_rigs/operators.py +++ b/add_camera_rigs/operators.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.types import Operator diff --git a/add_camera_rigs/prefs.py b/add_camera_rigs/prefs.py index 465c42a6..aaa4ea25 100644 --- a/add_camera_rigs/prefs.py +++ b/add_camera_rigs/prefs.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later from bpy.types import AddonPreferences from bpy.props import StringProperty diff --git a/add_camera_rigs/ui_panels.py b/add_camera_rigs/ui_panels.py index 0dc3c69e..c6066147 100644 --- a/add_camera_rigs/ui_panels.py +++ b/add_camera_rigs/ui_panels.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.types import Panel diff --git a/add_curve_extra_objects/__init__.py b/add_curve_extra_objects/__init__.py index 22910bf9..1e8406b8 100644 --- a/add_curve_extra_objects/__init__.py +++ b/add_curve_extra_objects/__init__.py @@ -1,20 +1,5 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later # -# 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 ##### # Contributed to by: # testscreenings, Alejandro Omar Chocano Vasquez, Jimmy Hazevoet, meta-androcto # Cmomoney, Jared Forsyth, Adam Newgas, Spivak Vladimir, Jared Forsyth, Atom diff --git a/add_curve_extra_objects/add_curve_aceous_galore.py b/add_curve_extra_objects/add_curve_aceous_galore.py index 42239d7a..f53b4d97 100644 --- a/add_curve_extra_objects/add_curve_aceous_galore.py +++ b/add_curve_extra_objects/add_curve_aceous_galore.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later """ bl_info = { diff --git a/add_curve_extra_objects/add_curve_braid.py b/add_curve_extra_objects/add_curve_braid.py index ba32b563..32e8894c 100644 --- a/add_curve_extra_objects/add_curve_braid.py +++ b/add_curve_extra_objects/add_curve_braid.py @@ -1,4 +1,4 @@ -# gpl: author Jared Forsyth <github.com/jaredly> +# SPDX-License-Identifier: GPL-2.0-or-later """ bl_info = { diff --git a/add_curve_extra_objects/add_curve_celtic_links.py b/add_curve_extra_objects/add_curve_celtic_links.py index 663f8b7e..d6b777de 100644 --- a/add_curve_extra_objects/add_curve_celtic_links.py +++ b/add_curve_extra_objects/add_curve_celtic_links.py @@ -1,26 +1,7 @@ +# SPDX-License-Identifier: MIT +# Copyright 2013 Adam Newgas + # Blender plugin for generating celtic knot curves from 3d meshes -# -# The MIT License (MIT) -# -# Copyright (c) 2013 Adam Newgas -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. bl_info = { "name": "Celtic Knot", diff --git a/add_curve_extra_objects/add_curve_curly.py b/add_curve_extra_objects/add_curve_curly.py index 5d07a149..af02f115 100644 --- a/add_curve_extra_objects/add_curve_curly.py +++ b/add_curve_extra_objects/add_curve_curly.py @@ -1,4 +1,4 @@ -# gpl: author Cmomoney +# SPDX-License-Identifier: GPL-2.0-or-later # DevBo Task https://developer.blender.org/T37299 diff --git a/add_curve_extra_objects/add_curve_simple.py b/add_curve_extra_objects/add_curve_simple.py index c69f1e90..7b6ed6ed 100644 --- a/add_curve_extra_objects/add_curve_simple.py +++ b/add_curve_extra_objects/add_curve_simple.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Simple Curve", diff --git a/add_curve_extra_objects/add_curve_spirals.py b/add_curve_extra_objects/add_curve_spirals.py index f3c5a074..25a217a7 100644 --- a/add_curve_extra_objects/add_curve_spirals.py +++ b/add_curve_extra_objects/add_curve_spirals.py @@ -1,4 +1,4 @@ -# gpl: author Alejandro Omar Chocano Vasquez +# SPDX-License-Identifier: GPL-2.0-or-later """ bl_info = { diff --git a/add_curve_extra_objects/add_curve_spirofit_bouncespline.py b/add_curve_extra_objects/add_curve_spirofit_bouncespline.py index f2151ee4..044d1761 100644 --- a/add_curve_extra_objects/add_curve_spirofit_bouncespline.py +++ b/add_curve_extra_objects/add_curve_spirofit_bouncespline.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { diff --git a/add_curve_extra_objects/add_curve_torus_knots.py b/add_curve_extra_objects/add_curve_torus_knots.py index 8dac754d..891754c5 100644 --- a/add_curve_extra_objects/add_curve_torus_knots.py +++ b/add_curve_extra_objects/add_curve_torus_knots.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later """ bl_info = { diff --git a/add_curve_extra_objects/add_surface_plane_cone.py b/add_curve_extra_objects/add_surface_plane_cone.py index 47771051..4f86a0c3 100644 --- a/add_curve_extra_objects/add_surface_plane_cone.py +++ b/add_curve_extra_objects/add_surface_plane_cone.py @@ -1,4 +1,4 @@ -# gpl: author Folkert de Vries +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Surface: Plane / Cone/ Star / Wedge", diff --git a/add_curve_extra_objects/beveltaper_curve.py b/add_curve_extra_objects/beveltaper_curve.py index 476f8e4e..798b1fbb 100644 --- a/add_curve_extra_objects/beveltaper_curve.py +++ b/add_curve_extra_objects/beveltaper_curve.py @@ -1,19 +1,4 @@ -# ##### 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 3 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, see <http://www.gnu.org/licenses/>. -# -# ##### END GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later # DevBo Task: https://developer.blender.org/T37377 diff --git a/add_curve_ivygen.py b/add_curve_ivygen.py index d67225eb..9bd08a15 100644 --- a/add_curve_ivygen.py +++ b/add_curve_ivygen.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> diff --git a/add_curve_sapling/__init__.py b/add_curve_sapling/__init__.py index 6756797b..bead5ee7 100644 --- a/add_curve_sapling/__init__.py +++ b/add_curve_sapling/__init__.py @@ -1,21 +1,4 @@ -# -*- coding: utf-8 -*- -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Sapling Tree Gen", @@ -199,7 +182,10 @@ class ImportData(Operator): f = open(os.path.join(getPresetpaths()[0], self.filename), 'r') except (FileNotFoundError, IOError): f = open(os.path.join(getPresetpaths()[1], self.filename), 'r') - settings = f.readline() + # Find the first non-comment, non-blank line, this must contain preset text (all on one line). + for settings in f: + if settings and (not settings.startswith("#")): + break f.close() # print(settings) settings = ast.literal_eval(settings) diff --git a/add_curve_sapling/presets/callistemon.py b/add_curve_sapling/presets/callistemon.py index 7b0ea8e3..cfd1a742 100644 --- a/add_curve_sapling/presets/callistemon.py +++ b/add_curve_sapling/presets/callistemon.py @@ -1 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-or-later {'handleType': '0', 'rotate': (99.5, 137.5, 137.5, 137.5), 'baseSize_s': 0.1600000560283661, 'af2': 1.0, 'pruneRatio': 0.75, 'radiusTweak': (1.0, 1.0, 1.0, 1.0), 'pruneWidthPeak': 0.5, 'boneStep': (1, 1, 1, 1), 'nrings': 0, 'leafScale': 0.4000000059604645, 'makeMesh': False, 'baseSize': 0.30000001192092896, 'lengthV': (0.0, 0.10000000149011612, 0.0, 0.0), 'shapeS': '10', 'pruneBase': 0.11999999731779099, 'af3': 4.0, 'loopFrames': 0, 'horzLeaves': True, 'curveRes': (8, 5, 3, 1), 'minRadius': 0.001500000013038516, 'leafDist': '6', 'rotateV': (15.0, 0.0, 0.0, 0.0), 'bevel': True, 'curveBack': (0.0, 0.0, 0.0, 0.0), 'leafScaleV': 0.15000000596046448, 'prunePowerHigh': 0.5, 'rootFlare': 1.0, 'prune': False, 'branches': (0, 55, 10, 1), 'taperCrown': 0.5, 'useArm': False, 'splitBias': 0.5499999523162842, 'segSplits': (0.10000000149011612, 0.5, 0.20000000298023224, 0.0), 'resU': 4, 'useParentAngle': True, 'ratio': 0.014999999664723873, 'taper': (1.0, 1.0, 1.0, 1.0), 'length': (0.800000011920929, 0.6000000238418579, 0.5, 0.10000000149011612), 'scale0': 1.0, 'scaleV': 2.0, 'leafRotate': 137.5, 'shape': '7', 'scaleV0': 0.10000000149011612, 'leaves': 150, 'scale': 5.0, 'leafShape': 'hex', 'prunePowerLow': 0.0010000000474974513, 'splitAngle': (18.0, 18.0, 22.0, 0.0), 'seed': 0, 'showLeaves': True, 'downAngle': (0.0, 26.209999084472656, 52.55999755859375, 30.0), 'leafDownAngle': 30.0, 'autoTaper': True, 'rMode': 'rotate', 'leafScaleX': 0.20000000298023224, 'leafScaleT': 0.10000000149011612, 'gust': 1.0, 'armAnim': False, 'wind': 1.0, 'leafRotateV': 15.0, 'baseSplits': 3, 'attractOut': (0.0, 0.800000011920929, 0.0, 0.0), 'armLevels': 2, 'leafAnim': False, 'ratioPower': 1.2000000476837158, 'splitHeight': 0.20000000298023224, 'splitByLen': True, 'af1': 1.0, 'branchDist': 1.5, 'closeTip': False, 'previewArm': False, 'attractUp': (3.5, -1.899843692779541, 0.0, 0.0), 'bevelRes': 1, 'pruneWidth': 0.3400000035762787, 'gustF': 0.07500000298023224, 'leafangle': -12.0, 'curveV': (20.0, 50.0, 75.0, 0.0), 'useOldDownAngle': True, 'leafDownAngleV': -10.0, 'frameRate': 1.0, 'splitAngleV': (5.0, 5.0, 5.0, 0.0), 'levels': 2, 'downAngleV': (0.0, 10.0, 10.0, 10.0), 'customShape': (0.5, 1.0, 0.30000001192092896, 0.5), 'curve': (0.0, -15.0, 0.0, 0.0)} diff --git a/add_curve_sapling/presets/douglas_fir.py b/add_curve_sapling/presets/douglas_fir.py index c9f01632..64f8cea2 100644 --- a/add_curve_sapling/presets/douglas_fir.py +++ b/add_curve_sapling/presets/douglas_fir.py @@ -1 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-or-later {'pruneRatio': 1.0, 'wind': 1.0, 'prune': False, 'splitByLen': True, 'attractUp': (0.0, 0.3499999940395355, 0.25, 0.15000000596046448), 'segSplits': (0.0, 0.3499999940395355, 0.6000000238418579, 0.0), 'rMode': 'rotate', 'rotate': (99.5, 137.5, -45.0, -60.0), 'curve': (0.0, 20.0, -10.0, 0.0), 'af2': 1.0, 'seed': 0, 'length': (1.0, 0.20000000298023224, 0.550000011920929, 0.44999998807907104), 'attractOut': (0.0, 0.0, 0.0, 0.0), 'leafScaleT': 0.0, 'scaleV': 15.0, 'splitHeight': 0.20000000298023224, 'minRadius': 0.0020000000949949026, 'leafRotate': 137.5, 'curveRes': (12, 4, 3, 2), 'curveV': (40.0, 30.0, 15.0, 10.0), 'nrings': 0, 'levels': 4, 'frameRate': 1.0, 'ratioPower': 1.2000000476837158, 'leafDownAngle': 45.0, 'armLevels': 2, 'branches': (0, 75, 16, 10), 'splitAngleV': (0.0, 0.0, 0.0, 0.0), 'shape': '8', 'rotateV': (15.0, 0.0, 15.0, 45.0), 'loopFrames': 0, 'curveBack': (0.0, 0.0, 0.0, 0.0), 'taperCrown': 0.0, 'prunePowerLow': 0.0010000000474974513, 'handleType': '0', 'af3': 4.0, 'useParentAngle': True, 'customShape': (0.5, 1.0, 0.3499999940395355, 0.10000000149011612), 'scale0': 1.0, 'rootFlare': 1.2999999523162842, 'leafScaleV': 0.0, 'leafScale': 0.17000000178813934, 'leafangle': 0.0, 'scaleV0': 0.10000000149011612, 'downAngleV': (0.0, 30.0, 10.0, 10.0), 'af1': 1.0, 'autoTaper': True, 'scale': 35.0, 'gustF': 0.07500000298023224, 'ratio': 0.014999999664723873, 'leafScaleX': 1.0, 'shapeS': '7', 'bevelRes': 1, 'bevel': True, 'leaves': 25, 'splitAngle': (0.0, 12.0, 18.0, 0.0), 'downAngle': (90.0, 130.0, 45.0, 45.0), 'previewArm': False, 'radiusTweak': (1.0, 1.0, 1.0, 1.0), 'showLeaves': False, 'leafAnim': False, 'baseSize': 0.33000001311302185, 'gust': 1.0, 'horzLeaves': True, 'baseSize_s': 0.5, 'leafDownAngleV': 10.0, 'makeMesh': False, 'leafDist': '6', 'armAnim': False, 'baseSplits': 0, 'lengthV': (0.0, 0.10000000149011612, 0.25, 0.25), 'branchDist': 1.850000023841858, 'useArm': False, 'useOldDownAngle': False, 'taper': (1.0, 1.0, 1.0, 1.0), 'pruneBase': 0.30000001192092896, 'splitBias': 0.0, 'boneStep': (1, 1, 1, 1), 'leafShape': 'hex', 'resU': 4, 'prunePowerHigh': 0.5, 'closeTip': True, 'pruneWidth': 0.4000000059604645, 'leafRotateV': 0.0, 'pruneWidthPeak': 0.6000000238418579} diff --git a/add_curve_sapling/presets/japanese_maple.py b/add_curve_sapling/presets/japanese_maple.py index af2c1413..c191d57f 100644 --- a/add_curve_sapling/presets/japanese_maple.py +++ b/add_curve_sapling/presets/japanese_maple.py @@ -1 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-or-later {'leafScaleT': -0.5, 'shapeS': '10', 'scaleV': 2.0, 'resU': 4, 'boneStep': (1, 1, 1, 1), 'af3': 4.0, 'baseSize': 0.4000000059604645, 'prunePowerLow': 0.0010000000474974513, 'leafRotateV': 0.0, 'rootFlare': 1.0, 'customShape': (0.699999988079071, 1.0, 0.20000000298023224, 0.800000011920929), 'attractOut': (0.0, 0.75, 0.25, 0.0), 'useArm': False, 'branches': (0, 50, 10, 16), 'leafDownAngle': 45.0, 'length': (1.0, 0.30000001192092896, 0.5, 0.20000000298023224), 'segSplits': (0.25, 0.4000000059604645, 0.5, 0.0), 'makeMesh': False, 'curveV': (400.0, 150.0, 100.0, 0.0), 'curveBack': (0.0, 0.0, 0.0, 0.0), 'af1': 1.0, 'closeTip': False, 'frameRate': 1.0, 'leafangle': -10.0, 'af2': 1.0, 'rMode': 'rotate', 'leafScaleV': 0.0, 'rotateV': (15.0, 0.0, 0.0, 0.0), 'useParentAngle': False, 'taperCrown': 0.0, 'minRadius': 0.001500000013038516, 'splitAngleV': (5.0, 5.0, 0.0, 0.0), 'scaleV0': 0.10000000149011612, 'bevel': True, 'leafDownAngleV': 10.0, 'previewArm': False, 'showLeaves': True, 'ratioPower': 1.25, 'handleType': '0', 'branchDist': 1.0, 'leafScaleX': 0.20000000298023224, 'prune': False, 'splitHeight': 0.30000001192092896, 'baseSplits': 2, 'baseSize_s': 0.25, 'downAngle': (90.0, 90.0, 30.0, 30.0), 'bevelRes': 1, 'leafAnim': False, 'loopFrames': 0, 'lengthV': (0.0, 0.0, 0.0, 0.0), 'gust': 1.0, 'downAngleV': (0.0, 90.0, 15.0, 10.0), 'leafRotate': 137.5, 'wind': 1.0, 'leaves': -5, 'curve': (0.0, -20.0, -20.0, 0.0), 'radiusTweak': (1.0, 1.0, 1.0, 1.0), 'pruneRatio': 1.0, 'pruneBase': 0.30000001192092896, 'armAnim': False, 'splitBias': 0.0, 'rotate': (99.5, 137.5, 137.5, 137.5), 'armLevels': 2, 'scale': 6.0, 'prunePowerHigh': 0.5, 'nrings': 0, 'splitByLen': True, 'leafShape': 'hex', 'splitAngle': (15.0, 20.0, 25.0, 0.0), 'ratio': 0.019999999552965164, 'scale0': 1.0, 'autoTaper': True, 'pruneWidth': 0.4000000059604645, 'leafScale': 0.17000000178813934, 'seed': 0, 'curveRes': (16, 5, 3, 1), 'horzLeaves': True, 'useOldDownAngle': False, 'levels': 4, 'pruneWidthPeak': 0.6000000238418579, 'attractUp': (0.0, -0.3499999940395355, -0.20000000298023224, 0.0), 'taper': (1.0, 1.0, 1.0, 1.0), 'leafDist': '6', 'gustF': 0.07500000298023224, 'shape': '8'} diff --git a/add_curve_sapling/presets/quaking_aspen.py b/add_curve_sapling/presets/quaking_aspen.py index 70e0a80b..8abea9c3 100644 --- a/add_curve_sapling/presets/quaking_aspen.py +++ b/add_curve_sapling/presets/quaking_aspen.py @@ -1 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-or-later {'leafScale': 0.17000000178813934, 'autoTaper': True, 'customShape': (0.5, 1.0, 0.30000001192092896, 0.5), 'leafShape': 'hex', 'curve': (0.0, -40.0, -40.0, 0.0), 'ratio': 0.014999999664723873, 'splitBias': 0.0, 'pruneWidth': 0.4000000059604645, 'downAngleV': (0.0, 80.0, 10.0, 10.0), 'rotate': (99.5, 137.5, 137.5, 137.5), 'pruneRatio': 1.0, 'leafDownAngle': 45.0, 'makeMesh': False, 'radiusTweak': (1.0, 1.0, 1.0, 1.0), 'rMode': 'rotate', 'splitAngleV': (0.0, 0.0, 0.0, 0.0), 'branchDist': 1.0, 'bevel': True, 'minRadius': 0.001500000013038516, 'prune': False, 'leafRotateV': 0.0, 'splitAngle': (0.0, 0.0, 0.0, 0.0), 'armAnim': False, 'boneStep': (1, 1, 1, 1), 'pruneBase': 0.30000001192092896, 'taperCrown': 0.0, 'baseSplits': 0, 'baseSize_s': 0.25, 'handleType': '0', 'baseSize': 0.4000000059604645, 'af1': 1.0, 'levels': 2, 'leafScaleV': 0.0, 'resU': 4, 'seed': 0, 'downAngle': (90.0, 110.0, 45.0, 45.0), 'leafangle': 0.0, 'scaleV0': 0.10000000149011612, 'prunePowerHigh': 0.5, 'splitByLen': True, 'wind': 1.0, 'shape': '7', 'prunePowerLow': 0.0010000000474974513, 'scale': 13.0, 'leafAnim': False, 'curveBack': (0.0, 0.0, 0.0, 0.0), 'leafScaleX': 1.0, 'horzLeaves': True, 'splitHeight': 0.20000000298023224, 'leafScaleT': 0.0, 'scaleV': 3.0, 'leafDist': '6', 'nrings': 0, 'curveRes': (8, 5, 3, 1), 'shapeS': '4', 'bevelRes': 0, 'useOldDownAngle': False, 'useParentAngle': True, 'armLevels': 2, 'scale0': 1.0, 'taper': (1.0, 1.0, 1.0, 1.0), 'pruneWidthPeak': 0.6000000238418579, 'previewArm': False, 'leaves': 25, 'ratioPower': 1.100000023841858, 'gustF': 0.07500000298023224, 'curveV': (20.0, 50.0, 75.0, 0.0), 'showLeaves': False, 'frameRate': 1.0, 'length': (1.0, 0.30000001192092896, 0.6000000238418579, 0.44999998807907104), 'branches': (0, 50, 30, 10), 'useArm': False, 'loopFrames': 0, 'gust': 1.0, 'af3': 4.0, 'closeTip': False, 'leafRotate': 137.5, 'attractUp': (0.0, 0.0, 0.5, 0.5), 'leafDownAngleV': 10.0, 'rootFlare': 1.0, 'af2': 1.0, 'lengthV': (0.0, 0.0, 0.0, 0.0), 'rotateV': (15.0, 0.0, 0.0, 0.0), 'attractOut': (0.0, 0.0, 0.0, 0.0), 'segSplits': (0.0, 0.0, 0.0, 0.0)} diff --git a/add_curve_sapling/presets/small_maple.py b/add_curve_sapling/presets/small_maple.py index 8072d547..13d441a9 100644 --- a/add_curve_sapling/presets/small_maple.py +++ b/add_curve_sapling/presets/small_maple.py @@ -1 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-or-later {'leafDownAngle': 45.0, 'handleType': '0', 'radiusTweak': (1.0, 1.0, 1.0, 1.0), 'useArm': False, 'rootFlare': 1.0, 'segSplits': (0.44999998807907104, 0.5, 0.800000011920929, 0.0), 'leafRotateV': 0.0, 'leaves': 32, 'baseSplits': 1, 'rotate': (99.5, 137.5, 137.5, 137.5), 'scale': 8.0, 'makeMesh': False, 'leafDownAngleV': 10.0, 'curve': (0.0, 30.0, 0.0, 0.0), 'splitBias': 0.0, 'leafScale': 0.18000000715255737, 'levels': 3, 'leafScaleT': 0.3499999940395355, 'seed': 0, 'autoTaper': True, 'pruneWidthPeak': 0.6000000238418579, 'branchDist': 1.25, 'prune': False, 'splitAngle': (8.0, 18.0, 18.0, 0.0), 'shapeS': '7', 'useParentAngle': True, 'af1': 1.0, 'armAnim': False, 'resU': 4, 'ratioPower': 1.2000000476837158, 'scaleV': 2.0, 'splitHeight': 0.20000000298023224, 'leafRotate': 137.5, 'customShape': (0.5, 1.0, 0.30000001192092896, 0.5), 'shape': '7', 'ratio': 0.019999999552965164, 'rMode': 'rotate', 'downAngle': (90.0, 48.0, 45.0, 45.0), 'bevelRes': 2, 'showLeaves': True, 'wind': 1.0, 'loopFrames': 0, 'splitByLen': True, 'lengthV': (0.0, 0.029999999329447746, 0.15000000596046448, 0.0), 'leafShape': 'hex', 'downAngleV': (0.0, 48.0, 10.0, 10.0), 'leafangle': -35.0, 'bevel': True, 'gustF': 0.07500000298023224, 'taper': (1.0, 1.0, 1.0, 1.0), 'previewArm': False, 'frameRate': 1.0, 'curveBack': (0.0, -30.0, -20.0, 0.0), 'taperCrown': 0.20000000298023224, 'rotateV': (15.0, 0.0, 0.0, 0.0), 'scaleV0': 0.20000000298023224, 'gust': 1.0, 'horzLeaves': True, 'attractUp': (-0.5, -0.699999988079071, 0.0, 0.0), 'splitAngleV': (2.0, 5.0, 5.0, 0.0), 'pruneRatio': 1.0, 'curveV': (10.0, 35.0, 35.0, 0.0), 'prunePowerHigh': 0.5, 'closeTip': False, 'leafScaleV': 0.20000000298023224, 'leafAnim': False, 'minRadius': 0.0020000000949949026, 'af3': 4.0, 'attractOut': (0.0, 0.4000000059604645, 0.5, 0.0), 'branches': (0, 110, 18, 10), 'leafScaleX': 0.6499999761581421, 'length': (1.0, 0.46000000834465027, 0.44999998807907104, 0.44999998807907104), 'useOldDownAngle': False, 'armLevels': 2, 'boneStep': (1, 1, 1, 1), 'pruneBase': 0.30000001192092896, 'curveRes': (8, 5, 3, 1), 'prunePowerLow': 0.0010000000474974513, 'af2': 1.0, 'pruneWidth': 0.4000000059604645, 'nrings': 0, 'baseSize_s': 0.25, 'baseSize': 0.2800000011920929, 'leafDist': '6', 'scale0': 1.0} diff --git a/add_curve_sapling/presets/small_pine.py b/add_curve_sapling/presets/small_pine.py index b0d2dc58..b5b41d61 100644 --- a/add_curve_sapling/presets/small_pine.py +++ b/add_curve_sapling/presets/small_pine.py @@ -1 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-or-later {'downAngleV': (0.0, 42.0, 10.0, 10.0), 'useOldDownAngle': False, 'splitBias': 0.0, 'branchDist': 1.600000023841858, 'downAngle': (90.0, 110.0, 45.0, 45.0), 'leafScale': 0.20000000298023224, 'baseSize': 0.06799984723329544, 'shapeS': '4', 'leafScaleX': 0.019999999552965164, 'nrings': 7, 'gustF': 0.07500000298023224, 'showLeaves': True, 'taperCrown': 0.0, 'curveBack': (0.0, 0.0, 0.0, 0.0), 'leafShape': 'rect', 'makeMesh': False, 'scale0': 1.0, 'length': (1.0, 0.3199999928474426, 0.75, 0.44999998807907104), 'ratioPower': 1.0, 'taper': (1.0, 1.0, 1.0, 1.0), 'baseSize_s': 0.25, 'splitHeight': 0.20000000298023224, 'handleType': '0', 'pruneBase': 0.30000001192092896, 'attractUp': (2.0, 0.0, 0.5, 0.5), 'boneStep': (1, 1, 1, 1), 'seed': 0, 'leafDownAngle': 65.0, 'attractOut': (0.0, 0.0, 0.0, 0.0), 'leafAnim': False, 'gust': 1.0, 'curveV': (100.0, 100.0, 100.0, 0.0), 'splitAngle': (0.0, 22.0, 25.0, 0.0), 'prunePowerLow': 0.0010000000474974513, 'leafangle': -10.0, 'frameRate': 1.0, 'pruneRatio': 1.0, 'rMode': 'rotate', 'shape': '8', 'segSplits': (0.0, 0.30000001192092896, 0.4000000059604645, 0.0), 'branches': (0, 36, 7, 10), 'prunePowerHigh': 0.5, 'af1': 1.0, 'closeTip': False, 'splitAngleV': (0.0, 5.0, 0.0, 0.0), 'ratio': 0.019999999552965164, 'minRadius': 0.001500000013038516, 'levels': 3, 'leafRotate': 137.5, 'armLevels': 2, 'horzLeaves': False, 'pruneWidth': 0.4000000059604645, 'baseSplits': 0, 'scale': 4.0, 'leafScaleV': 0.10000000149011612, 'splitByLen': True, 'useParentAngle': True, 'previewArm': False, 'wind': 1.0, 'leafDist': '3', 'leafScaleT': 0.25, 'bevel': True, 'resU': 4, 'leafDownAngleV': 55.0, 'pruneWidthPeak': 0.6000000238418579, 'af3': 4.0, 'scaleV': 1.0, 'rootFlare': 1.0, 'loopFrames': 0, 'curve': (0.0, -40.0, -30.0, 0.0), 'leaves': 500, 'scaleV0': 0.10000000149011612, 'rotate': (99.5, 137.5, -90.0, 137.5), 'curveRes': (8, 5, 3, 1), 'useArm': False, 'af2': 1.0, 'bevelRes': 2, 'autoTaper': True, 'lengthV': (0.0, 0.15000000596046448, 0.25, 0.0), 'armAnim': False, 'prune': False, 'radiusTweak': (1.0, 1.0, 1.0, 1.0), 'leafRotateV': 30.0, 'customShape': (0.8999999761581421, 1.0, 0.20000000298023224, 0.20000000298023224), 'rotateV': (15.0, 0.0, 0.0, 0.0)} diff --git a/add_curve_sapling/presets/weeping_willow.py b/add_curve_sapling/presets/weeping_willow.py index a4efed38..65c570e3 100644 --- a/add_curve_sapling/presets/weeping_willow.py +++ b/add_curve_sapling/presets/weeping_willow.py @@ -1 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-or-later {'showLeaves': False, 'leafScaleX': 0.20000000298023224, 'horzLeaves': False, 'useArm': False, 'rMode': 'rotate', 'branchDist': 1.5, 'scale': 15.0, 'armLevels': 2, 'gustF': 0.07500000298023224, 'closeTip': False, 'shape': '4', 'minRadius': 0.001500000013038516, 'leafScaleT': 0.0, 'leafDownAngle': 30.0, 'splitByLen': True, 'prunePowerLow': 0.0010000000474974513, 'splitBias': 0.0, 'autoTaper': True, 'leafRotateV': 30.0, 'scale0': 1.0, 'length': (0.75, 0.5, 1.5, 0.10000000149011612), 'lengthV': (0.0, 0.10000000149011612, 0.0, 0.0), 'bevel': True, 'baseSize': 0.20000000298023224, 'handleType': '1', 'ratioPower': 1.75, 'leafScaleV': 0.0, 'ratio': 0.02500000037252903, 'scaleV': 5.0, 'gust': 1.0, 'baseSplits': 2, 'loopFrames': 0, 'curve': (0.0, 20.0, -40.0, 0.0), 'pruneWidth': 0.5, 'shapeS': '4', 'splitAngleV': (0.0, 10.0, 20.0, 0.0), 'branches': (0, 35, 15, 1), 'frameRate': 1.0, 'splitAngle': (12.0, 30.0, 16.0, 0.0), 'seed': 2789, 'nrings': 0, 'previewArm': False, 'pruneWidthPeak': 0.6000000238418579, 'af1': 1.0, 'splitHeight': 0.20000000298023224, 'rotateV': (15.0, 15.0, 45.0, 0.0), 'attractUp': (0.0, 0.0, -2.75, -3.0), 'curveV': (150.0, 120.0, 0.0, 0.0), 'makeMesh': False, 'leaves': 150, 'curveBack': (0.0, 20.0, 0.0, 0.0), 'taper': (1.0, 1.0, 1.0, 1.0), 'resU': 4, 'useOldDownAngle': False, 'pruneRatio': 0.800000011920929, 'levels': 3, 'taperCrown': 0.0, 'attractOut': (0.0, 0.0, 0.0, 0.0), 'leafRotate': 137.5, 'prunePowerHigh': 0.20000000298023224, 'prune': False, 'leafangle': 0.0, 'bevelRes': 1, 'curveRes': (8, 16, 8, 1), 'rotate': (99.5, 137.5, -60.0, 140.0), 'pruneBase': 0.07000000029802322, 'segSplits': (0.10000000149011612, 0.20000000298023224, 0.20000000298023224, 0.0), 'scaleV0': 0.0, 'boneStep': (1, 1, 1, 1), 'useParentAngle': True, 'armAnim': False, 'wind': 1.0, 'leafDist': '10', 'leafScale': 0.25, 'radiusTweak': (1.0, 1.0, 1.0, 1.0), 'leafDownAngleV': 10.0, 'leafAnim': False, 'downAngle': (0.0, 20.0, 30.0, 20.0), 'af2': 1.0, 'af3': 4.0, 'downAngleV': (0.0, 20.0, 10.0, 10.0), 'customShape': (0.5, 1.0, 0.30000001192092896, 0.5), 'leafShape': 'hex', 'rootFlare': 1.0, 'baseSize_s': 0.25} diff --git a/add_curve_sapling/presets/white_birch.py b/add_curve_sapling/presets/white_birch.py index 6aa5829f..43bd4ac5 100644 --- a/add_curve_sapling/presets/white_birch.py +++ b/add_curve_sapling/presets/white_birch.py @@ -1 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-or-later {'seed': 0, 'showLeaves': True, 'armLevels': 0, 'leafDist': '6', 'baseSize': 0.3499999940395355, 'loopFrames': 0, 'af3': 4.0, 'previewArm': False, 'leafangle': -45.0, 'useParentAngle': True, 'handleType': '0', 'branches': (0, 60, 30, 10), 'autoTaper': True, 'splitAngle': (12.0, 18.0, 16.0, 0.0), 'baseSize_s': 0.800000011920929, 'closeTip': False, 'af2': 1.0, 'prune': False, 'scale0': 1.0, 'rMode': 'rotate', 'useOldDownAngle': False, 'scaleV0': 0.10000000149011612, 'splitBias': 0.0, 'resU': 2, 'curveBack': (0.0, -5.0, 0.0, 0.0), 'scale': 12.0, 'shape': '8', 'leafDownAngle': 45.0, 'af1': 1.0, 'ratio': 0.019999999552965164, 'horzLeaves': True, 'leafRotate': 137.5, 'minRadius': 0.0020000000949949026, 'bevelRes': 2, 'splitByLen': True, 'rootFlare': 1.149999976158142, 'makeMesh': False, 'downAngleV': (0.0, 25.0, 30.0, 10.0), 'levels': 3, 'scaleV': 2.0, 'armAnim': False, 'lengthV': (0.05000000074505806, 0.20000000298023224, 0.3499999940395355, 0.0), 'pruneWidth': 0.3100000023841858, 'gustF': 0.07500000298023224, 'taper': (1.0, 1.0, 1.0, 1.0), 'splitAngleV': (2.0, 2.0, 0.0, 0.0), 'prunePowerLow': 0.0010000000474974513, 'leafScaleT': 0.20000000298023224, 'leafScaleX': 0.5, 'leafRotateV': 0.0, 'ratioPower': 1.399999976158142, 'segSplits': (0.3499999940395355, 0.3499999940395355, 0.3499999940395355, 0.0), 'downAngle': (90.0, 60.0, 50.0, 45.0), 'rotateV': (0.0, 0.0, 0.0, 0.0), 'gust': 1.0, 'attractUp': (0.0, -1.0, -0.6499999761581421, 0.0), 'leafScaleV': 0.25, 'frameRate': 1.0, 'curveV': (100.0, 80.0, 80.0, 0.0), 'boneStep': (1, 1, 1, 1), 'customShape': (0.699999988079071, 1.0, 0.30000001192092896, 0.5900000333786011), 'pruneBase': 0.30000001192092896, 'leafAnim': False, 'curveRes': (10, 8, 3, 1), 'nrings': 0, 'bevel': True, 'taperCrown': 0.0, 'baseSplits': 2, 'leafShape': 'hex', 'splitHeight': 0.550000011920929, 'wind': 1.0, 'curve': (0.0, -30.0, -25.0, 0.0), 'rotate': (137.5, 137.5, 137.5, 137.5), 'length': (1.0, 0.33000001311302185, 0.375, 0.44999998807907104), 'leafScale': 0.20000000298023224, 'attractOut': (0.0, 0.20000000298023224, 0.25, 0.0), 'prunePowerHigh': 0.10000000149011612, 'branchDist': 1.5, 'useArm': False, 'pruneRatio': 1.0, 'shapeS': '7', 'leafDownAngleV': 10.0, 'pruneWidthPeak': 0.5, 'radiusTweak': (1.0, 1.0, 1.0, 1.0), 'leaves': 16} diff --git a/add_curve_sapling/presets/willow.py b/add_curve_sapling/presets/willow.py index 3384eb19..c52a501e 100644 --- a/add_curve_sapling/presets/willow.py +++ b/add_curve_sapling/presets/willow.py @@ -1 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-or-later {'curveRes': (8, 16, 12, 1), 'scaleV0': 0.0, 'pruneRatio': 1.0, 'rotate': (0.0, -120.0, -120.0, 140.0), 'resU': 4, 'levels': 2, 'frameRate': 1.0, 'ratioPower': 2.0, 'windGust': 0.0, 'branches': (0, 25, 10, 300), 'attractUp': -3.0, 'bevel': True, 'windSpeed': 2.0, 'rotateV': (0.0, 30.0, 30.0, 0.0), 'segSplits': (0.10000000149011612, 0.20000000298023224, 0.20000000298023224, 0.0), 'handleType': '1', 'shape': '3', 'curveV': (120.0, 90.0, 0.0, 0.0), 'scale': 15.0, 'leafShape': 'hex', 'showLeaves': False, 'ratio': 0.029999999329447746, 'leaves': 15.0, 'armAnim': False, 'leafScale': 0.11999999731779099, 'leafDist': '4', 'useArm': False, 'splitAngle': (3.0, 30.0, 45.0, 0.0), 'lengthV': (0.0, 0.10000000149011612, 0.0, 0.0), 'seed': 0, 'scaleV': 5.0, 'startCurv': 0.0, 'downAngle': (0.0, 20.0, 30.0, 20.0), 'pruneWidth': 0.4000000059604645, 'baseSize': 0.05000000074505806, 'bevelRes': 0, 'length': (0.800000011920929, 0.5, 1.5, 0.10000000149011612), 'downAngleV': (0.0, 10.0, 10.0, 10.0), 'prune': False, 'curve': (0.0, 40.0, 0.0, 0.0), 'taper': (1.0, 1.0, 1.0, 1.0), 'prunePowerHigh': 0.5, 'leafScaleX': 0.20000000298023224, 'curveBack': (20.0, 80.0, 0.0, 0.0), 'bend': 0.0, 'scale0': 1.0, 'prunePowerLow': 0.0010000000474974513, 'splitAngleV': (0.0, 10.0, 20.0, 0.0), 'baseSplits': 2, 'pruneWidthPeak': 0.6000000238418579} diff --git a/add_curve_sapling/utils.py b/add_curve_sapling/utils.py index a4beb313..cbec485c 100644 --- a/add_curve_sapling/utils.py +++ b/add_curve_sapling/utils.py @@ -1,22 +1,4 @@ -# -*- coding: utf-8 -*- -# ##### 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 ##### - +# SPDX-License-Identifier: GPL-2.0-or-later import bpy diff --git a/add_mesh_BoltFactory/Boltfactory.py b/add_mesh_BoltFactory/Boltfactory.py index f2646704..0c56e9b7 100644 --- a/add_mesh_BoltFactory/Boltfactory.py +++ b/add_mesh_BoltFactory/Boltfactory.py @@ -1,23 +1,8 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy +import bmesh from mathutils import Matrix from bpy.types import Operator from bpy_extras.object_utils import AddObjectHelper @@ -431,20 +416,29 @@ class add_mesh_bolt(Operator, AddObjectHelper): (context.active_object.data is not None) and ('Bolt' in context.active_object.data.keys()) and \ (self.change == True): obj = context.active_object - oldmesh = obj.data - oldmeshname = obj.data.name + use_auto_smooth = bool(obj.data.use_auto_smooth) # Copy value, do not take a reference + use_smooth = bool(obj.data.polygons[0].use_smooth) # Copy value, do not take a reference + mesh = createMesh.Create_New_Mesh(self, context) - obj.data = mesh + + # Modify existing mesh data object by replacing geometry (but leaving materials etc) + bm = bmesh.new() + bm.from_mesh(mesh) + bm.to_mesh(obj.data) + bm.free() + + # Preserve flat/smooth choice. New mesh is flat by default + obj.data.use_auto_smooth = use_auto_smooth + if use_smooth: + bpy.ops.object.shade_smooth() + + bpy.data.meshes.remove(mesh) + try: bpy.ops.object.vertex_group_remove(all=True) except: pass - for material in oldmesh.materials: - obj.data.materials.append(material) - - bpy.data.meshes.remove(oldmesh) - obj.data.name = oldmeshname else: mesh = createMesh.Create_New_Mesh(self, context) obj = object_utils.object_data_add(context, mesh, operator=self) @@ -455,17 +449,14 @@ class add_mesh_bolt(Operator, AddObjectHelper): obj.data[prm] = getattr(self, prm) if bpy.context.mode == "EDIT_MESH": - active_object = context.active_object - name_active_object = active_object.name - bpy.ops.object.mode_set(mode='OBJECT') + obj = context.edit_object mesh = createMesh.Create_New_Mesh(self, context) - obj = object_utils.object_data_add(context, mesh, operator=self) - obj.select_set(True) - active_object.select_set(True) - bpy.ops.object.join() - context.active_object.name = name_active_object - bpy.ops.object.mode_set(mode='EDIT') + bm = bmesh.from_edit_mesh(obj.data) # Access edit mode's mesh data + bm.from_mesh(mesh) # Append new mesh data + bmesh.update_edit_mesh(obj.data) # Flush changes (update edit mode's view) + + bpy.data.meshes.remove(mesh) # Remove temporary mesh return {'FINISHED'} diff --git a/add_mesh_BoltFactory/__init__.py b/add_mesh_BoltFactory/__init__.py index 34833a49..f84a08b5 100644 --- a/add_mesh_BoltFactory/__init__.py +++ b/add_mesh_BoltFactory/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "BoltFactory", diff --git a/add_mesh_BoltFactory/createMesh.py b/add_mesh_BoltFactory/createMesh.py index 5a0e8e59..1da617ea 100644 --- a/add_mesh_BoltFactory/createMesh.py +++ b/add_mesh_BoltFactory/createMesh.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from mathutils import ( diff --git a/add_mesh_discombobulator/__init__.py b/add_mesh_discombobulator/__init__.py index c1039608..9506f924 100644 --- a/add_mesh_discombobulator/__init__.py +++ b/add_mesh_discombobulator/__init__.py @@ -1,20 +1,5 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later + # Contributed to by: Chichiri, Jace Priester # # codemanx, blender dev team, Lijenstina, Spivak Vladimir (cwolf3d) # # Originally by Evan J. Rosky (syrux) diff --git a/add_mesh_discombobulator/mesh_discombobulator.py b/add_mesh_discombobulator/mesh_discombobulator.py index 93f3b3c4..09c6eae0 100644 --- a/add_mesh_discombobulator/mesh_discombobulator.py +++ b/add_mesh_discombobulator/mesh_discombobulator.py @@ -1,4 +1,6 @@ -# GPL # Original Authors: Evan J. Rosky (syrux), Chichiri, Jace Priester # +# SPDX-License-Identifier: GPL-2.0-or-later + +# Original Authors: Evan J. Rosky (syrux), Chichiri, Jace Priester import bpy import random diff --git a/add_mesh_extra_objects/Blocks.py b/add_mesh_extra_objects/Blocks.py index 31db7807..22676670 100644 --- a/add_mesh_extra_objects/Blocks.py +++ b/add_mesh_extra_objects/Blocks.py @@ -1,4 +1,6 @@ -# GPL # "authors": dudecon, jambay +# SPDX-License-Identifier: GPL-2.0-or-later + +# Authors: dudecon, jambay # Module notes: # @@ -1244,7 +1246,7 @@ def plan(Thesketch, oldrows=0): # rows = [list of row objects] rows = [] - # splits are places where we NEED a row division, to accomidate openings + # splits are places where we NEED a row division, to accommodate openings # add a split for the bottom row splits = [dims['b'] + settings['hb']] diff --git a/add_mesh_extra_objects/Wallfactory.py b/add_mesh_extra_objects/Wallfactory.py index 9ed8cb84..cbdb4c13 100644 --- a/add_mesh_extra_objects/Wallfactory.py +++ b/add_mesh_extra_objects/Wallfactory.py @@ -1,25 +1,4 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you may 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 -# -# or go online at: http://www.gnu.org/licenses/ to view license options. -# -# ##### END GPL LICENCE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later # authors: dudecon, jambay diff --git a/add_mesh_extra_objects/__init__.py b/add_mesh_extra_objects/__init__.py index 8a697ae5..7777ff45 100644 --- a/add_mesh_extra_objects/__init__.py +++ b/add_mesh_extra_objects/__init__.py @@ -1,20 +1,5 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later + # Contributed to by: # Pontiac, Fourmadmen, varkenvarken, tuga3d, meta-androcto, metalliandy # # dreampainter, cotejrp1, liero, Kayo Phoenix, sugiany, dommetysk, Jambay # diff --git a/add_mesh_extra_objects/add_empty_as_parent.py b/add_mesh_extra_objects/add_empty_as_parent.py index da4295ff..62b7751c 100644 --- a/add_mesh_extra_objects/add_empty_as_parent.py +++ b/add_mesh_extra_objects/add_empty_as_parent.py @@ -1,4 +1,6 @@ -# GPL # Original Author Liero # +# SPDX-License-Identifier: GPL-2.0-or-later + +# Original Author Liero import bpy from bpy.types import Operator diff --git a/add_mesh_extra_objects/add_mesh_3d_function_surface.py b/add_mesh_extra_objects/add_mesh_3d_function_surface.py index c4520adc..acd272b4 100644 --- a/add_mesh_extra_objects/add_mesh_3d_function_surface.py +++ b/add_mesh_extra_objects/add_mesh_3d_function_surface.py @@ -1,4 +1,6 @@ -# GPL # original by Buerbaum Martin (Pontiac), Elod Csirmaz +# SPDX-License-Identifier: GPL-2.0-or-later + +# Original by Buerbaum Martin (Pontiac), Elod Csirmaz import bpy import math @@ -544,8 +546,10 @@ class AddXYZFunctionSurface(Operator): obj = create_mesh_object(context, verts, [], faces, "XYZ Function") - if self.show_wire: - obj.show_wire = True + if self.show_wire: + context.active_object.show_wire = True + else: + context.active_object.show_wire = False if self.edit_mode: bpy.ops.object.mode_set(mode = 'EDIT') diff --git a/add_mesh_extra_objects/add_mesh_beam_builder.py b/add_mesh_extra_objects/add_mesh_beam_builder.py index 0cc43e0f..f4a4a7d2 100644 --- a/add_mesh_extra_objects/add_mesh_beam_builder.py +++ b/add_mesh_extra_objects/add_mesh_beam_builder.py @@ -1,4 +1,6 @@ -# GPL # "author": revolt_randy, Jambay +# SPDX-License-Identifier: GPL-2.0-or-later + +# Author: revolt_randy, Jambay # Create "Beam" primitives. Based on original script by revolt_randy diff --git a/add_mesh_extra_objects/add_mesh_gears.py b/add_mesh_extra_objects/add_mesh_gears.py index 4d9f0168..b74ac936 100644 --- a/add_mesh_extra_objects/add_mesh_gears.py +++ b/add_mesh_extra_objects/add_mesh_gears.py @@ -1,4 +1,5 @@ -# GPL # (c) 2009, 2010 Michel J. Anders (varkenvarken) +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright 2009-2010 Michel J. Anders (varkenvarken) import bpy from bpy.types import Operator diff --git a/add_mesh_extra_objects/add_mesh_gemstones.py b/add_mesh_extra_objects/add_mesh_gemstones.py index 92374118..f30911c5 100644 --- a/add_mesh_extra_objects/add_mesh_gemstones.py +++ b/add_mesh_extra_objects/add_mesh_gemstones.py @@ -1,4 +1,6 @@ -# GPL # "author": "Pontiac, Fourmadmen, Dreampainter" +# SPDX-License-Identifier: GPL-2.0-or-later + +# Author: Pontiac, Fourmadmen, Dreampainter import bpy from bpy.types import Operator diff --git a/add_mesh_extra_objects/add_mesh_honeycomb.py b/add_mesh_extra_objects/add_mesh_honeycomb.py index bb6734a4..5c72f952 100644 --- a/add_mesh_extra_objects/add_mesh_honeycomb.py +++ b/add_mesh_extra_objects/add_mesh_honeycomb.py @@ -1,4 +1,6 @@ -# GPL # "author": "Kayo Phoenix" +# SPDX-License-Identifier: GPL-2.0-or-later + +# Author: Kayo Phoenix import bpy from bpy_extras import object_utils diff --git a/add_mesh_extra_objects/add_mesh_menger_sponge.py b/add_mesh_extra_objects/add_mesh_menger_sponge.py index 1e932e20..bf723441 100644 --- a/add_mesh_extra_objects/add_mesh_menger_sponge.py +++ b/add_mesh_extra_objects/add_mesh_menger_sponge.py @@ -1,6 +1,5 @@ -# -*- coding: utf-8 -*- -# Copyright (c) 2015 sugiany -# This file is distributed under the MIT License. See the LICENSE.md for more details. +# SPDX-License-Identifier: MIT +# Copyright 2015 Sugiany import bpy diff --git a/add_mesh_extra_objects/add_mesh_pipe_joint.py b/add_mesh_extra_objects/add_mesh_pipe_joint.py index 91c64e2f..52103992 100644 --- a/add_mesh_extra_objects/add_mesh_pipe_joint.py +++ b/add_mesh_extra_objects/add_mesh_pipe_joint.py @@ -1,4 +1,6 @@ -# GPL # "author": "Buerbaum Martin (Pontiac)" +# SPDX-License-Identifier: GPL-2.0-or-later + +# Author: Buerbaum Martin (Pontiac) import bpy, bmesh from math import sin, cos, tan, pi, radians diff --git a/add_mesh_extra_objects/add_mesh_pyramid.py b/add_mesh_extra_objects/add_mesh_pyramid.py index 58fafb04..1b735891 100644 --- a/add_mesh_extra_objects/add_mesh_pyramid.py +++ b/add_mesh_extra_objects/add_mesh_pyramid.py @@ -1,4 +1,6 @@ -# GPL # "author": "Phil Cote, cotejrp1, (http://www.blenderaddons.com)" +# SPDX-License-Identifier: GPL-2.0-or-later + +# Author: Phil Cote, cotejrp1, (http://www.blenderaddons.com) import bpy import bmesh diff --git a/add_mesh_extra_objects/add_mesh_rocks/__init__.py b/add_mesh_extra_objects/add_mesh_rocks/__init__.py index 40c52584..39bf7349 100644 --- a/add_mesh_extra_objects/add_mesh_rocks/__init__.py +++ b/add_mesh_extra_objects/add_mesh_rocks/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + # Paul "BrikBot" Marshall # Created: July 1, 2011 # Last Modified: September 26, 2013 @@ -8,27 +10,6 @@ # # Coded in IDLE, tested in Blender 2.68a. NumPy Recommended. # Search for "@todo" to quickly find sections that need work. -# -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# The Blender Rock Creation tool is for rapid generation of -# mesh rocks in Blender. -# Copyright (C) 2011 Paul Marshall -# -# 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 3 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, see <http://www.gnu.org/licenses/>. -# -# ##### END GPL LICENSE BLOCK ##### # <pep8 compliant> diff --git a/add_mesh_extra_objects/add_mesh_rocks/randomize_texture.py b/add_mesh_extra_objects/add_mesh_rocks/randomize_texture.py index 3b1c4565..b1dd99bd 100644 --- a/add_mesh_extra_objects/add_mesh_rocks/randomize_texture.py +++ b/add_mesh_extra_objects/add_mesh_rocks/randomize_texture.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + # This try block allows for the script to psudo-intelligently select the # appropriate random to use. If Numpy's random is present it will use that. # If Numpy's random is not present, it will through a "module not found" @@ -133,7 +135,7 @@ def randomizeTexture(texture, level=1): elif texture.type == 'VORONOI': metrics = ['DISTANCE', 'DISTANCE_SQUARED', 'MANHATTAN', 'CHEBYCHEV', 'MINKOVSKY_HALF', 'MINKOVSKY_FOUR', 'MINKOVSKY'] - # Settings for first dispalcement level: + # Settings for first displacement level: if level == 0: tempInt = randint(0, 1) texture.distance_metric = metrics[tempInt] diff --git a/add_mesh_extra_objects/add_mesh_rocks/rockgen.py b/add_mesh_extra_objects/add_mesh_rocks/rockgen.py index 8e2df338..a0088bbb 100644 --- a/add_mesh_extra_objects/add_mesh_rocks/rockgen.py +++ b/add_mesh_extra_objects/add_mesh_rocks/rockgen.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + # Blender rock creation tool # # Based on BlenderGuru's asteroid tutorial and personal experimentation. @@ -87,26 +89,6 @@ # Remember - # Functional code comes before fast code. Once it works, then worry about # making it faster/more efficient. -# -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# The Blender Rock Creation tool is for rapid generation of mesh rocks. -# Copyright (C) 2011 Paul Marshall -# -# 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 3 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, see <http://www.gnu.org/licenses/>. -# -# ##### END GPL LICENSE BLOCK ##### # <pep8 compliant> diff --git a/add_mesh_extra_objects/add_mesh_rocks/settings.py b/add_mesh_extra_objects/add_mesh_rocks/settings.py index ae41779e..3dd485f9 100644 --- a/add_mesh_extra_objects/add_mesh_rocks/settings.py +++ b/add_mesh_extra_objects/add_mesh_rocks/settings.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + # Paul "BrikBot" Marshall # Created: July 1, 2011 # Last Modified: November 17, 2011 @@ -8,27 +10,6 @@ # # Coded in IDLE, tested in Blender 2.59. NumPy Recommended. # Search for "@todo" to quickly find sections that need work. -# -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# The Blender Rock Creation tool is for rapid generation of -# mesh rocks in Blender. -# Copyright (C) 2011 Paul Marshall -# -# 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 3 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, see <http://www.gnu.org/licenses/>. -# -# ##### END GPL LICENSE BLOCK ##### # <pep8 compliant> diff --git a/add_mesh_extra_objects/add_mesh_rocks/utils.py b/add_mesh_extra_objects/add_mesh_rocks/utils.py index 1da48655..5b4e26ca 100644 --- a/add_mesh_extra_objects/add_mesh_rocks/utils.py +++ b/add_mesh_extra_objects/add_mesh_rocks/utils.py @@ -1,26 +1,7 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# The Blender Rock Creation tool is for rapid generation of mesh rocks. -# Copyright (C) 2011 Paul Marshall -# -# 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 3 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, see <http://www.gnu.org/licenses/>. -# -# ##### END GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> - # Converts a formatted string to a float tuple: # IN - '(0.5, 0.2)' -> CONVERT -> OUT - (0.5, 0.2) def toTuple(stringIn): diff --git a/add_mesh_extra_objects/add_mesh_round_brilliant.py b/add_mesh_extra_objects/add_mesh_round_brilliant.py index 874a26db..b1a93012 100644 --- a/add_mesh_extra_objects/add_mesh_round_brilliant.py +++ b/add_mesh_extra_objects/add_mesh_round_brilliant.py @@ -1,4 +1,5 @@ -# GPL "author": "Dominic Kröper, (dommetysk)" +# SPDX-License-Identifier: GPL-2.0-or-later +# Author: Dominic Kröper, (dommetysk) import bpy from math import ( diff --git a/add_mesh_extra_objects/add_mesh_round_cube.py b/add_mesh_extra_objects/add_mesh_round_cube.py index b48e9a69..3daf57a1 100644 --- a/add_mesh_extra_objects/add_mesh_round_cube.py +++ b/add_mesh_extra_objects/add_mesh_round_cube.py @@ -1,4 +1,6 @@ -# GPL # Author: Alain Ducharme (phymec) +# SPDX-License-Identifier: GPL-2.0-or-later + +# Author: Alain Ducharme (phymec) import bpy from bpy_extras import object_utils diff --git a/add_mesh_extra_objects/add_mesh_solid.py b/add_mesh_extra_objects/add_mesh_solid.py index 59e070df..0d1a72c5 100644 --- a/add_mesh_extra_objects/add_mesh_solid.py +++ b/add_mesh_extra_objects/add_mesh_solid.py @@ -1,4 +1,6 @@ -# GPL # "author": "DreamPainter" +# SPDX-License-Identifier: GPL-2.0-or-later + +# Author: DreamPainter import bpy from math import sqrt diff --git a/add_mesh_extra_objects/add_mesh_star.py b/add_mesh_extra_objects/add_mesh_star.py index 2bede081..f12427cf 100644 --- a/add_mesh_extra_objects/add_mesh_star.py +++ b/add_mesh_extra_objects/add_mesh_star.py @@ -1,4 +1,6 @@ -# GPL Original by Fourmadmen +# SPDX-License-Identifier: GPL-2.0-or-later + +# Original by Fourmadmen import bpy from mathutils import ( diff --git a/add_mesh_extra_objects/add_mesh_supertoroid.py b/add_mesh_extra_objects/add_mesh_supertoroid.py index 8a87a289..e325cffc 100644 --- a/add_mesh_extra_objects/add_mesh_supertoroid.py +++ b/add_mesh_extra_objects/add_mesh_supertoroid.py @@ -1,4 +1,6 @@ -# GPL # "author": "DreamPainter" +# SPDX-License-Identifier: GPL-2.0-or-later + +# Author: DreamPainter import bpy from bpy.props import ( diff --git a/add_mesh_extra_objects/add_mesh_teapot.py b/add_mesh_extra_objects/add_mesh_teapot.py index e4ddbecb..6fc693c4 100644 --- a/add_mesh_extra_objects/add_mesh_teapot.py +++ b/add_mesh_extra_objects/add_mesh_teapot.py @@ -1,4 +1,6 @@ -# GPL # Author, Anthony D'Agostino +# SPDX-License-Identifier: GPL-2.0-or-later + +# Author, Anthony D'Agostino import bpy from bpy.props import ( diff --git a/add_mesh_extra_objects/add_mesh_torusknot.py b/add_mesh_extra_objects/add_mesh_torusknot.py index 39e985c3..28c79027 100644 --- a/add_mesh_extra_objects/add_mesh_torusknot.py +++ b/add_mesh_extra_objects/add_mesh_torusknot.py @@ -1,4 +1,6 @@ -# GPL # Author, Anthony D'Agostino +# SPDX-License-Identifier: GPL-2.0-or-later + +# Author: Anthony D'Agostino import bpy from mathutils import Vector diff --git a/add_mesh_extra_objects/add_mesh_triangles.py b/add_mesh_extra_objects/add_mesh_triangles.py index 5373c5fb..f0a45ba8 100644 --- a/add_mesh_extra_objects/add_mesh_triangles.py +++ b/add_mesh_extra_objects/add_mesh_triangles.py @@ -1,4 +1,5 @@ -# GPL # "author": Sjaak-de-Draak +# SPDX-License-Identifier: GPL-2.0-or-later +# Author: Sjaak-de-Draak bl_info = { "name": "Triangles", diff --git a/add_mesh_extra_objects/add_mesh_twisted_torus.py b/add_mesh_extra_objects/add_mesh_twisted_torus.py index bb3bd483..1a2b47f7 100644 --- a/add_mesh_extra_objects/add_mesh_twisted_torus.py +++ b/add_mesh_extra_objects/add_mesh_twisted_torus.py @@ -1,4 +1,6 @@ -# GPL # "author": Paulo_Gomes +# SPDX-License-Identifier: GPL-2.0-or-later + +# Author: Paulo_Gomes import bpy from mathutils import Quaternion, Vector diff --git a/add_mesh_extra_objects/add_mesh_vertex.py b/add_mesh_extra_objects/add_mesh_vertex.py index 88b9d345..4ee3ad85 100644 --- a/add_mesh_extra_objects/add_mesh_vertex.py +++ b/add_mesh_extra_objects/add_mesh_vertex.py @@ -1,4 +1,6 @@ -# GPL # Originals by meta-androcto, Pablo Vazquez, Liero, Richard Wilks +# SPDX-License-Identifier: GPL-2.0-or-later + +# Originals by meta-androcto, Pablo Vazquez, Liero, Richard Wilks import bpy from bpy.types import Operator diff --git a/add_mesh_geodesic_domes/__init__.py b/add_mesh_geodesic_domes/__init__.py index e88f3184..632ee843 100644 --- a/add_mesh_geodesic_domes/__init__.py +++ b/add_mesh_geodesic_domes/__init__.py @@ -1,20 +1,5 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later + # Contributed to by PKHG, Meta Androcto, Noctumsolis, Lijenstina, # Spivak Vladimir (cwolf3d) # Origunally an addon by Andy Houston diff --git a/add_mesh_geodesic_domes/add_shape_geodesic.py b/add_mesh_geodesic_domes/add_shape_geodesic.py index d461bd15..e647ba35 100644 --- a/add_mesh_geodesic_domes/add_shape_geodesic.py +++ b/add_mesh_geodesic_domes/add_shape_geodesic.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy import mathutils diff --git a/add_mesh_geodesic_domes/forms_271.py b/add_mesh_geodesic_domes/forms_271.py index f4dd5119..c7a933a3 100644 --- a/add_mesh_geodesic_domes/forms_271.py +++ b/add_mesh_geodesic_domes/forms_271.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + from math import sin, cos, sqrt from .vefm_271 import * diff --git a/add_mesh_geodesic_domes/geodesic_classes_271.py b/add_mesh_geodesic_domes/geodesic_classes_271.py index 6f54bff7..3b3a0387 100644 --- a/add_mesh_geodesic_domes/geodesic_classes_271.py +++ b/add_mesh_geodesic_domes/geodesic_classes_271.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + from .vefm_271 import mesh, vertex, edge, face from math import pi, acos, sin, cos, atan, tan, fabs, sqrt diff --git a/add_mesh_geodesic_domes/third_domes_panel_271.py b/add_mesh_geodesic_domes/third_domes_panel_271.py index d95de427..148a802f 100644 --- a/add_mesh_geodesic_domes/third_domes_panel_271.py +++ b/add_mesh_geodesic_domes/third_domes_panel_271.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy import os from . import vefm_271 diff --git a/add_mesh_geodesic_domes/vefm_271.py b/add_mesh_geodesic_domes/vefm_271.py index bc6a38dc..f7b71dfd 100644 --- a/add_mesh_geodesic_domes/vefm_271.py +++ b/add_mesh_geodesic_domes/vefm_271.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + # vert class and overloading experiments import bpy # PKHG>NEEDED? diff --git a/amaranth/__init__.py b/amaranth/__init__.py index cb0861a1..41530937 100644 --- a/amaranth/__init__.py +++ b/amaranth/__init__.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Amaranth diff --git a/amaranth/animation/frame_current.py b/amaranth/animation/frame_current.py index 6bea2009..8f0e5cb7 100644 --- a/amaranth/animation/frame_current.py +++ b/amaranth/animation/frame_current.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Current Frame Slider diff --git a/amaranth/animation/jump_frames.py b/amaranth/animation/jump_frames.py index fb12cb35..db65709b 100644 --- a/amaranth/animation/jump_frames.py +++ b/amaranth/animation/jump_frames.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Jump X Frames on Shift Up/Down diff --git a/amaranth/animation/motion_paths.py b/amaranth/animation/motion_paths.py index 7988b452..a61c7e4e 100644 --- a/amaranth/animation/motion_paths.py +++ b/amaranth/animation/motion_paths.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Bone Motion Paths: diff --git a/amaranth/animation/timeline_extra_info.py b/amaranth/animation/timeline_extra_info.py index 0e875b43..4131878c 100644 --- a/amaranth/animation/timeline_extra_info.py +++ b/amaranth/animation/timeline_extra_info.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Timeline Extra Info diff --git a/amaranth/misc/color_management.py b/amaranth/misc/color_management.py index 72ad4bb2..743c5625 100644 --- a/amaranth/misc/color_management.py +++ b/amaranth/misc/color_management.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Color Management Presets diff --git a/amaranth/misc/dupli_group_id.py b/amaranth/misc/dupli_group_id.py index 05fa7129..c4fa28fe 100644 --- a/amaranth/misc/dupli_group_id.py +++ b/amaranth/misc/dupli_group_id.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Object ID for Dupli Groups Say you have a linked character or asset, you can now set an Object ID for the diff --git a/amaranth/misc/sequencer_extra_info.py b/amaranth/misc/sequencer_extra_info.py index 2d5d6b79..93b02733 100644 --- a/amaranth/misc/sequencer_extra_info.py +++ b/amaranth/misc/sequencer_extra_info.py @@ -1,29 +1,4 @@ -# 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. -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Sequencer: Display Image File Name diff --git a/amaranth/misc/toggle_wire.py b/amaranth/misc/toggle_wire.py index 3d43660d..57ccc253 100644 --- a/amaranth/misc/toggle_wire.py +++ b/amaranth/misc/toggle_wire.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later import bpy diff --git a/amaranth/modeling/symmetry_tools.py b/amaranth/modeling/symmetry_tools.py index d23b4fb9..a3e47355 100644 --- a/amaranth/modeling/symmetry_tools.py +++ b/amaranth/modeling/symmetry_tools.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Symmetry Tools: Find Asymmetric + Make Symmetric (by Sergey Sharybin) diff --git a/amaranth/node_editor/display_image.py b/amaranth/node_editor/display_image.py index 0dcefca8..380166a9 100644 --- a/amaranth/node_editor/display_image.py +++ b/amaranth/node_editor/display_image.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Display Active Image Node on Image Editor diff --git a/amaranth/node_editor/id_panel.py b/amaranth/node_editor/id_panel.py index 09f031da..e3c77985 100644 --- a/amaranth/node_editor/id_panel.py +++ b/amaranth/node_editor/id_panel.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Object / Material Indices Panel diff --git a/amaranth/node_editor/node_shader_extra.py b/amaranth/node_editor/node_shader_extra.py index 7fbaf225..5719112e 100644 --- a/amaranth/node_editor/node_shader_extra.py +++ b/amaranth/node_editor/node_shader_extra.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later import bpy diff --git a/amaranth/node_editor/node_stats.py b/amaranth/node_editor/node_stats.py index 796e10dc..001f7461 100644 --- a/amaranth/node_editor/node_stats.py +++ b/amaranth/node_editor/node_stats.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Nodes Stats diff --git a/amaranth/node_editor/normal_node.py b/amaranth/node_editor/normal_node.py index fe77856a..6549ec4e 100644 --- a/amaranth/node_editor/normal_node.py +++ b/amaranth/node_editor/normal_node.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Nodes: XYZ Sliders for Normal Node diff --git a/amaranth/node_editor/simplify_nodes.py b/amaranth/node_editor/simplify_nodes.py index 71aec24c..5cdc6a78 100644 --- a/amaranth/node_editor/simplify_nodes.py +++ b/amaranth/node_editor/simplify_nodes.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Nodes Simplify Panel [WIP Feature] diff --git a/amaranth/node_editor/switch_material.py b/amaranth/node_editor/switch_material.py index d559965b..68e1be9b 100644 --- a/amaranth/node_editor/switch_material.py +++ b/amaranth/node_editor/switch_material.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Material Selector diff --git a/amaranth/node_editor/templates/__init__.py b/amaranth/node_editor/templates/__init__.py index 90edac48..33af8dde 100644 --- a/amaranth/node_editor/templates/__init__.py +++ b/amaranth/node_editor/templates/__init__.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Node Templates - Vignette, Vector Blur diff --git a/amaranth/node_editor/templates/vectorblur.py b/amaranth/node_editor/templates/vectorblur.py index 2bc01e48..03ca93fc 100644 --- a/amaranth/node_editor/templates/vectorblur.py +++ b/amaranth/node_editor/templates/vectorblur.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from mathutils import Vector diff --git a/amaranth/node_editor/templates/vignette.py b/amaranth/node_editor/templates/vignette.py index 5e8ce0a4..8bf45622 100644 --- a/amaranth/node_editor/templates/vignette.py +++ b/amaranth/node_editor/templates/vignette.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from mathutils import Vector diff --git a/amaranth/prefs.py b/amaranth/prefs.py index 3c27c12d..f5938fcf 100644 --- a/amaranth/prefs.py +++ b/amaranth/prefs.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.props import ( diff --git a/amaranth/render/border_camera.py b/amaranth/render/border_camera.py index 3d286080..03d93e7b 100644 --- a/amaranth/render/border_camera.py +++ b/amaranth/render/border_camera.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Set Camera Bounds as Render Border diff --git a/amaranth/render/final_resolution.py b/amaranth/render/final_resolution.py index 953b793f..b1580177 100644 --- a/amaranth/render/final_resolution.py +++ b/amaranth/render/final_resolution.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ UI: Final Resolution diff --git a/amaranth/render/meshlight_add.py b/amaranth/render/meshlight_add.py index 0b78b52b..a7febbfa 100644 --- a/amaranth/render/meshlight_add.py +++ b/amaranth/render/meshlight_add.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy from mathutils import Vector from amaranth.utils import cycles_exists diff --git a/amaranth/render/meshlight_select.py b/amaranth/render/meshlight_select.py index cad3a95a..b2dea04e 100644 --- a/amaranth/render/meshlight_select.py +++ b/amaranth/render/meshlight_select.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Select Meshlights diff --git a/amaranth/render/passepartout.py b/amaranth/render/passepartout.py index 7d65299c..1f44aab6 100644 --- a/amaranth/render/passepartout.py +++ b/amaranth/render/passepartout.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Passepartout on Specials menu diff --git a/amaranth/render/render_output_z.py b/amaranth/render/render_output_z.py index 2c1107ed..4e1b3613 100644 --- a/amaranth/render/render_output_z.py +++ b/amaranth/render/render_output_z.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ EXR Render: Warn when Z not connected Display a little warning label when exporting EXR, with Z Buffer enabled, but diff --git a/amaranth/render/samples_scene.py b/amaranth/render/samples_scene.py index 0409a771..d14288d3 100644 --- a/amaranth/render/samples_scene.py +++ b/amaranth/render/samples_scene.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Cycles: Samples per Scene diff --git a/amaranth/scene/current_blend.py b/amaranth/scene/current_blend.py index e3f4ca91..7ab855c4 100644 --- a/amaranth/scene/current_blend.py +++ b/amaranth/scene/current_blend.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ File Browser > Go to Current Blend's Folder diff --git a/amaranth/scene/debug.py b/amaranth/scene/debug.py index 7154a119..38692743 100755 --- a/amaranth/scene/debug.py +++ b/amaranth/scene/debug.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Scene Debug Panel diff --git a/amaranth/scene/goto_library.py b/amaranth/scene/goto_library.py index 08f1689c..b1ea9e5b 100644 --- a/amaranth/scene/goto_library.py +++ b/amaranth/scene/goto_library.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ File Browser: Libraries Bookmark diff --git a/amaranth/scene/material_remove_unassigned.py b/amaranth/scene/material_remove_unassigned.py index f19bc3d2..af2154d1 100644 --- a/amaranth/scene/material_remove_unassigned.py +++ b/amaranth/scene/material_remove_unassigned.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later import bpy diff --git a/amaranth/scene/refresh.py b/amaranth/scene/refresh.py index 3ef5e6b7..e03fc9cf 100644 --- a/amaranth/scene/refresh.py +++ b/amaranth/scene/refresh.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Refresh Scene diff --git a/amaranth/scene/save_reload.py b/amaranth/scene/save_reload.py index 7b961b64..f3bedb5e 100644 --- a/amaranth/scene/save_reload.py +++ b/amaranth/scene/save_reload.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Save & Reload File diff --git a/amaranth/scene/stats.py b/amaranth/scene/stats.py index 10d8be44..71d10741 100644 --- a/amaranth/scene/stats.py +++ b/amaranth/scene/stats.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later """ Scene, Cameras, and Meshlights Count diff --git a/amaranth/utils.py b/amaranth/utils.py index f6367875..b7301d43 100644 --- a/amaranth/utils.py +++ b/amaranth/utils.py @@ -1,16 +1,4 @@ -# 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. +# SPDX-License-Identifier: GPL-2.0-or-later import bpy diff --git a/animation_add_corrective_shape_key.py b/animation_add_corrective_shape_key.py index 01e13cde..d61559ef 100644 --- a/animation_add_corrective_shape_key.py +++ b/animation_add_corrective_shape_key.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> diff --git a/animation_animall.py b/animation_animall.py index 811cb2c9..309141a9 100644 --- a/animation_animall.py +++ b/animation_animall.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "AnimAll", diff --git a/ant_landscape/__init__.py b/ant_landscape/__init__.py index fa0b7b5a..295793b9 100644 --- a/ant_landscape/__init__.py +++ b/ant_landscape/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Another Noise Tool - Suite (W.I.P.) # Jimmy Hazevoet 5/2017 diff --git a/ant_landscape/add_mesh_ant_landscape.py b/ant_landscape/add_mesh_ant_landscape.py index 0e6610cf..a148f448 100644 --- a/ant_landscape/add_mesh_ant_landscape.py +++ b/ant_landscape/add_mesh_ant_landscape.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Another Noise Tool - Add Landscape # Jimmy Hazevoet diff --git a/ant_landscape/ant_functions.py b/ant_landscape/ant_functions.py index 47de9ef2..f63747aa 100644 --- a/ant_landscape/ant_functions.py +++ b/ant_landscape/ant_functions.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Another Noise Tool - Functions # Jimmy Hazevoet diff --git a/ant_landscape/ant_noise.py b/ant_landscape/ant_noise.py index 7d6b12e8..7eec29b6 100644 --- a/ant_landscape/ant_noise.py +++ b/ant_landscape/ant_noise.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Another Noise Tool - Noise and Effects # Jimmy Hazevoet diff --git a/ant_landscape/eroder.py b/ant_landscape/eroder.py index 56f2bfca..558d2edb 100644 --- a/ant_landscape/eroder.py +++ b/ant_landscape/eroder.py @@ -1,25 +1,4 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# erode.py -- a script to simulate erosion of height fields -# (c) 2014 Michel J. Anders (varkenvarken) -# with some modifications by Ian Huish (nerk) -# -# 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 ##### - +# SPDX-License-Identifier: GPL-2.0-or-later from time import time import unittest @@ -175,7 +154,7 @@ class Grid: if abs(yscale) > 1e-6 : self.zscale = 1.0/yscale - # keep just the z-values and null any ofsset + # keep just the z-values and null any offset # we might catch a reshape error that will occur if nx*ny != # of vertices (if we are not dealing with a heightfield but with a mesh with duplicate x,y coords, like an axis aligned cube self.center = np.array([c[2] for c in verts],dtype=np.single).reshape(nx,ny) self.center = (self.center-np.amin(self.center))*self.zscale diff --git a/ant_landscape/mesh_ant_displace.py b/ant_landscape/mesh_ant_displace.py index 917cc34b..5638d96a 100644 --- a/ant_landscape/mesh_ant_displace.py +++ b/ant_landscape/mesh_ant_displace.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Another Noise Tool - Mesh Displace # Jimmy Hazevoet diff --git a/ant_landscape/stats.py b/ant_landscape/stats.py index 5c37d2ba..c8793dd9 100644 --- a/ant_landscape/stats.py +++ b/ant_landscape/stats.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + from time import time try: diff --git a/ant_landscape/test.py b/ant_landscape/test.py index d56815f2..39d060c4 100644 --- a/ant_landscape/test.py +++ b/ant_landscape/test.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + from numpy import * if __name__ == '__main__': diff --git a/ant_landscape/utils.py b/ant_landscape/utils.py index 6588f75b..7687bd54 100644 --- a/ant_landscape/utils.py +++ b/ant_landscape/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + numexpr_available=False try: import numexpr diff --git a/archimesh/__init__.py b/archimesh/__init__.py index 99692591..829c2ed5 100644 --- a/archimesh/__init__.py +++ b/archimesh/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/archimesh/achm_books_maker.py b/archimesh/achm_books_maker.py index da66bff8..500e8f2d 100644 --- a/archimesh/achm_books_maker.py +++ b/archimesh/achm_books_maker.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/archimesh/achm_column_maker.py b/archimesh/achm_column_maker.py index ac7ca2e6..436f6bab 100644 --- a/archimesh/achm_column_maker.py +++ b/archimesh/achm_column_maker.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/archimesh/achm_curtain_maker.py b/archimesh/achm_curtain_maker.py index 5c1e41e2..8484dd86 100644 --- a/archimesh/achm_curtain_maker.py +++ b/archimesh/achm_curtain_maker.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/archimesh/achm_door_maker.py b/archimesh/achm_door_maker.py index 7f534be5..6499fa37 100644 --- a/archimesh/achm_door_maker.py +++ b/archimesh/achm_door_maker.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/archimesh/achm_gltools.py b/archimesh/achm_gltools.py index 981082d0..0ee8f941 100644 --- a/archimesh/achm_gltools.py +++ b/archimesh/achm_gltools.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/archimesh/achm_kitchen_maker.py b/archimesh/achm_kitchen_maker.py index cc1e6ef8..b252d3eb 100644 --- a/archimesh/achm_kitchen_maker.py +++ b/archimesh/achm_kitchen_maker.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/archimesh/achm_lamp_maker.py b/archimesh/achm_lamp_maker.py index a5c6621b..1176896a 100644 --- a/archimesh/achm_lamp_maker.py +++ b/archimesh/achm_lamp_maker.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/archimesh/achm_main_panel.py b/archimesh/achm_main_panel.py index 4fca1caf..b668dbba 100644 --- a/archimesh/achm_main_panel.py +++ b/archimesh/achm_main_panel.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/archimesh/achm_roof_maker.py b/archimesh/achm_roof_maker.py index c125eb84..194649be 100644 --- a/archimesh/achm_roof_maker.py +++ b/archimesh/achm_roof_maker.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/archimesh/achm_room_maker.py b/archimesh/achm_room_maker.py index 7a59eee5..c235a976 100644 --- a/archimesh/achm_room_maker.py +++ b/archimesh/achm_room_maker.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/archimesh/achm_shelves_maker.py b/archimesh/achm_shelves_maker.py index 59a2bfc7..259ebbbc 100644 --- a/archimesh/achm_shelves_maker.py +++ b/archimesh/achm_shelves_maker.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/archimesh/achm_stairs_maker.py b/archimesh/achm_stairs_maker.py index af727101..09dbe256 100644 --- a/archimesh/achm_stairs_maker.py +++ b/archimesh/achm_stairs_maker.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/archimesh/achm_tools.py b/archimesh/achm_tools.py index 0527d330..1eff2cda 100644 --- a/archimesh/achm_tools.py +++ b/archimesh/achm_tools.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/archimesh/achm_venetian_maker.py b/archimesh/achm_venetian_maker.py index da90ab55..eb80026a 100644 --- a/archimesh/achm_venetian_maker.py +++ b/archimesh/achm_venetian_maker.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/archimesh/achm_window_maker.py b/archimesh/achm_window_maker.py index e9b6131d..8ef2f6a4 100644 --- a/archimesh/achm_window_maker.py +++ b/archimesh/achm_window_maker.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/archimesh/achm_window_panel.py b/archimesh/achm_window_panel.py index 6899c2e9..ed0169f4 100644 --- a/archimesh/achm_window_panel.py +++ b/archimesh/achm_window_panel.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/blender_id/__init__.py b/blender_id/__init__.py index 93b09124..149bd74e 100644 --- a/blender_id/__init__.py +++ b/blender_id/__init__.py @@ -1,22 +1,5 @@ -# ##### 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. -# -# Copyright (C) 2014-2018 Blender Foundation -# -# ##### END GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright 2014-2018 Blender Foundation. # <pep8 compliant> diff --git a/blender_id/communication.py b/blender_id/communication.py index 6ebb3ea3..942b9f74 100644 --- a/blender_id/communication.py +++ b/blender_id/communication.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/blender_id/profiles.py b/blender_id/profiles.py index 7a4b3495..63b1d29b 100644 --- a/blender_id/profiles.py +++ b/blender_id/profiles.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/bone_selection_sets.py b/bone_selection_sets.py index 391f183a..40a083b8 100644 --- a/bone_selection_sets.py +++ b/bone_selection_sets.py @@ -1,20 +1,4 @@ -# ##### 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 LICENCE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Bone Selection Sets", diff --git a/btrace/__init__.py b/btrace/__init__.py index aaf0fc15..fd4bf57c 100644 --- a/btrace/__init__.py +++ b/btrace/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { diff --git a/btrace/bTrace.py b/btrace/bTrace.py index 2baae055..a17c3dd7 100644 --- a/btrace/bTrace.py +++ b/btrace/bTrace.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # TO DO LIST # # Add more options to curve radius/modulation plus cyclic/connect curve option diff --git a/btrace/bTrace_panel.py b/btrace/bTrace_panel.py index 2d267e8a..6783207a 100644 --- a/btrace/bTrace_panel.py +++ b/btrace/bTrace_panel.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy from bpy.types import Panel diff --git a/btrace/bTrace_props.py b/btrace/bTrace_props.py index b7e824c8..e7e757a4 100644 --- a/btrace/bTrace_props.py +++ b/btrace/bTrace_props.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.types import ( diff --git a/camera_turnaround.py b/camera_turnaround.py index 8d0fa417..471dfed3 100644 --- a/camera_turnaround.py +++ b/camera_turnaround.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Turnaround Camera", diff --git a/copy_global_transform.py b/copy_global_transform.py index 17b0337e..31a9646a 100644 --- a/copy_global_transform.py +++ b/copy_global_transform.py @@ -1,20 +1,4 @@ -# ====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later """ Copy Global Transform diff --git a/curve_assign_shapekey.py b/curve_assign_shapekey.py index 643eb3a2..a87e89b0 100644 --- a/curve_assign_shapekey.py +++ b/curve_assign_shapekey.py @@ -1,14 +1,12 @@ -# -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright (C) 2019 Shrinivas Kulkarni + # This Blender add-on assigns one or more Bezier Curves as shape keys to another # Bezier Curve # # Supported Blender Versions: 2.8x # -# Copyright (C) 2019 Shrinivas Kulkarni -# -# License: GPL-3.0 (https://github.com/Shriinivas/assignshapekey/blob/master/LICENSE) -# +# https://github.com/Shriinivas/assignshapekey/blob/master/LICENSE import bpy, bmesh, bgl, gpu from gpu_extras.batch import batch_for_shader diff --git a/curve_simplify.py b/curve_simplify.py index 0109530a..a902a8db 100644 --- a/curve_simplify.py +++ b/curve_simplify.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Simplify Curves+", diff --git a/curve_tools/__init__.py b/curve_tools/__init__.py index d7ce3736..d388f198 100644 --- a/curve_tools/__init__.py +++ b/curve_tools/__init__.py @@ -1,20 +1,5 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later # -# 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 ##### # Contributed to by guy lateur, Alexander Meißner (Lichtso), # Dealga McArdle (zeffii), Marvin.K.Breuer (MKB), # Spivak Vladimir (cwolf3d) @@ -24,11 +9,10 @@ bl_info = { "name": "Curve Tools", "description": "Adds some functionality for bezier/nurbs curve/surface modeling", - "author": "Mackraken", + "author": "Mackraken, Spivak Vladimir (cwolf3d)", "version": (0, 4, 5), "blender": (2, 80, 0), "location": "View3D > Tool Shelf > Edit Tab", - "warning": "WIP", "doc_url": "{BLENDER_MANUAL_URL}/addons/add_curve/curve_tools.html", "category": "Add Curve", } diff --git a/curve_tools/auto_loft.py b/curve_tools/auto_loft.py index 17705cc9..3092e6b8 100644 --- a/curve_tools/auto_loft.py +++ b/curve_tools/auto_loft.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy from bpy.props import BoolProperty from bpy.types import Operator, Panel diff --git a/curve_tools/cad.py b/curve_tools/cad.py index ae96f869..da68a0a5 100644 --- a/curve_tools/cad.py +++ b/curve_tools/cad.py @@ -1,20 +1,4 @@ -# ***** 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 3 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, see <http://www.gnu.org/licenses/>. -# All rights reserved. -# -# ***** GPL LICENSE BLOCK ***** +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { 'name': 'Curve CAD Tools', diff --git a/curve_tools/curves.py b/curve_tools/curves.py index 8a1a1484..8b5e2e7f 100644 --- a/curve_tools/curves.py +++ b/curve_tools/curves.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + from . import mathematics import bpy diff --git a/curve_tools/exports.py b/curve_tools/exports.py index 130fb2a7..f8d6e74c 100644 --- a/curve_tools/exports.py +++ b/curve_tools/exports.py @@ -1,20 +1,4 @@ -# ***** 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 3 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, see <http://www.gnu.org/licenses/>. -# All rights reserved. -# -# ***** GPL LICENSE BLOCK ***** +# SPDX-License-Identifier: GPL-2.0-or-later import bpy, math from mathutils import Vector, Matrix diff --git a/curve_tools/fillet.py b/curve_tools/fillet.py index 911d88c4..6b40f89c 100644 --- a/curve_tools/fillet.py +++ b/curve_tools/fillet.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { 'name': 'Curve Fillet', diff --git a/curve_tools/internal.py b/curve_tools/internal.py index 0e51fa8f..16c922cb 100644 --- a/curve_tools/internal.py +++ b/curve_tools/internal.py @@ -1,20 +1,4 @@ -# ***** 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 3 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, see <http://www.gnu.org/licenses/>. -# All rights reserved. -# -# ***** GPL LICENSE BLOCK ***** +# SPDX-License-Identifier: GPL-2.0-or-later import bpy, math, cmath from mathutils import Vector, Matrix diff --git a/curve_tools/intersections.py b/curve_tools/intersections.py index f0b8e96f..113a97ed 100644 --- a/curve_tools/intersections.py +++ b/curve_tools/intersections.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy from . import mathematics from . import curves diff --git a/curve_tools/mathematics.py b/curve_tools/mathematics.py index 4a61af4d..555c3f65 100644 --- a/curve_tools/mathematics.py +++ b/curve_tools/mathematics.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + from mathutils import * diff --git a/curve_tools/operators.py b/curve_tools/operators.py index 2b1fe12d..e4480f88 100644 --- a/curve_tools/operators.py +++ b/curve_tools/operators.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import time import threading diff --git a/curve_tools/outline.py b/curve_tools/outline.py index 4122482c..8efd6f41 100644 --- a/curve_tools/outline.py +++ b/curve_tools/outline.py @@ -1,24 +1,6 @@ -''' -by Yann Bertrand, january 2014. +# SPDX-License-Identifier: GPL-2.0-or-later -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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -END GPL LICENCE BLOCK -''' +# by Yann Bertrand, january 2014. bl_info = { "name": "Curve Outline", diff --git a/curve_tools/path_finder.py b/curve_tools/path_finder.py index e0b3fa98..abf53a6c 100644 --- a/curve_tools/path_finder.py +++ b/curve_tools/path_finder.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { 'name': 'PathFinder', diff --git a/curve_tools/properties.py b/curve_tools/properties.py index d6fe9e0f..d984f67b 100644 --- a/curve_tools/properties.py +++ b/curve_tools/properties.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import time import bpy diff --git a/curve_tools/remove_doubles.py b/curve_tools/remove_doubles.py index f0b3dbb5..c63d82be 100644 --- a/curve_tools/remove_doubles.py +++ b/curve_tools/remove_doubles.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy, mathutils from . import util diff --git a/curve_tools/show_resolution.py b/curve_tools/show_resolution.py index fc8fdad2..b2dbda7f 100644 --- a/curve_tools/show_resolution.py +++ b/curve_tools/show_resolution.py @@ -1,24 +1,7 @@ -# ##### 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 ##### -# - - -# LOAD MODUL # +# SPDX-License-Identifier: GPL-2.0-or-later + + +# LOAD MODULE # import bpy from bpy import * from bpy.props import * diff --git a/curve_tools/splines_sequence.py b/curve_tools/splines_sequence.py index d861a1ee..98766058 100644 --- a/curve_tools/splines_sequence.py +++ b/curve_tools/splines_sequence.py @@ -1,21 +1,4 @@ -# ##### 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 ##### -# +# SPDX-License-Identifier: GPL-2.0-or-later import bpy diff --git a/curve_tools/surfaces.py b/curve_tools/surfaces.py index 7fa484a7..2d89115c 100644 --- a/curve_tools/surfaces.py +++ b/curve_tools/surfaces.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy import bmesh diff --git a/curve_tools/toolpath.py b/curve_tools/toolpath.py index 2c409f1a..94ab313b 100644 --- a/curve_tools/toolpath.py +++ b/curve_tools/toolpath.py @@ -1,20 +1,4 @@ -# ***** 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 3 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, see <http://www.gnu.org/licenses/>. -# All rights reserved. -# -# ***** GPL LICENSE BLOCK ***** +# SPDX-License-Identifier: GPL-2.0-or-later import bpy, math, bmesh from bpy_extras import view3d_utils diff --git a/curve_tools/util.py b/curve_tools/util.py index 110b8b83..59603186 100644 --- a/curve_tools/util.py +++ b/curve_tools/util.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy from mathutils import * diff --git a/depsgraph_debug.py b/depsgraph_debug.py index c0906005..4405eb8e 100644 --- a/depsgraph_debug.py +++ b/depsgraph_debug.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.types import ( diff --git a/development_edit_operator.py b/development_edit_operator.py index f9e0b911..e51df36e 100644 --- a/development_edit_operator.py +++ b/development_edit_operator.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { diff --git a/development_icon_get.py b/development_icon_get.py index cf214fa2..80277b0a 100644 --- a/development_icon_get.py +++ b/development_icon_get.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/development_iskeyfree.py b/development_iskeyfree.py index c2c338f4..8c8290d0 100644 --- a/development_iskeyfree.py +++ b/development_iskeyfree.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # PEP8 compliant (https://www.python.org/dev/peps/pep-0008) @@ -146,9 +130,8 @@ class MyChecker(): "LEFTMOUSE", "MIDDLEMOUSE", "RIGHTMOUSE", "BUTTON4MOUSE", "BUTTON5MOUSE", "BUTTON6MOUSE", "BUTTON7MOUSE", "MOUSEMOVE", "INBETWEEN_MOUSEMOVE", "TRACKPADPAN", "TRACKPADZOOM", - "MOUSEROTATE", "WHEELUPMOUSE", "WHEELDOWNMOUSE", "WHEELINMOUSE", "WHEELOUTMOUSE", "EVT_TWEAK_L", - "EVT_TWEAK_M", "EVT_TWEAK_R", "A", "B", "C", "D", "E", "F", "G", "H", - "I", "J", + "MOUSEROTATE", "WHEELUPMOUSE", "WHEELDOWNMOUSE", "WHEELINMOUSE", "WHEELOUTMOUSE", + "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "LEFT_CTRL", "LEFT_ALT", "LEFT_SHIFT", "RIGHT_ALT", @@ -319,9 +302,6 @@ class IskeyFreeProperties(PropertyGroup): ("WHEELDOWNMOUSE", "WHEELDOWNMOUSE", ""), ("WHEELINMOUSE", "WHEELINMOUSE", ""), ("WHEELOUTMOUSE", "WHEELOUTMOUSE", ""), - ("EVT_TWEAK_L", "EVT_TWEAK_L", ""), - ("EVT_TWEAK_M", "EVT_TWEAK_M", ""), - ("EVT_TWEAK_R", "EVT_TWEAK_R", ""), ("A", "A", ""), ("B", "B", ""), ("C", "C", ""), diff --git a/greasepencil_tools/__init__.py b/greasepencil_tools/__init__.py index 54c7262b..980493ed 100644 --- a/greasepencil_tools/__init__.py +++ b/greasepencil_tools/__init__.py @@ -1,27 +1,10 @@ -# ##### 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 ##### - +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Grease Pencil Tools", "description": "Extra tools for Grease Pencil", "author": "Samuel Bernou, Antonio Vazquez, Daniel Martinez Lara, Matias Mendiola", -"version": (1, 5, 4), +"version": (1, 6, 0), "blender": (2, 91, 0), "location": "Sidebar > Grease Pencil > Grease Pencil Tools", "warning": "", @@ -37,16 +20,20 @@ from . import (prefs, line_reshape, rotate_canvas, timeline_scrub, + draw_tools, import_brush_pack, ui_panels, ) def register(): + if bpy.app.background: + return prefs.register() timeline_scrub.register() box_deform.register() line_reshape.register() rotate_canvas.register() + draw_tools.register() import_brush_pack.register() ui_panels.register() @@ -54,8 +41,11 @@ def register(): prefs.update_panel(prefs.get_addon_prefs(), bpy.context) def unregister(): + if bpy.app.background: + return ui_panels.unregister() import_brush_pack.unregister() + draw_tools.unregister() rotate_canvas.unregister() box_deform.unregister() line_reshape.unregister() diff --git a/greasepencil_tools/box_deform.py b/greasepencil_tools/box_deform.py index 4c2de720..ef12fc0b 100644 --- a/greasepencil_tools/box_deform.py +++ b/greasepencil_tools/box_deform.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later '''Based on Box_deform standalone addon - Author: Samuel Bernou''' diff --git a/greasepencil_tools/draw_tools.py b/greasepencil_tools/draw_tools.py new file mode 100644 index 00000000..6d2cf3a9 --- /dev/null +++ b/greasepencil_tools/draw_tools.py @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +import bpy + +class GP_OT_camera_flip_x(bpy.types.Operator): + bl_idname = "gp.camera_flip_x" + bl_label = "Camera Flip X" + bl_description = "Invert active camera scale.x to flip view horizontally" + bl_options = {"REGISTER"} + + @classmethod + def poll(cls, context): + return context.space_data.region_3d.view_perspective == 'CAMERA' + + def execute(self, context): + context.scene.camera.scale.x *= -1 + return {"FINISHED"} + +def register(): + bpy.utils.register_class(GP_OT_camera_flip_x) + +def unregister(): + bpy.utils.unregister_class(GP_OT_camera_flip_x) diff --git a/greasepencil_tools/import_brush_pack.py b/greasepencil_tools/import_brush_pack.py index b1306bed..695ca411 100644 --- a/greasepencil_tools/import_brush_pack.py +++ b/greasepencil_tools/import_brush_pack.py @@ -1,5 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy -import re import ssl import urllib.request import urllib.parse @@ -24,23 +25,6 @@ def simple_dl_url(url, dest, fallback_url=None): print('\nDownload page for manual install:', fallback_url) return e -def download_url(url, dest): - '''download passed url to dest file (include filename)''' - import shutil - import time - ssl._create_default_https_context = ssl._create_unverified_context - start_time = time.time() - - try: - with urllib.request.urlopen(url) as response, open(dest, 'wb') as out_file: - shutil.copyfileobj(response, out_file) - except Exception as e: - print('Error trying to download\n', e) - return e - - print(f"Download time {time.time() - start_time:.2f}s",) - - def get_brushes(blend_fp): cur_brushes = [b.name for b in bpy.data.brushes] with bpy.data.libraries.load(str(blend_fp), link=False) as (data_from, data_to): @@ -90,13 +74,9 @@ class GP_OT_install_brush_pack(bpy.types.Operator): self._append_brushes(Path(self.temp) / blendname) def execute(self, context): - import tempfile - import json - import hashlib import os - ## get temp dir temp = tempfile.gettempdir() if not temp: self.report({'ERROR'}, 'no os temporary directory found to download brush pack (using python tempfile.gettempdir())') @@ -104,71 +84,40 @@ class GP_OT_install_brush_pack(bpy.types.Operator): self.temp = Path(temp) - ## download link from gitlab - # brush pack project https://gitlab.com/pepe-school-land/gp-brush-pack - repo_url = r'https://gitlab.com/api/v4/projects/21994857' - tree_url = f'{repo_url}/repository/tree' + dl_url = 'https://download.blender.org/demo/bundles/bundles-3.0/grease-pencil-brush-pack.zip' ## need to create an SSl context or linux fail and raise unverified ssl ssl._create_default_https_context = ssl._create_unverified_context + file_size = None + try: - with urllib.request.urlopen(tree_url) as response: - html = response.read() + with urllib.request.urlopen(dl_url) as response: + file_size = int(response.getheader('Content-Length')) except: ## try loading from tempdir - packs = [f for f in os.listdir(self.temp) if 'GP_brush_pack' in f and f.endswith('.blend')] + packs = [f for f in os.listdir(self.temp) if 'gp_brush_pack' in f.lower() and f.endswith('.blend')] if packs: packs.sort() self._append_brushes(Path(self.temp) / packs[-1]) self.report({'WARNING'}, 'Brushes loaded from temp directory (No download)') - # print('Could not reach web url : Brushes were loaded from temp directory file (No download)') return {"FINISHED"} - self.report({'ERROR'}, f'Check your internet connexion, Impossible to connect to url: {tree_url}') + self.report({'ERROR'}, f'Check your internet connection, impossible to connect to url: {dl_url}') return {"CANCELLED"} - if not html: - self.report({'ERROR'}, f'No response read from: {tree_url}') + if file_size is None: + self.report({'ERROR'}, f'No response read from: {dl_url}') return {"CANCELLED"} - tree_dic = json.loads(html) - zips = [fi for fi in tree_dic if fi['type'] == 'blob' and fi['name'].endswith('.zip')] - - if not zips: - print(f'no zip file found in {tree_url}') - return {"CANCELLED"} - - ## sort by name to get last - zips.sort(key=lambda x: x['name']) - last_zip = zips[-1] - zipname = last_zip['name'] - id_num = last_zip['id'] - - - ## url by filename - # filepath_encode = urllib.parse.quote(zipname, safe='')# need safe to convert possible '/' - # dl_url = f'{repo_url}/repository/files/{filepath_encode}/raw?ref=master' - - ## url by blobs - dl_url = f"{repo_url}/repository/blobs/{id_num}/raw" - - self.brushzip = self.temp / zipname - + self.brushzip = self.temp / Path(dl_url).name ### Load existing files instead of redownloading if exists and up to date (same hash) if self.brushzip.exists(): - ### Test the hash against online git hash (check for update) - BLOCK_SIZE = 524288# 512 Kb buf size - file_hash = hashlib.sha1() - file_hash.update(("blob %u\0" % os.path.getsize(self.brushzip)).encode('utf-8')) - with open(self.brushzip, 'rb') as f: - fb = f.read(BLOCK_SIZE) - while len(fb) > 0: - file_hash.update(fb) - fb = f.read(BLOCK_SIZE) - - if file_hash.hexdigest() == id_num: # same git SHA1 + + ### compare using file size with size from url header + disk_size = self.brushzip.stat().st_size + if disk_size == file_size: ## is up to date, install print(f'{self.brushzip} is up do date, appending brushes') self._install_from_zip() @@ -176,11 +125,9 @@ class GP_OT_install_brush_pack(bpy.types.Operator): ## Download, unzip, use blend print(f'Downloading brushpack in {self.brushzip}') - ## https://cloud.blender.org/p/gallery/5f235cc297f8815e74ffb90b - fallback_url='https://gitlab.com/pepe-school-land/gp-brush-pack/-/blob/master/Official_GP_brush_pack_v01.zip' + fallback_url='https://cloud.blender.org/p/gallery/5f235cc297f8815e74ffb90b' err = simple_dl_url(dl_url, str(self.brushzip), fallback_url) - # err = download_url(dl_url, str(self.brushzip), fallback_url) if err: self.report({'ERROR'}, 'Could not download brush pack. Check your internet connection. (see console for detail)') diff --git a/greasepencil_tools/line_reshape.py b/greasepencil_tools/line_reshape.py index 1425bac5..dc14cfd4 100644 --- a/greasepencil_tools/line_reshape.py +++ b/greasepencil_tools/line_reshape.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later '''Based on GP_refine_stroke 0.2.4 - Author: Samuel Bernou''' diff --git a/greasepencil_tools/prefs.py b/greasepencil_tools/prefs.py index f1b335ba..3ac3220d 100644 --- a/greasepencil_tools/prefs.py +++ b/greasepencil_tools/prefs.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy import os diff --git a/greasepencil_tools/rotate_canvas.py b/greasepencil_tools/rotate_canvas.py index f89e006e..a733eb2d 100644 --- a/greasepencil_tools/rotate_canvas.py +++ b/greasepencil_tools/rotate_canvas.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + from .prefs import get_addon_prefs import bpy @@ -100,7 +102,7 @@ class RC_OT_RotateCanvas(bpy.types.Operator): ## area deformation restore new_cam_offset = mathutils.Vector((new_cam_offset[0], new_cam_offset[1] * self.ratio_inv)) - + context.space_data.region_3d.view_camera_offset = new_cam_offset def execute(self, context): @@ -201,7 +203,7 @@ class RC_OT_RotateCanvas(bpy.types.Operator): # CORRECT UI OVERLAP FROM HEADER TOOLBAR regs = context.area.regions if context.preferences.system.use_region_overlap: - w = context.area.width + w = context.area.width # minus tool header h = context.area.height - regs[0].height else: @@ -209,9 +211,9 @@ class RC_OT_RotateCanvas(bpy.types.Operator): w = context.area.width - regs[2].width - regs[3].width # minus tool header + header h = context.area.height - regs[0].height - regs[1].height - + self.ratio = h / w - self.ratio_inv = w / h + self.ratio_inv = w / h if self.in_cam: # Get camera from scene @@ -221,8 +223,8 @@ class RC_OT_RotateCanvas(bpy.types.Operator): if self.cam.lock_rotation[:] != (False, False, False): self.report({'WARNING'}, 'Camera rotation is locked') return {'CANCELLED'} - - if self.use_view_center: + + if self.use_view_center: self.center = mathutils.Vector((w/2, h/2)) else: self.center = self.get_center_view(context, self.cam) @@ -234,7 +236,7 @@ class RC_OT_RotateCanvas(bpy.types.Operator): # store camera matrix world self.cam_matrix = self.cam.matrix_world.copy() # self.cam_init_euler = self.cam.rotation_euler.copy() - + ## initialize current view_offset in camera self.view_cam_offset = mathutils.Vector(context.space_data.region_3d.view_camera_offset) @@ -249,7 +251,7 @@ class RC_OT_RotateCanvas(bpy.types.Operator): self.pos_current = mathutils.Vector((event.mouse_region_x, event.mouse_region_y)) self.initial_pos = self.pos_current# for draw debug, else no need - # Calculate inital vector + # Calculate initial vector self.vector_initial = self.pos_current - self.center self.vector_initial.normalize() diff --git a/greasepencil_tools/timeline_scrub.py b/greasepencil_tools/timeline_scrub.py index c152c87c..6a1913ae 100644 --- a/greasepencil_tools/timeline_scrub.py +++ b/greasepencil_tools/timeline_scrub.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later '''Based on viewport_timeline_scrub standalone addon - Samuel Bernou''' @@ -37,13 +21,13 @@ from bpy.props import (BoolProperty, EnumProperty) -def nearest(array, value): +def nearest(array, value) -> int: ''' Get a numpy array and a target value Return closest val found in array to passed value ''' idx = (np.abs(array - value)).argmin() - return array[idx] + return int(array[idx]) def draw_callback_px(self, context): @@ -172,7 +156,7 @@ class GPTS_OT_time_scrub(bpy.types.Operator): if ob: # condition to allow empty scrubing if ob.type != 'GPENCIL' or self.evaluate_gp_obj_key: - # Get objet keyframe position + # Get object keyframe position anim_data = ob.animation_data action = None diff --git a/greasepencil_tools/ui_panels.py b/greasepencil_tools/ui_panels.py index 06ad6cb2..2e8a50f1 100644 --- a/greasepencil_tools/ui_panels.py +++ b/greasepencil_tools/ui_panels.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy @@ -36,15 +20,24 @@ class GP_PT_sidebarPanel(bpy.types.Panel): layout.operator('gp.straight_stroke', icon ="CURVE_PATH")# IPO_LINEAR - # Expose Native view operators - # if context.scene.camera: + # Expose native view operators row = layout.row(align=True) - row.operator('view3d.zoom_camera_1_to_1', text = 'Zoom 1:1', icon = 'ZOOM_PREVIOUS')# FULLSCREEN_EXIT? + row.operator('view3d.zoom_camera_1_to_1', text = 'Zoom 1:1', icon = 'ZOOM_PREVIOUS') # FULLSCREEN_EXIT row.operator('view3d.view_center_camera', text = 'Zoom Fit', icon = 'FULLSCREEN_ENTER') + + # Rotation save/load row = layout.row(align=True) row.operator('view3d.rotate_canvas_reset', text = 'Reset Rotation', icon = 'FILE_REFRESH') row.operator('view3d.rotate_canvas_set', text = 'Save Rotation', icon = 'DRIVER_ROTATIONAL_DIFFERENCE') + # View flip + if context.scene.camera and context.scene.camera.scale.x < 0: + row = layout.row(align=True) + row.operator('gp.camera_flip_x', text = 'Camera Mirror Flip', icon = 'MOD_MIRROR') + row.label(text='', icon='LOOP_BACK') + else: + layout.operator('gp.camera_flip_x', text = 'Camera Mirror Flip', icon = 'MOD_MIRROR') + def menu_boxdeform_entry(self, context): """Transform shortcut to append in existing menu""" diff --git a/io_anim_bvh/__init__.py b/io_anim_bvh/__init__.py index 3a17632e..8f712e3d 100644 --- a/io_anim_bvh/__init__.py +++ b/io_anim_bvh/__init__.py @@ -1,27 +1,11 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> bl_info = { "name": "BioVision Motion Capture (BVH) format", "author": "Campbell Barton", - "version": (1, 0, 0), + "version": (1, 0, 1), "blender": (2, 81, 6), "location": "File > Import-Export", "description": "Import-Export BVH from armature objects", diff --git a/io_anim_bvh/export_bvh.py b/io_anim_bvh/export_bvh.py index f400a8fe..3ecf7851 100644 --- a/io_anim_bvh/export_bvh.py +++ b/io_anim_bvh/export_bvh.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_anim_bvh/import_bvh.py b/io_anim_bvh/import_bvh.py index 4710a137..2f335513 100644 --- a/io_anim_bvh/import_bvh.py +++ b/io_anim_bvh/import_bvh.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -585,7 +569,7 @@ def bvh_node_dict2armature( # For each location x, y, z. for axis_i in range(3): - curve = action.fcurves.new(data_path=data_path, index=axis_i) + curve = action.fcurves.new(data_path=data_path, index=axis_i, action_group=bvh_node.name) keyframe_points = curve.keyframe_points keyframe_points.add(num_frame) @@ -631,7 +615,7 @@ def bvh_node_dict2armature( # For each euler angle x, y, z (or quaternion w, x, y, z). for axis_i in range(len(rotate[0])): - curve = action.fcurves.new(data_path=data_path, index=axis_i) + curve = action.fcurves.new(data_path=data_path, index=axis_i, action_group=bvh_node.name) keyframe_points = curve.keyframe_points keyframe_points.add(num_frame) diff --git a/io_anim_camera.py b/io_anim_camera.py index 6130b552..fbc7eaab 100644 --- a/io_anim_camera.py +++ b/io_anim_camera.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -35,23 +19,23 @@ bl_info = { import bpy -def write_cameras(context, filepath, frame_start, frame_end, only_selected=False): +def write_cameras(context, fh, frame_start, frame_end, only_selected=False): data_attrs = ( - 'lens', - 'shift_x', - 'shift_y', - 'dof_distance', - 'clip_start', - 'clip_end', - 'display_size', - ) + "lens", + "shift_x", + "shift_y", + "dof.focus_distance", + "clip_start", + "clip_end", + "display_size", + ) obj_attrs = ( - 'hide_render', - ) + "hide_render", + ) - fw = open(filepath, 'w').write + fw = fh.write scene = bpy.context.scene @@ -76,7 +60,7 @@ def write_cameras(context, filepath, frame_start, frame_end, only_selected=False for obj, obj_data in cameras: fw("data = bpy.data.cameras.new(%r)\n" % obj.name) for attr in data_attrs: - fw("data.%s = %s\n" % (attr, repr(getattr(obj_data, attr)))) + fw("data.%s = %s\n" % (attr, repr(obj_data.path_resolve(attr)))) fw("obj = bpy.data.objects.new(%r, data)\n" % obj.name) @@ -93,21 +77,21 @@ def write_cameras(context, filepath, frame_start, frame_end, only_selected=False fw("scene.frame_set(%d + frame)\n" % f) for obj, obj_data in cameras: - fw("obj = cameras['%s']\n" % obj.name) + fw("obj = cameras[%r]\n" % obj.name) matrix = obj.matrix_world.copy() fw("obj.location = %r, %r, %r\n" % matrix.to_translation()[:]) fw("obj.scale = %r, %r, %r\n" % matrix.to_scale()[:]) fw("obj.rotation_euler = %r, %r, %r\n" % matrix.to_euler()[:]) - fw("obj.keyframe_insert('location')\n") - fw("obj.keyframe_insert('scale')\n") - fw("obj.keyframe_insert('rotation_euler')\n") + fw("obj.keyframe_insert(\"location\")\n") + fw("obj.keyframe_insert(\"scale\")\n") + fw("obj.keyframe_insert(\"rotation_euler\")\n") # only key the angle fw("data = obj.data\n") fw("data.lens = %s\n" % obj_data.lens) - fw("data.keyframe_insert('lens')\n") + fw("data.keyframe_insert(\"lens\")\n") fw("\n") @@ -145,7 +129,8 @@ class CameraExporter(bpy.types.Operator, ExportHelper): default=True) def execute(self, context): - write_cameras(context, self.filepath, self.frame_start, self.frame_end, self.only_selected) + with open(self.filepath, 'w', encoding='utf-8') as fh: + write_cameras(context, fh, self.frame_start, self.frame_end, self.only_selected) return {'FINISHED'} def invoke(self, context, event): diff --git a/io_anim_nuke_chan/__init__.py b/io_anim_nuke_chan/__init__.py index 3fca3f07..4083f321 100644 --- a/io_anim_nuke_chan/__init__.py +++ b/io_anim_nuke_chan/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> diff --git a/io_anim_nuke_chan/export_nuke_chan.py b/io_anim_nuke_chan/export_nuke_chan.py index 9b5f6420..0a64a737 100644 --- a/io_anim_nuke_chan/export_nuke_chan.py +++ b/io_anim_nuke_chan/export_nuke_chan.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> diff --git a/io_anim_nuke_chan/import_nuke_chan.py b/io_anim_nuke_chan/import_nuke_chan.py index 3f9793ab..0fabca81 100644 --- a/io_anim_nuke_chan/import_nuke_chan.py +++ b/io_anim_nuke_chan/import_nuke_chan.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> diff --git a/io_coat3D/__init__.py b/io_coat3D/__init__.py index e1471942..9a3d06af 100644 --- a/io_coat3D/__init__.py +++ b/io_coat3D/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "3D-Coat Applink", @@ -1056,7 +1040,7 @@ def blender_3DC_blender(texturelist, file_applink_address): - #tärkee että saadaan oikein käännettyä objekt + #it is important to get the object translated correctly objekti.select_set(True) diff --git a/io_coat3D/folders.py b/io_coat3D/folders.py index ed348cfa..95dc6e51 100644 --- a/io_coat3D/folders.py +++ b/io_coat3D/folders.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy import os diff --git a/io_coat3D/tex.py b/io_coat3D/tex.py index 9901e3b2..b7f7b70b 100644 --- a/io_coat3D/tex.py +++ b/io_coat3D/tex.py @@ -1,21 +1,4 @@ -# ***** 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 LICENCE BLOCK ***** +# SPDX-License-Identifier: GPL-2.0-or-later import bpy import os diff --git a/io_coat3D/texVR.py b/io_coat3D/texVR.py index 520b3084..1b5263c4 100644 --- a/io_coat3D/texVR.py +++ b/io_coat3D/texVR.py @@ -1,21 +1,4 @@ -# ***** 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 LICENCE BLOCK ***** +# SPDX-License-Identifier: GPL-2.0-or-later import bpy import os diff --git a/io_coat3D/updateimage.py b/io_coat3D/updateimage.py index 2b967fd7..509f2b2e 100644 --- a/io_coat3D/updateimage.py +++ b/io_coat3D/updateimage.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy import os diff --git a/io_curve_svg/__init__.py b/io_curve_svg/__init__.py index 03b1755e..a4883578 100644 --- a/io_curve_svg/__init__.py +++ b/io_curve_svg/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_curve_svg/import_svg.py b/io_curve_svg/import_svg.py index 5b2f1008..c9df4dfb 100644 --- a/io_curve_svg/import_svg.py +++ b/io_curve_svg/import_svg.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_curve_svg/svg_colors.py b/io_curve_svg/svg_colors.py index 6b8657ed..36825202 100644 --- a/io_curve_svg/svg_colors.py +++ b/io_curve_svg/svg_colors.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_curve_svg/svg_util.py b/io_curve_svg/svg_util.py index c544f91d..8bae3abb 100644 --- a/io_curve_svg/svg_util.py +++ b/io_curve_svg/svg_util.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_curve_svg/svg_util_test.py b/io_curve_svg/svg_util_test.py index 09077ef3..8dcd5c3d 100755 --- a/io_curve_svg/svg_util_test.py +++ b/io_curve_svg/svg_util_test.py @@ -1,26 +1,8 @@ #!/usr/bin/env python3 - -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> - # XXX Not really nice, but that hack is needed to allow execution of that test # from both automated CTest and by directly running the file manually. if __name__ == '__main__': diff --git a/io_export_dxf/__init__.py b/io_export_dxf/__init__.py index e9083bb5..abcdbcce 100644 --- a/io_export_dxf/__init__.py +++ b/io_export_dxf/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Export Autocad DXF Format (.dxf)", diff --git a/io_export_dxf/draw_blenders/__init__.py b/io_export_dxf/draw_blenders/__init__.py index e2a7d030..79f9fdcb 100644 --- a/io_export_dxf/draw_blenders/__init__.py +++ b/io_export_dxf/draw_blenders/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + """ NOTE: This stuff was in original code but it seems it will be no longer needed. NOT USED now. diff --git a/io_export_dxf/export_dxf.py b/io_export_dxf/export_dxf.py index c4088c6d..f763b3a3 100644 --- a/io_export_dxf/export_dxf.py +++ b/io_export_dxf/export_dxf.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import os import mathutils diff --git a/io_export_dxf/model/dxfLibrary.py b/io_export_dxf/model/dxfLibrary.py index 50aa4d56..d71a48da 100644 --- a/io_export_dxf/model/dxfLibrary.py +++ b/io_export_dxf/model/dxfLibrary.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + #dxfLibrary.py : provides functions for generating DXF files # -------------------------------------------------------------------------- __version__ = "v1.35 - 2010.06.23" @@ -65,24 +67,6 @@ ______________________________________________________________ # DXF Library: copyright (C) 2005 by Stani Michiels (AKA Stani) # 2008/2009 modif by Remigiusz Fiedler (AKA migius) # -------------------------------------------------------------------------- -# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# ***** END GPL LICENCE BLOCK ***** - #import Blender #from Blender import Mathutils, Window, Scene, sys, Draw diff --git a/io_export_dxf/model/migiusModel.py b/io_export_dxf/model/migiusModel.py index 25813395..a33f47f7 100644 --- a/io_export_dxf/model/migiusModel.py +++ b/io_export_dxf/model/migiusModel.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + """ Created on Sep 2, 2011 diff --git a/io_export_dxf/model/model.py b/io_export_dxf/model/model.py index 698f5102..a91799f4 100644 --- a/io_export_dxf/model/model.py +++ b/io_export_dxf/model/model.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-or-later class DxfDrawing(object): """ diff --git a/io_export_dxf/operator.py b/io_export_dxf/operator.py index 0ecd2635..081f0217 100644 --- a/io_export_dxf/operator.py +++ b/io_export_dxf/operator.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.props import ( diff --git a/io_export_dxf/primitive_exporters/__init__.py b/io_export_dxf/primitive_exporters/__init__.py index d1cfad46..caf90d57 100644 --- a/io_export_dxf/primitive_exporters/__init__.py +++ b/io_export_dxf/primitive_exporters/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + """ This package contains actual primitive exporter classes. They are imported and instantiated according object type diff --git a/io_export_dxf/primitive_exporters/base_exporter.py b/io_export_dxf/primitive_exporters/base_exporter.py index beb97f82..02d2747e 100644 --- a/io_export_dxf/primitive_exporters/base_exporter.py +++ b/io_export_dxf/primitive_exporters/base_exporter.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import mathutils class BasePrimitiveDXFExporter(object): diff --git a/io_export_dxf/primitive_exporters/camera_exporter.py b/io_export_dxf/primitive_exporters/camera_exporter.py index e31166ed..d447f506 100644 --- a/io_export_dxf/primitive_exporters/camera_exporter.py +++ b/io_export_dxf/primitive_exporters/camera_exporter.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + from .base_exporter import BasePrimitiveDXFExporter diff --git a/io_export_dxf/primitive_exporters/curve_exporter.py b/io_export_dxf/primitive_exporters/curve_exporter.py index 09372cad..76316656 100644 --- a/io_export_dxf/primitive_exporters/curve_exporter.py +++ b/io_export_dxf/primitive_exporters/curve_exporter.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + from .base_exporter import BasePrimitiveDXFExporter diff --git a/io_export_dxf/primitive_exporters/empty_exporter.py b/io_export_dxf/primitive_exporters/empty_exporter.py index e849409e..4d12c3a2 100644 --- a/io_export_dxf/primitive_exporters/empty_exporter.py +++ b/io_export_dxf/primitive_exporters/empty_exporter.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + from .base_exporter import BasePrimitiveDXFExporter diff --git a/io_export_dxf/primitive_exporters/insert_exporter.py b/io_export_dxf/primitive_exporters/insert_exporter.py index c912d321..afd4e97d 100644 --- a/io_export_dxf/primitive_exporters/insert_exporter.py +++ b/io_export_dxf/primitive_exporters/insert_exporter.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-or-later from .base_exporter import BasePrimitiveDXFExporter diff --git a/io_export_dxf/primitive_exporters/lamp_exporter.py b/io_export_dxf/primitive_exporters/lamp_exporter.py index 849f0984..fee4787e 100644 --- a/io_export_dxf/primitive_exporters/lamp_exporter.py +++ b/io_export_dxf/primitive_exporters/lamp_exporter.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + from .base_exporter import BasePrimitiveDXFExporter diff --git a/io_export_dxf/primitive_exporters/mesh_exporter.py b/io_export_dxf/primitive_exporters/mesh_exporter.py index 225c60d84..b60c8c92 100644 --- a/io_export_dxf/primitive_exporters/mesh_exporter.py +++ b/io_export_dxf/primitive_exporters/mesh_exporter.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-or-later import mathutils from .base_exporter import BasePrimitiveDXFExporter diff --git a/io_export_dxf/primitive_exporters/text_exporter.py b/io_export_dxf/primitive_exporters/text_exporter.py index fe997614..eb2ef204 100644 --- a/io_export_dxf/primitive_exporters/text_exporter.py +++ b/io_export_dxf/primitive_exporters/text_exporter.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + from .base_exporter import BasePrimitiveDXFExporter diff --git a/io_export_dxf/primitive_exporters/viewborder_exporter.py b/io_export_dxf/primitive_exporters/viewborder_exporter.py index 091cf63b..1fcd228d 100644 --- a/io_export_dxf/primitive_exporters/viewborder_exporter.py +++ b/io_export_dxf/primitive_exporters/viewborder_exporter.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + from base_exporter import BasePrimitiveDXFExporter diff --git a/io_export_paper_model.py b/io_export_paper_model.py index 94d16361..288c4520 100644 --- a/io_export_paper_model.py +++ b/io_export_paper_model.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -# This script is Free software. Please share and reuse. -# ♡2010-2021 Adam Dominec <adominec@gmail.com> +# SPDX-License-Identifier: GPL-2.0-or-later + +# Copyright 2010-2021 Adam Dominec <adominec@gmail.com> ## Code structure # This file consists of several components, in this order: diff --git a/io_export_pc2.py b/io_export_pc2.py index 8dda3cd1..a56e4c33 100644 --- a/io_export_pc2.py +++ b/io_export_pc2.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Export Pointcache Format(.pc2)", diff --git a/io_import_BrushSet.py b/io_import_BrushSet.py index 0c788fcb..e64caceb 100644 --- a/io_import_BrushSet.py +++ b/io_import_BrushSet.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> diff --git a/io_import_dxf/__init__.py b/io_import_dxf/__init__.py index f54535fe..5748612b 100644 --- a/io_import_dxf/__init__.py +++ b/io_import_dxf/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_import_dxf/dxfgrabber/__init__.py b/io_import_dxf/dxfgrabber/__init__.py index 5fe0fefa..f46c691e 100644 --- a/io_import_dxf/dxfgrabber/__init__.py +++ b/io_import_dxf/dxfgrabber/__init__.py @@ -1,7 +1,8 @@ -# dxfgrabber - copyright (C) 2012 by Manfred Moitzi (mozman) +# SPDX-License-Identifier: MIT +# Copyright 2012 Manfred Moitzi (mozman) + # Purpose: grab information from DXF drawings - all DXF versions supported # Created: 21.07.2012 -# License: MIT License version = (0, 8, 4) VERSION = "%d.%d.%d" % version diff --git a/io_import_dxf/dxfgrabber/acdsdata.py b/io_import_dxf/dxfgrabber/acdsdata.py index b864fff0..7a92d4cf 100644 --- a/io_import_dxf/dxfgrabber/acdsdata.py +++ b/io_import_dxf/dxfgrabber/acdsdata.py @@ -1,7 +1,8 @@ +# SPDX-License-Identifier: MIT +# Copyright 2014 Manfred Moitzi + # Purpose: acdsdata section manager # Created: 05.05.2014 -# Copyright (C) 2014, Manfred Moitzi -# License: MIT License from __future__ import unicode_literals __author__ = "mozman <mozman@gmx.at>" diff --git a/io_import_dxf/dxfgrabber/blockssection.py b/io_import_dxf/dxfgrabber/blockssection.py index a64a364e..5decd5c7 100644 --- a/io_import_dxf/dxfgrabber/blockssection.py +++ b/io_import_dxf/dxfgrabber/blockssection.py @@ -1,7 +1,9 @@ +# SPDX-License-Identifier: MIT +# Copyright 2011 Manfred Moitzi + # Purpose: blocks section # Created: 09.08.2012, taken from my package ezdxf -# Copyright (C) 2011, Manfred Moitzi -# License: MIT-License + from __future__ import unicode_literals __author__ = "mozman <mozman@gmx.at>" diff --git a/io_import_dxf/dxfgrabber/codepage.py b/io_import_dxf/dxfgrabber/codepage.py index 47e8e3ea..69f0d1b0 100644 --- a/io_import_dxf/dxfgrabber/codepage.py +++ b/io_import_dxf/dxfgrabber/codepage.py @@ -1,7 +1,9 @@ +# SPDX-License-Identifier: MIT +# Copyright 2012 Manfred Moitzi + # Purpose: codepage handling # Created: 21.07.2012, taken from my ezdxf project -# Copyright (C) 2012, Manfred Moitzi -# License: MIT License + from __future__ import unicode_literals __author__ = "mozman <mozman@gmx.at>" diff --git a/io_import_dxf/dxfgrabber/color.py b/io_import_dxf/dxfgrabber/color.py index ae999804..a83aee4f 100644 --- a/io_import_dxf/dxfgrabber/color.py +++ b/io_import_dxf/dxfgrabber/color.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: MIT + __author__ = 'manfred' diff --git a/io_import_dxf/dxfgrabber/const.py b/io_import_dxf/dxfgrabber/const.py index cf8c6613..1bae7fa0 100644 --- a/io_import_dxf/dxfgrabber/const.py +++ b/io_import_dxf/dxfgrabber/const.py @@ -1,7 +1,9 @@ +# SPDX-License-Identifier: MIT +# Copyright 2012 Manfred Moitzi + # Purpose: constant values # Created: 21.07.2012, taken from my ezdxf project -# Copyright (C) 2012, Manfred Moitzi -# License: MIT License + from __future__ import unicode_literals __author__ = "mozman <mozman@gmx.at>" diff --git a/io_import_dxf/dxfgrabber/decode.py b/io_import_dxf/dxfgrabber/decode.py index 3187cc8f..da3d497c 100644 --- a/io_import_dxf/dxfgrabber/decode.py +++ b/io_import_dxf/dxfgrabber/decode.py @@ -1,7 +1,9 @@ +# SPDX-License-Identifier: MIT +# Copyright 2014 Manfred Moitzi + # Purpose: decode DXF proprietary data # Created: 01.05.2014 -# Copyright (C) 2014, Manfred Moitzi -# License: MIT License + from __future__ import unicode_literals __author__ = "mozman <mozman@gmx.at>" diff --git a/io_import_dxf/dxfgrabber/defaultchunk.py b/io_import_dxf/dxfgrabber/defaultchunk.py index 1df9969a..e953d3ec 100644 --- a/io_import_dxf/dxfgrabber/defaultchunk.py +++ b/io_import_dxf/dxfgrabber/defaultchunk.py @@ -1,7 +1,8 @@ +# SPDX-License-Identifier: MIT +# Copyright 2012 Manfred Moitzi + # Purpose: handle default chunk # Created: 21.07.2012, taken from my ezdxf project -# Copyright (C) 2012, Manfred Moitzi -# License: MIT License from __future__ import unicode_literals __author__ = "mozman <mozman@gmx.at>" diff --git a/io_import_dxf/dxfgrabber/drawing.py b/io_import_dxf/dxfgrabber/drawing.py index db739b23..492e86f9 100644 --- a/io_import_dxf/dxfgrabber/drawing.py +++ b/io_import_dxf/dxfgrabber/drawing.py @@ -1,7 +1,8 @@ +# SPDX-License-Identifier: MIT +# Copyright 2012 Manfred Moitzi + # Purpose: handle drawing data of DXF files # Created: 21.07.12 -# Copyright (C) 2012, Manfred Moitzi -# License: MIT License __author__ = "mozman <mozman@gmx.at>" diff --git a/io_import_dxf/dxfgrabber/dxfentities.py b/io_import_dxf/dxfgrabber/dxfentities.py index ea2eb9d0..f9c9e4bc 100644 --- a/io_import_dxf/dxfgrabber/dxfentities.py +++ b/io_import_dxf/dxfgrabber/dxfentities.py @@ -1,8 +1,9 @@ -# encoding: utf-8 +# SPDX-License-Identifier: MIT +# Copyright 2016 Manfred Moitzi + # Purpose: entity classes, new implementation without dxf12/dxf13 layer # Created: 17.04.2016 -# Copyright (C) 2016, Manfred Moitzi -# License: MIT License + from __future__ import unicode_literals __author__ = "mozman <mozman@gmx.at>" diff --git a/io_import_dxf/dxfgrabber/dxfobjects.py b/io_import_dxf/dxfgrabber/dxfobjects.py index c7ee320b..f3ef149b 100644 --- a/io_import_dxf/dxfgrabber/dxfobjects.py +++ b/io_import_dxf/dxfgrabber/dxfobjects.py @@ -1,8 +1,9 @@ -# encoding: utf-8 +# SPDX-License-Identifier: MIT +# Copyright 2016 Manfred Moitzi + # Purpose: objects classes # Created: 17.04.2016 -# Copyright (C) 2016, Manfred Moitzi -# License: MIT License + from __future__ import unicode_literals __author__ = "mozman <mozman@gmx.at>" diff --git a/io_import_dxf/dxfgrabber/entitysection.py b/io_import_dxf/dxfgrabber/entitysection.py index cd717c56..2e27b657 100644 --- a/io_import_dxf/dxfgrabber/entitysection.py +++ b/io_import_dxf/dxfgrabber/entitysection.py @@ -1,7 +1,8 @@ +# SPDX-License-Identifier: MIT +# Copyright 2012 Manfred Moitzi + # Purpose: handle entity section # Created: 21.07.2012, taken from my ezdxf project -# Copyright (C) 2012, Manfred Moitzi -# License: MIT License from __future__ import unicode_literals __author__ = "mozman <mozman@gmx.at>" diff --git a/io_import_dxf/dxfgrabber/headersection.py b/io_import_dxf/dxfgrabber/headersection.py index 5c6d1622..eead8d01 100755 --- a/io_import_dxf/dxfgrabber/headersection.py +++ b/io_import_dxf/dxfgrabber/headersection.py @@ -1,7 +1,9 @@ +# SPDX-License-Identifier: MIT +# Copyright 2012 Manfred Moitzi + # Purpose: handle header section # Created: 21.07.2012, taken from my ezdxf project -# Copyright (C) 2012, Manfred Moitzi -# License: MIT License + from __future__ import unicode_literals __author__ = "mozman <mozman@gmx.at>" diff --git a/io_import_dxf/dxfgrabber/juliandate.py b/io_import_dxf/dxfgrabber/juliandate.py index be8a3826..5b8c7567 100644 --- a/io_import_dxf/dxfgrabber/juliandate.py +++ b/io_import_dxf/dxfgrabber/juliandate.py @@ -1,7 +1,8 @@ +# SPDX-License-Identifier: MIT +# Copyright 2011 Manfred Moitzi + # Purpose: julian date # Created: 21.03.2011 -# Copyright (C) 2011, Manfred Moitzi -# License: MIT License from __future__ import unicode_literals __author__ = "mozman <mozman@gmx.at>" diff --git a/io_import_dxf/dxfgrabber/layers.py b/io_import_dxf/dxfgrabber/layers.py index a82e5ec8..028df423 100644 --- a/io_import_dxf/dxfgrabber/layers.py +++ b/io_import_dxf/dxfgrabber/layers.py @@ -1,7 +1,8 @@ +# SPDX-License-Identifier: MIT +# Copyright 2012 Manfred Moitzi + # Purpose: handle layers # Created: 21.07.12 -# Copyright (C) 2012, Manfred Moitzi -# License: MIT License __author__ = "mozman <mozman@gmx.at>" diff --git a/io_import_dxf/dxfgrabber/linetypes.py b/io_import_dxf/dxfgrabber/linetypes.py index 4d7caba6..89307b1d 100644 --- a/io_import_dxf/dxfgrabber/linetypes.py +++ b/io_import_dxf/dxfgrabber/linetypes.py @@ -1,6 +1,8 @@ +# SPDX-License-Identifier: MIT +# Copyright 2014 Manfred Moitzi + # Purpose: handle linetypes table # Created: 06.01.2014 -# Copyright (C) 2014, Manfred Moitzi # License: MIT License __author__ = "mozman <mozman@gmx.at>" diff --git a/io_import_dxf/dxfgrabber/sections.py b/io_import_dxf/dxfgrabber/sections.py index 697263db..29980783 100755 --- a/io_import_dxf/dxfgrabber/sections.py +++ b/io_import_dxf/dxfgrabber/sections.py @@ -1,7 +1,8 @@ +# SPDX-License-Identifier: MIT +# Copyright 2012, Manfred Moitzi + # Purpose: handle dxf sections # Created: 21.07.2012, taken from my ezdxf project -# Copyright (C) 2012, Manfred Moitzi -# License: MIT License from __future__ import unicode_literals __author__ = "mozman <mozman@gmx.at>" diff --git a/io_import_dxf/dxfgrabber/styles.py b/io_import_dxf/dxfgrabber/styles.py index 5d056f31..0104464f 100644 --- a/io_import_dxf/dxfgrabber/styles.py +++ b/io_import_dxf/dxfgrabber/styles.py @@ -1,7 +1,9 @@ +# SPDX-License-Identifier: MIT +# Copyright 2014 Manfred Moitzi + # Purpose: handle text styles # Created: 06.01.2014 -# Copyright (C) 2014, Manfred Moitzi -# License: MIT License + from __future__ import unicode_literals __author__ = "mozman <mozman@gmx.at>" diff --git a/io_import_dxf/dxfgrabber/tablessection.py b/io_import_dxf/dxfgrabber/tablessection.py index 345487fa..9c1599cb 100644 --- a/io_import_dxf/dxfgrabber/tablessection.py +++ b/io_import_dxf/dxfgrabber/tablessection.py @@ -1,7 +1,9 @@ +# SPDX-License-Identifier: MIT +# Copyright 2012 Manfred Moitzi + # Purpose: handle tables section # Created: 21.07.2012, taken from my ezdxf project -# Copyright (C) 2012, Manfred Moitzi -# License: MIT License + from __future__ import unicode_literals __author__ = "mozman <mozman@gmx.at>" diff --git a/io_import_dxf/dxfgrabber/tags.py b/io_import_dxf/dxfgrabber/tags.py index 89354b8c..ded46f8a 100644 --- a/io_import_dxf/dxfgrabber/tags.py +++ b/io_import_dxf/dxfgrabber/tags.py @@ -1,7 +1,9 @@ +# SPDX-License-Identifier: MIT +# Copyright 2012 Manfred Moitzi + # Purpose: tag reader # Created: 21.07.2012, taken from my ezdxf project -# Copyright (C) 2012, Manfred Moitzi -# License: MIT License + from __future__ import unicode_literals __author__ = "mozman <mozman@gmx.at>" diff --git a/io_import_dxf/dxfimport/convert.py b/io_import_dxf/dxfimport/convert.py index f3f4be83..f8fda1f9 100644 --- a/io_import_dxf/dxfimport/convert.py +++ b/io_import_dxf/dxfimport/convert.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_import_dxf/dxfimport/do.py b/io_import_dxf/dxfimport/do.py index 3b3b8a27..d05380a0 100644 --- a/io_import_dxf/dxfimport/do.py +++ b/io_import_dxf/dxfimport/do.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_import_dxf/dxfimport/fake_entities.py b/io_import_dxf/dxfimport/fake_entities.py index 35338a7d..b4357d58 100644 --- a/io_import_dxf/dxfimport/fake_entities.py +++ b/io_import_dxf/dxfimport/fake_entities.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_import_dxf/dxfimport/groupsort.py b/io_import_dxf/dxfimport/groupsort.py index 9a49acc7..d9b0ea6f 100644 --- a/io_import_dxf/dxfimport/groupsort.py +++ b/io_import_dxf/dxfimport/groupsort.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_import_dxf/dxfimport/is_.py b/io_import_dxf/dxfimport/is_.py index 021e69d3..03ff69b0 100644 --- a/io_import_dxf/dxfimport/is_.py +++ b/io_import_dxf/dxfimport/is_.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_import_dxf/dxfimport/line_merger.py b/io_import_dxf/dxfimport/line_merger.py index 78e78cc6..b3dcea47 100644 --- a/io_import_dxf/dxfimport/line_merger.py +++ b/io_import_dxf/dxfimport/line_merger.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_import_dxf/transverse_mercator.py b/io_import_dxf/transverse_mercator.py index 84b155b3..6cbe0b97 100644 --- a/io_import_dxf/transverse_mercator.py +++ b/io_import_dxf/transverse_mercator.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_import_images_as_planes.py b/io_import_images_as_planes.py index d842566e..732044e9 100644 --- a/io_import_images_as_planes.py +++ b/io_import_images_as_planes.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_import_palette/__init__.py b/io_import_palette/__init__.py index 8f155894..3ad47383 100644 --- a/io_import_palette/__init__.py +++ b/io_import_palette/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> diff --git a/io_import_palette/import_ase.py b/io_import_palette/import_ase.py index 4b5341b8..a7a8a9c7 100644 --- a/io_import_palette/import_ase.py +++ b/io_import_palette/import_ase.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # This ASE conversion uses code from Marcos A Ojeda http://generic.cx/ # diff --git a/io_import_palette/import_krita.py b/io_import_palette/import_krita.py index 779bc8f3..3d540328 100644 --- a/io_import_palette/import_krita.py +++ b/io_import_palette/import_krita.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_mesh_atomic/__init__.py b/io_mesh_atomic/__init__.py index 81a518b7..9fed6c99 100644 --- a/io_mesh_atomic/__init__.py +++ b/io_mesh_atomic/__init__.py @@ -1,20 +1,5 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later # -# 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 ##### # # Author : Clemens Barth (Blendphys@root-1.de) # Homepage(Wiki) : http://development.root-1.de/Atomic_Blender.php @@ -53,7 +38,6 @@ # ----- # Frank Palmino (Femto-St institute, Belfort-Montbéliard, France) # ... for testing the addons and for feedback -# bl_info = { "name": "Atomic Blender PDB/XYZ", diff --git a/io_mesh_atomic/pdb_export.py b/io_mesh_atomic/pdb_export.py index 949ee5e2..6bac0a05 100644 --- a/io_mesh_atomic/pdb_export.py +++ b/io_mesh_atomic/pdb_export.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from io_mesh_atomic.pdb_import import ELEMENTS_DEFAULT diff --git a/io_mesh_atomic/pdb_gui.py b/io_mesh_atomic/pdb_gui.py index 711053d7..88f7559a 100644 --- a/io_mesh_atomic/pdb_gui.py +++ b/io_mesh_atomic/pdb_gui.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.types import Operator, AddonPreferences diff --git a/io_mesh_atomic/pdb_import.py b/io_mesh_atomic/pdb_import.py index 11bdb972..589776aa 100644 --- a/io_mesh_atomic/pdb_import.py +++ b/io_mesh_atomic/pdb_import.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import os import bpy diff --git a/io_mesh_atomic/utility_gui.py b/io_mesh_atomic/utility_gui.py index ac84d4c7..081dc3c6 100644 --- a/io_mesh_atomic/utility_gui.py +++ b/io_mesh_atomic/utility_gui.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.types import Operator, Panel diff --git a/io_mesh_atomic/utility_panel.py b/io_mesh_atomic/utility_panel.py index 46420502..9f6b91fe 100644 --- a/io_mesh_atomic/utility_panel.py +++ b/io_mesh_atomic/utility_panel.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import os import bpy diff --git a/io_mesh_atomic/xyz_export.py b/io_mesh_atomic/xyz_export.py index 79e99736..e89c59ca 100644 --- a/io_mesh_atomic/xyz_export.py +++ b/io_mesh_atomic/xyz_export.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from io_mesh_atomic.xyz_import import ELEMENTS_DEFAULT diff --git a/io_mesh_atomic/xyz_gui.py b/io_mesh_atomic/xyz_gui.py index e465c4c2..6475a22c 100644 --- a/io_mesh_atomic/xyz_gui.py +++ b/io_mesh_atomic/xyz_gui.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.types import Operator, AddonPreferences diff --git a/io_mesh_atomic/xyz_import.py b/io_mesh_atomic/xyz_import.py index 940a2ff1..6a2bb5a2 100644 --- a/io_mesh_atomic/xyz_import.py +++ b/io_mesh_atomic/xyz_import.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import os import bpy diff --git a/io_mesh_ply/__init__.py b/io_mesh_ply/__init__.py index 1a64bfd1..e76772ed 100644 --- a/io_mesh_ply/__init__.py +++ b/io_mesh_ply/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> diff --git a/io_mesh_ply/export_ply.py b/io_mesh_ply/export_ply.py index 3bb21858..e4fddc49 100644 --- a/io_mesh_ply/export_ply.py +++ b/io_mesh_ply/export_ply.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> diff --git a/io_mesh_ply/import_ply.py b/io_mesh_ply/import_ply.py index d9d12d67..bf2854f3 100644 --- a/io_mesh_ply/import_ply.py +++ b/io_mesh_ply/import_ply.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_mesh_stl/__init__.py b/io_mesh_stl/__init__.py index ff616ba1..3d1aec5c 100644 --- a/io_mesh_stl/__init__.py +++ b/io_mesh_stl/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> @@ -59,6 +43,7 @@ from bpy.props import ( CollectionProperty, EnumProperty, FloatProperty, + FloatVectorProperty, ) from bpy_extras.io_utils import ( ImportHelper, @@ -243,6 +228,12 @@ class ExportSTL(Operator, ExportHelper): ('OBJECT', "Object", "Each object as a file"), ), ) + global_space: FloatVectorProperty( + name="Global Space", + description="Export in this reference space", + subtype='MATRIX', + size=(4, 4), + ) @property def check_extension(self): @@ -265,7 +256,8 @@ class ExportSTL(Operator, ExportHelper): "filter_glob", "use_scene_unit", "use_mesh_modifiers", - "batch_mode" + "batch_mode", + "global_space", ), ) @@ -285,6 +277,9 @@ class ExportSTL(Operator, ExportHelper): to_up=self.axis_up, ).to_4x4() @ Matrix.Scale(global_scale, 4) + if self.properties.is_property_set("global_space"): + global_matrix = global_matrix @ self.global_space.inverted() + if self.batch_mode == 'OFF': faces = itertools.chain.from_iterable( blender_utils.faces_from_mesh(ob, global_matrix, self.use_mesh_modifiers) diff --git a/io_mesh_stl/blender_utils.py b/io_mesh_stl/blender_utils.py index 97621d11..0cfc428b 100644 --- a/io_mesh_stl/blender_utils.py +++ b/io_mesh_stl/blender_utils.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_mesh_stl/stl_utils.py b/io_mesh_stl/stl_utils.py index 2fdd17f0..34d8d97c 100644 --- a/io_mesh_stl/stl_utils.py +++ b/io_mesh_stl/stl_utils.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_mesh_uv_layout/__init__.py b/io_mesh_uv_layout/__init__.py index c7b62047..60686433 100644 --- a/io_mesh_uv_layout/__init__.py +++ b/io_mesh_uv_layout/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> diff --git a/io_mesh_uv_layout/export_uv_eps.py b/io_mesh_uv_layout/export_uv_eps.py index 6d837a15..3a1676b5 100644 --- a/io_mesh_uv_layout/export_uv_eps.py +++ b/io_mesh_uv_layout/export_uv_eps.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> diff --git a/io_mesh_uv_layout/export_uv_png.py b/io_mesh_uv_layout/export_uv_png.py index 7fd3ba09..94c7190e 100644 --- a/io_mesh_uv_layout/export_uv_png.py +++ b/io_mesh_uv_layout/export_uv_png.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> diff --git a/io_mesh_uv_layout/export_uv_svg.py b/io_mesh_uv_layout/export_uv_svg.py index 3ce2e1f0..971ee558 100644 --- a/io_mesh_uv_layout/export_uv_svg.py +++ b/io_mesh_uv_layout/export_uv_svg.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py index 53e1fe85..9933322b 100644 --- a/io_scene_fbx/__init__.py +++ b/io_scene_fbx/__init__.py @@ -1,28 +1,12 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> bl_info = { "name": "FBX format", "author": "Campbell Barton, Bastien Montagne, Jens Restemeier", - "version": (4, 29, 1), - "blender": (2, 90, 0), + "version": (4, 35, 0), + "blender": (3, 2, 0), "location": "File > Import-Export", "description": "FBX IO meshes, UV's, vertex colors, materials, textures, cameras, lamps and actions", "warning": "", @@ -493,6 +477,11 @@ class ExportFBX(bpy.types.Operator, ExportHelper): "(will only work correctly with tris/quads only meshes!)", default=False, ) + use_triangles: BoolProperty( + name="Triangulate Faces", + description="Convert all faces to triangles", + default=False, + ) use_custom_props: BoolProperty( name="Custom Properties", description="Export custom properties", @@ -770,6 +759,7 @@ class FBX_PT_export_geometry(bpy.types.Panel): #sub.enabled = operator.use_mesh_modifiers and False # disabled in 2.8... #sub.prop(operator, "use_mesh_modifiers_render") layout.prop(operator, "use_mesh_edges") + layout.prop(operator, "use_triangles") sub = layout.row() #~ sub.enabled = operator.mesh_smooth_type in {'OFF'} sub.prop(operator, "use_tspace") diff --git a/io_scene_fbx/data_types.py b/io_scene_fbx/data_types.py index 129806c9..fa835232 100644 --- a/io_scene_fbx/data_types.py +++ b/io_scene_fbx/data_types.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_scene_fbx/encode_bin.py b/io_scene_fbx/encode_bin.py index 2023a495..80116692 100644 --- a/io_scene_fbx/encode_bin.py +++ b/io_scene_fbx/encode_bin.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py index 6e7e960b..b017a400 100644 --- a/io_scene_fbx/export_fbx_bin.py +++ b/io_scene_fbx/export_fbx_bin.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -690,6 +674,9 @@ def fbx_data_camera_elements(root, cam_obj, scene_data): # No need to convert to inches here... elem_props_template_set(tmpl, props, "p_double", b"FocalLength", cam_data.lens) elem_props_template_set(tmpl, props, "p_double", b"SafeAreaAspectRatio", aspect) + # Depth of field and Focus distance. + elem_props_template_set(tmpl, props, "p_bool", b"UseDepthOfField", cam_data.dof.use_dof) + elem_props_template_set(tmpl, props, "p_double", b"FocusDistance", cam_data.dof.focus_distance * 1000 * gscale) # Default to perspective camera. elem_props_template_set(tmpl, props, "p_enum", b"CameraProjectionType", 1 if cam_data.type == 'ORTHO' else 0) elem_props_template_set(tmpl, props, "p_double", b"OrthoZoom", cam_data.ortho_scale) @@ -1013,7 +1000,7 @@ def fbx_data_mesh_elements(root, me_obj, scene_data, done_meshes): for e in me.edges: if e.key not in edges_map: continue # Only loose edges, in theory! - # Blender squares those values before sending them to OpenSubdiv, when other softwares don't, + # Blender squares those values before sending them to OpenSubdiv, when other software don't, # so we need to compensate that to get similar results through FBX... t_ec[edges_map[e.key]] = e.crease * e.crease @@ -1874,7 +1861,7 @@ def fbx_skeleton_from_armature(scene, settings, arm_obj, objects, data_meshes, if mod.type not in {'ARMATURE'} or not mod.object: continue # We only support vertex groups binding method, not bone envelopes one! - if mod.object in {arm_obj.bdata, arm_obj.bdata.proxy} and mod.use_vertex_groups: + if mod.object == arm_obj.bdata and mod.use_vertex_groups: found = True break @@ -1939,6 +1926,7 @@ def fbx_animations_do(scene_data, ref_id, f_start, f_end, start_zero, objects=No depsgraph = scene_data.depsgraph force_keying = scene_data.settings.bake_anim_use_all_bones force_sek = scene_data.settings.bake_anim_force_startend_keying + gscale = scene_data.settings.global_scale if objects is not None: # Add bones and duplis! @@ -1985,8 +1973,10 @@ def fbx_animations_do(scene_data, ref_id, f_start, f_end, start_zero, objects=No animdata_cameras = {} for cam_obj, cam_key in scene_data.data_cameras.items(): cam = cam_obj.bdata.data - acnode = AnimationCurveNodeWrapper(cam_key, 'CAMERA_FOCAL', force_key, force_sek, (cam.lens,)) - animdata_cameras[cam_key] = (acnode, cam) + acnode_lens = AnimationCurveNodeWrapper(cam_key, 'CAMERA_FOCAL', force_key, force_sek, (cam.lens,)) + acnode_focus_distance = AnimationCurveNodeWrapper(cam_key, 'CAMERA_FOCUS_DISTANCE', force_key, + force_sek, (cam.dof.focus_distance,)) + animdata_cameras[cam_key] = (acnode_lens, acnode_focus_distance, cam) currframe = f_start while currframe <= f_end: @@ -2005,8 +1995,9 @@ def fbx_animations_do(scene_data, ref_id, f_start, f_end, start_zero, objects=No anim_scale.add_keyframe(real_currframe, scale) for anim_shape, me, shape in animdata_shapes.values(): anim_shape.add_keyframe(real_currframe, (shape.value * 100.0,)) - for anim_camera, camera in animdata_cameras.values(): - anim_camera.add_keyframe(real_currframe, (camera.lens,)) + for anim_camera_lens, anim_camera_focus_distance, camera in animdata_cameras.values(): + anim_camera_lens.add_keyframe(real_currframe, (camera.lens,)) + anim_camera_focus_distance.add_keyframe(real_currframe, (camera.dof.focus_distance * 1000 * gscale,)) currframe += bake_step scene.frame_set(back_currframe, subframe=0.0) @@ -2034,15 +2025,21 @@ def fbx_animations_do(scene_data, ref_id, f_start, f_end, start_zero, objects=No anim_data = animations.setdefault(elem_key, ("dummy_unused_key", {})) anim_data[1][fbx_group] = (group_key, group, fbx_gname) - # And cameras' lens keys. - for cam_key, (anim_camera, camera) in animdata_cameras.items(): + # And cameras' lens and focus distance keys. + for cam_key, (anim_camera_lens, anim_camera_focus_distance, camera) in animdata_cameras.items(): final_keys = {} - anim_camera.simplify(simplify_fac, bake_step, force_keep) - if not anim_camera: - continue - for elem_key, group_key, group, fbx_group, fbx_gname in anim_camera.get_final_data(scene, ref_id, force_keep): - anim_data = animations.setdefault(elem_key, ("dummy_unused_key", {})) - anim_data[1][fbx_group] = (group_key, group, fbx_gname) + anim_camera_lens.simplify(simplify_fac, bake_step, force_keep) + anim_camera_focus_distance.simplify(simplify_fac, bake_step, force_keep) + if anim_camera_lens: + for elem_key, group_key, group, fbx_group, fbx_gname in \ + anim_camera_lens.get_final_data(scene, ref_id, force_keep): + anim_data = animations.setdefault(elem_key, ("dummy_unused_key", {})) + anim_data[1][fbx_group] = (group_key, group, fbx_gname) + if anim_camera_focus_distance: + for elem_key, group_key, group, fbx_group, fbx_gname in \ + anim_camera_focus_distance.get_final_data(scene, ref_id, force_keep): + anim_data = animations.setdefault(elem_key, ("dummy_unused_key", {})) + anim_data[1][fbx_group] = (group_key, group, fbx_gname) astack_key = get_blender_anim_stack_key(scene, ref_id) alayer_key = get_blender_anim_layer_key(scene, ref_id) @@ -2269,12 +2266,14 @@ def fbx_data_from_scene(scene, depsgraph, settings): is_ob_material = any(ms.link == 'OBJECT' for ms in ob.material_slots) - if settings.use_mesh_modifiers or ob.type in BLENDER_OTHER_OBJECT_TYPES or is_ob_material: + if settings.use_mesh_modifiers or settings.use_triangles or ob.type in BLENDER_OTHER_OBJECT_TYPES or is_ob_material: # We cannot use default mesh in that case, or material would not be the right ones... use_org_data = not (is_ob_material or ob.type in BLENDER_OTHER_OBJECT_TYPES) backup_pose_positions = [] tmp_mods = [] if use_org_data and ob.type == 'MESH': + if settings.use_triangles: + use_org_data = False # No need to create a new mesh in this case, if no modifier is active! last_subsurf = None for mod in ob.modifiers: @@ -2319,6 +2318,14 @@ def fbx_data_from_scene(scene, depsgraph, settings): # free them afterwards. Not ideal but ensures correct ownerwhip. tmp_me = bpy.data.meshes.new_from_object( ob_to_convert, preserve_all_data_layers=True, depsgraph=depsgraph) + # Triangulate the mesh if requested + if settings.use_triangles: + import bmesh + bm = bmesh.new() + bm.from_mesh(tmp_me) + bmesh.ops.triangulate(bm, faces=bm.faces) + bm.to_mesh(tmp_me) + bm.free() data_meshes[ob_obj] = (get_blenderID_key(tmp_me), tmp_me, True) # Change armatures back. for armature, pose_position in backup_pose_positions: @@ -3011,6 +3018,7 @@ def save_single(operator, scene, depsgraph, filepath="", path_mode='AUTO', use_mesh_edges=True, use_tspace=True, + use_triangles=False, embed_textures=False, use_custom_props=False, bake_space_transform=False, @@ -3077,7 +3085,7 @@ def save_single(operator, scene, depsgraph, filepath="", operator.report, (axis_up, axis_forward), global_matrix, global_scale, apply_unit_scale, unit_scale, bake_space_transform, global_matrix_inv, global_matrix_inv_transposed, context_objects, object_types, use_mesh_modifiers, use_mesh_modifiers_render, - mesh_smooth_type, use_subsurf, use_mesh_edges, use_tspace, + mesh_smooth_type, use_subsurf, use_mesh_edges, use_tspace, use_triangles, armature_nodetype, use_armature_deform_only, add_leaf_bones, bone_correction_matrix, bone_correction_matrix_inv, bake_anim, bake_anim_use_all_bones, bake_anim_use_nla_strips, bake_anim_use_all_actions, @@ -3151,6 +3159,7 @@ def defaults_unity3d(): "mesh_smooth_type": 'FACE', "use_subsurf": False, "use_tspace": False, # XXX Why? Unity is expected to support tspace import... + "use_triangles": False, "use_armature_deform_only": True, diff --git a/io_scene_fbx/fbx2json.py b/io_scene_fbx/fbx2json.py index c5d47ade..70cdcc84 100755 --- a/io_scene_fbx/fbx2json.py +++ b/io_scene_fbx/fbx2json.py @@ -1,21 +1,5 @@ #!/usr/bin/env python3 -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_scene_fbx/fbx_utils.py b/io_scene_fbx/fbx_utils.py index 3a421423..680ee387 100644 --- a/io_scene_fbx/fbx_utils.py +++ b/io_scene_fbx/fbx_utils.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -735,6 +719,7 @@ class AnimationCurveNodeWrapper: 'LCL_SCALING': ("Lcl Scaling", "S", ("X", "Y", "Z")), 'SHAPE_KEY': ("DeformPercent", "DeformPercent", ("DeformPercent",)), 'CAMERA_FOCAL': ("FocalLength", "FocalLength", ("FocalLength",)), + 'CAMERA_FOCUS_DISTANCE': ("FocusDistance", "FocusDistance", ("FocusDistance",)), } def __init__(self, elem_key, kind, force_keying, force_startend_keying, default_values=...): @@ -1197,7 +1182,7 @@ class ObjectWrapper(metaclass=MetaObjectWrapper): if self.parent == arm_obj and self.bdata.parent_type == 'ARMATURE': return True for mod in self.bdata.modifiers: - if mod.type == 'ARMATURE' and mod.object in {arm_obj.bdata, arm_obj.bdata.proxy}: + if mod.type == 'ARMATURE' and mod.object == arm_obj.bdata: return True # #### Duplis... @@ -1225,7 +1210,7 @@ FBXExportSettings = namedtuple("FBXExportSettings", ( "report", "to_axes", "global_matrix", "global_scale", "apply_unit_scale", "unit_scale", "bake_space_transform", "global_matrix_inv", "global_matrix_inv_transposed", "context_objects", "object_types", "use_mesh_modifiers", "use_mesh_modifiers_render", - "mesh_smooth_type", "use_subsurf", "use_mesh_edges", "use_tspace", + "mesh_smooth_type", "use_subsurf", "use_mesh_edges", "use_tspace", "use_triangles", "armature_nodetype", "use_armature_deform_only", "add_leaf_bones", "bone_correction_matrix", "bone_correction_matrix_inv", "bake_anim", "bake_anim_use_all_bones", "bake_anim_use_nla_strips", "bake_anim_use_all_actions", diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py index 1978797e..bf5641ca 100644 --- a/io_scene_fbx/import_fbx.py +++ b/io_scene_fbx/import_fbx.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -565,7 +549,7 @@ def blen_read_animations_curves_iter(fbx_curves, blen_start_offset, fbx_start_of yield (curr_blenkframe, curr_values) -def blen_read_animations_action_item(action, item, cnodes, fps, anim_offset): +def blen_read_animations_action_item(action, item, cnodes, fps, anim_offset, global_scale): """ 'Bake' loc/rot/scale into the action, taking any pre_ and post_ matrix into account to transform from fbx into blender space. @@ -599,7 +583,7 @@ def blen_read_animations_action_item(action, item, cnodes, fps, anim_offset): elif isinstance(item, ShapeKey): props = [(item.path_from_id("value"), 1, "Key")] elif isinstance(item, Camera): - props = [(item.path_from_id("lens"), 1, "Camera")] + props = [(item.path_from_id("lens"), 1, "Camera"), (item.dof.path_from_id("focus_distance"), 1, "Camera")] else: # Object or PoseBone: if item.is_bone: bl_obj = item.bl_obj.pose.bones[item.bl_bone] @@ -607,7 +591,7 @@ def blen_read_animations_action_item(action, item, cnodes, fps, anim_offset): bl_obj = item.bl_obj # We want to create actions for objects, but for bones we 'reuse' armatures' actions! - grpname = item.bl_obj.name + grpname = bl_obj.name # Since we might get other channels animated in the end, due to all FBX transform magic, # we need to add curves for whole loc/rot/scale in any case. @@ -649,13 +633,17 @@ def blen_read_animations_action_item(action, item, cnodes, fps, anim_offset): elif isinstance(item, Camera): for frame, values in blen_read_animations_curves_iter(fbx_curves, anim_offset, 0, fps): - value = 0.0 + focal_length = 0.0 + focus_distance = 0.0 for v, (fbxprop, channel, _fbx_acdata) in values: - assert(fbxprop == b'FocalLength') + assert(fbxprop == b'FocalLength' or fbxprop == b'FocusDistance' ) assert(channel == 0) - value = v + if (fbxprop == b'FocalLength' ): + focal_length = v + elif(fbxprop == b'FocusDistance'): + focus_distance = v / 1000 * global_scale - for fc, v in zip(blen_curves, (value,)): + for fc, v in zip(blen_curves, (focal_length, focus_distance)): store_keyframe(fc, frame, v) else: # Object or PoseBone: @@ -731,7 +719,7 @@ def blen_read_animations_action_item(action, item, cnodes, fps, anim_offset): fc.update() -def blen_read_animations(fbx_tmpl_astack, fbx_tmpl_alayer, stacks, scene, anim_offset): +def blen_read_animations(fbx_tmpl_astack, fbx_tmpl_alayer, stacks, scene, anim_offset, global_scale): """ Recreate an action per stack/layer/object combinations. Only the first found action is linked to objects, more complex setups are not handled, @@ -776,7 +764,7 @@ def blen_read_animations(fbx_tmpl_astack, fbx_tmpl_alayer, stacks, scene, anim_o if not id_data.animation_data.action: id_data.animation_data.action = action # And actually populate the action! - blen_read_animations_action_item(action, item, cnodes, scene.render.fps, anim_offset) + blen_read_animations_action_item(action, item, cnodes, scene.render.fps, anim_offset, global_scale) # ---- @@ -1125,7 +1113,7 @@ def blen_read_geom_layer_smooth(fbx_obj, mesh): return False if fbx_layer_mapping == b'ByEdge': - # some models have bad edge data, we cant use this info... + # some models have bad edge data, we can't use this info... if not mesh.edges: print("warning skipping sharp edges data, no valid edges...") return False @@ -1174,13 +1162,13 @@ def blen_read_geom_layer_edge_crease(fbx_obj, mesh): layer_id = b'EdgeCrease' fbx_layer_data = elem_prop_first(elem_find_first(fbx_layer, layer_id)) - # some models have bad edge data, we cant use this info... + # some models have bad edge data, we can't use this info... if not mesh.edges: print("warning skipping edge crease data, no valid edges...") return False if fbx_layer_mapping == b'ByEdge': - # some models have bad edge data, we cant use this info... + # some models have bad edge data, we can't use this info... if not mesh.edges: print("warning skipping edge crease data, no valid edges...") return False @@ -1191,7 +1179,7 @@ def blen_read_geom_layer_edge_crease(fbx_obj, mesh): fbx_layer_data, None, fbx_layer_mapping, fbx_layer_ref, 1, 1, layer_id, - # Blender squares those values before sending them to OpenSubdiv, when other softwares don't, + # Blender squares those values before sending them to OpenSubdiv, when other software don't, # so we need to compensate that to get similar results through FBX... xform=sqrt, ) @@ -1443,9 +1431,9 @@ def blen_read_material(fbx_tmpl, fbx_obj, settings): # No specular color in Principled BSDF shader, assumed to be either white or take some tint from diffuse one... # TODO: add way to handle tint option (guesstimate from spec color + intensity...)? ma_wrap.specular = elem_props_get_number(fbx_props, b'SpecularFactor', 0.25) * 2.0 - # XXX Totally empirical conversion, trying to adapt it - # (from 1.0 - 0.0 Principled BSDF range to 0.0 - 100.0 FBX shininess range)... - fbx_shininess = elem_props_get_number(fbx_props, b'Shininess', 20.0) + # XXX Totally empirical conversion, trying to adapt it (and protect against invalid negative values, see T96076): + # From [1.0 - 0.0] Principled BSDF range to [0.0 - 100.0] FBX shininess range)... + fbx_shininess = max(elem_props_get_number(fbx_props, b'Shininess', 20.0), 0.0) ma_wrap.roughness = 1.0 - (sqrt(fbx_shininess) / 10.0) # Sweetness... Looks like we are not the only ones to not know exactly how FBX is supposed to work (see T59850). # According to one of its developers, Unity uses that formula to extract alpha value: @@ -1559,6 +1547,10 @@ def blen_read_camera(fbx_tmpl, fbx_obj, global_scale): camera.type = 'ORTHO' if elem_props_get_enum(fbx_props, b'CameraProjectionType', 0) == 1 else 'PERSP' + camera.dof.focus_distance = elem_props_get_number(fbx_props, b'FocusDistance', 10 * 1000) / 1000 * global_scale + if (elem_props_get_bool(fbx_props, b'UseDepthOfField', False)): + camera.dof.use_dof = True + camera.lens = elem_props_get_number(fbx_props, b'FocalLength', 35.0) camera.sensor_width = elem_props_get_number(fbx_props, b'FilmWidth', 32.0 * M2I) / M2I camera.sensor_height = elem_props_get_number(fbx_props, b'FilmHeight', 32.0 * M2I) / M2I @@ -2674,7 +2666,7 @@ def load(operator, context, filepath="", def connection_filter_ex(fbx_uuid, fbx_id, dct): return [(c_found[0], c_found[1], c_type) for (c_uuid, c_type) in dct.get(fbx_uuid, ()) - # 0 is used for the root node, which isnt in fbx_table_nodes + # 0 is used for the root node, which isn't in fbx_table_nodes for c_found in (() if c_uuid == 0 else (fbx_table_nodes.get(c_uuid, (None, None)),)) if (fbx_id is None) or (c_found[0] and c_found[0].id == fbx_id)] @@ -3005,6 +2997,13 @@ def load(operator, context, filepath="", continue cam = fbx_item[1] items.append((cam, lnk_prop)) + elif lnk_prop == b'FocusDistance': # Camera focus. + from bpy.types import Camera + fbx_item = fbx_table_nodes.get(n_uuid, None) + if fbx_item is None or not isinstance(fbx_item[1], Camera): + continue + cam = fbx_item[1] + items.append((cam, lnk_prop)) elif lnk_prop == b'DiffuseColor': from bpy.types import Material fbx_item = fbx_table_nodes.get(n_uuid, None) @@ -3043,14 +3042,15 @@ def load(operator, context, filepath="", channel = { b'd|X': 0, b'd|Y': 1, b'd|Z': 2, b'd|DeformPercent': 0, - b'd|FocalLength': 0 + b'd|FocalLength': 0, + b'd|FocusDistance': 0 }.get(acn_ctype.props[3], None) if channel is None: continue curvenodes[acn_uuid][ac_uuid] = (fbx_acitem, channel) # And now that we have sorted all this, apply animations! - blen_read_animations(fbx_tmpl_astack, fbx_tmpl_alayer, stacks, scene, settings.anim_offset) + blen_read_animations(fbx_tmpl_astack, fbx_tmpl_alayer, stacks, scene, settings.anim_offset, global_scale) _(); del _ diff --git a/io_scene_fbx/json2fbx.py b/io_scene_fbx/json2fbx.py index 579b45a7..5e8d177e 100755 --- a/io_scene_fbx/json2fbx.py +++ b/io_scene_fbx/json2fbx.py @@ -1,21 +1,5 @@ #!/usr/bin/env python3 -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_scene_fbx/parse_fbx.py b/io_scene_fbx/parse_fbx.py index 634c4d93..43ae255f 100644 --- a/io_scene_fbx/parse_fbx.py +++ b/io_scene_fbx/parse_fbx.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py index ad899ca6..9bb1939f 100755 --- a/io_scene_gltf2/__init__.py +++ b/io_scene_gltf2/__init__.py @@ -1,21 +1,10 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. bl_info = { 'name': 'glTF 2.0 format', 'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors', - "version": (1, 8, 19), + "version": (3, 2, 21), 'blender': (3, 1, 0), 'location': 'File > Import-Export', 'description': 'Import-Export as glTF 2.0', @@ -298,13 +287,6 @@ class ExportGLTF2_Base: default=False ) - # keep it for compatibility (for now) - export_selected: BoolProperty( - name='Selected Objects', - description='Export selected objects only', - default=False - ) - use_selection: BoolProperty( name='Selected Objects', description='Export selected objects only', @@ -393,8 +375,8 @@ class ExportGLTF2_Base: optimize_animation_size: BoolProperty( name='Optimize Animation Size', description=( - "Reduces exported filesize by removing duplicate keyframes" - "Can cause problems with stepped animation" + "Reduce exported file-size by removing duplicate keyframes" + "(can cause problems with stepped animation)" ), default=True ) @@ -473,11 +455,6 @@ class ExportGLTF2_Base: self.will_save_settings = False if settings: try: - if 'export_selected' in settings.keys(): # Back compatibility for export_selected --> use_selection - setattr(self, "use_selection", settings['export_selected']) - settings["use_selection"] = settings['export_selected'] - del settings['export_selected'] - print("export_selected is now renamed use_selection, and will be deleted in a few release") for (k, v) in settings.items(): setattr(self, k, v) self.will_save_settings = True @@ -514,8 +491,6 @@ class ExportGLTF2_Base: x: getattr(self, x) for x in dir(all_props) if (x.startswith("export_") or x in exceptional) and all_props.get(x) is not None } - if 'export_selected' in export_props.keys(): - del export_props['export_selected'] # Do not save this property, only here for backward compatibility context.scene[self.scene_key] = export_props def execute(self, context): @@ -565,18 +540,12 @@ class ExportGLTF2_Base: export_settings['gltf_colors'] = self.export_colors export_settings['gltf_cameras'] = self.export_cameras - # compatibility after renaming export_selected to use_selection - if self.export_selected is True: - self.report({"WARNING"}, "export_selected is now renamed use_selection, and will be deleted in a few release") - export_settings['gltf_selected'] = self.export_selected - else: - export_settings['gltf_selected'] = self.use_selection export_settings['gltf_visible'] = self.use_visible export_settings['gltf_renderable'] = self.use_renderable export_settings['gltf_active_collection'] = self.use_active_collection - # export_settings['gltf_selected'] = self.use_selection This can be uncomment when removing compatibility of export_selected + export_settings['gltf_selected'] = self.use_selection export_settings['gltf_layers'] = True # self.export_layers export_settings['gltf_extras'] = self.export_extras export_settings['gltf_yup'] = self.export_yup @@ -890,6 +859,8 @@ class GLTF_PT_export_animation_export(bpy.types.Panel): row = layout.row() row.active = operator.export_force_sampling row.prop(operator, 'export_def_bones') + if operator.export_force_sampling is False and operator.export_def_bones is True: + layout.label(text="Export only deformation bones is not possible when not sampling animation") class GLTF_PT_export_animation_shapekeys(bpy.types.Panel): @@ -1180,6 +1151,20 @@ class ImportGLTF2(Operator, ImportHelper): self.loglevel = logging.NOTSET +class GLTF_AddonPreferences(bpy.types.AddonPreferences): + bl_idname = __package__ + + settings_node_ui : bpy.props.BoolProperty( + default= False, + description="Displays glTF Settings node in Shader Editor (Menu Add > Ouput)" + ) + + + def draw(self, context): + layout = self.layout + row = layout.row() + row.prop(self, "settings_node_ui", text="Shader Editor Add-ons") + def menu_func_import(self, context): self.layout.operator(ImportGLTF2.bl_idname, text='glTF 2.0 (.glb/.gltf)') @@ -1197,21 +1182,26 @@ classes = ( GLTF_PT_export_animation_skinning, GLTF_PT_export_user_extensions, ImportGLTF2, - GLTF_PT_import_user_extensions + GLTF_PT_import_user_extensions, + GLTF_AddonPreferences ) def register(): + import io_scene_gltf2.blender.com.gltf2_blender_ui as blender_ui for c in classes: bpy.utils.register_class(c) # bpy.utils.register_module(__name__) + blender_ui.register() + # add to the export / import menu bpy.types.TOPBAR_MT_file_export.append(menu_func_export) bpy.types.TOPBAR_MT_file_import.append(menu_func_import) def unregister(): + import io_scene_gltf2.blender.com.gltf2_blender_ui as blender_ui for c in classes: bpy.utils.unregister_class(c) for f in exporter_extension_panel_unregister_functors: @@ -1222,6 +1212,8 @@ def unregister(): f() importer_extension_panel_unregister_functors.clear() + blender_ui.unregister() + # bpy.utils.unregister_module(__name__) # remove from the export / import menu diff --git a/io_scene_gltf2/blender/com/gltf2_blender_conversion.py b/io_scene_gltf2/blender/com/gltf2_blender_conversion.py index 7f4e69fb..ecb91c8f 100755 --- a/io_scene_gltf2/blender/com/gltf2_blender_conversion.py +++ b/io_scene_gltf2/blender/com/gltf2_blender_conversion.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. from math import sin, cos diff --git a/io_scene_gltf2/blender/com/gltf2_blender_data_path.py b/io_scene_gltf2/blender/com/gltf2_blender_data_path.py index 64e0fea0..9f238da7 100755 --- a/io_scene_gltf2/blender/com/gltf2_blender_data_path.py +++ b/io_scene_gltf2/blender/com/gltf2_blender_data_path.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. def get_target_property_name(data_path: str) -> str: diff --git a/io_scene_gltf2/blender/com/gltf2_blender_extras.py b/io_scene_gltf2/blender/com/gltf2_blender_extras.py index 6c93e7b4..756ea3c9 100644 --- a/io_scene_gltf2/blender/com/gltf2_blender_extras.py +++ b/io_scene_gltf2/blender/com/gltf2_blender_extras.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy diff --git a/io_scene_gltf2/blender/com/gltf2_blender_json.py b/io_scene_gltf2/blender/com/gltf2_blender_json.py index 9b4ea75a..c2e1657b 100755 --- a/io_scene_gltf2/blender/com/gltf2_blender_json.py +++ b/io_scene_gltf2/blender/com/gltf2_blender_json.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import json import bpy diff --git a/io_scene_gltf2/blender/com/gltf2_blender_material_helpers.py b/io_scene_gltf2/blender/com/gltf2_blender_material_helpers.py index e5499e3e..7b90b0a3 100755 --- a/io_scene_gltf2/blender/com/gltf2_blender_material_helpers.py +++ b/io_scene_gltf2/blender/com/gltf2_blender_material_helpers.py @@ -1,17 +1,15 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +import bpy def get_gltf_node_name(): return "glTF Settings" + +def create_settings_group(name): + gltf_node_group = bpy.data.node_groups.new(name, 'ShaderNodeTree') + gltf_node_group.inputs.new("NodeSocketFloat", "Occlusion") + gltf_node_group.nodes.new('NodeGroupOutput') + gltf_node_group_input = gltf_node_group.nodes.new('NodeGroupInput') + gltf_node_group_input.location = -200, 0 + return gltf_node_group
\ No newline at end of file diff --git a/io_scene_gltf2/blender/com/gltf2_blender_math.py b/io_scene_gltf2/blender/com/gltf2_blender_math.py index 9dcae661..d2a018a8 100755 --- a/io_scene_gltf2/blender/com/gltf2_blender_math.py +++ b/io_scene_gltf2/blender/com/gltf2_blender_math.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import typing import math @@ -109,7 +98,7 @@ def swizzle_yup_value(value: typing.Any) -> typing.Any: return value -def transform(v: typing.Union[Vector, Quaternion], data_path: str, transform: Matrix = Matrix.Identity(4)) -> typing \ +def transform(v: typing.Union[Vector, Quaternion], data_path: str, transform: Matrix = Matrix.Identity(4), need_rotation_correction: bool = False) -> typing \ .Union[Vector, Quaternion]: """Manage transformations.""" target = get_target_property_name(data_path) @@ -127,25 +116,31 @@ def transform(v: typing.Union[Vector, Quaternion], data_path: str, transform: Ma if transform_func is None: raise RuntimeError("Cannot transform values at {}".format(data_path)) - return transform_func(v, transform) + return transform_func(v, transform, need_rotation_correction) -def transform_location(location: Vector, transform: Matrix = Matrix.Identity(4)) -> Vector: +def transform_location(location: Vector, transform: Matrix = Matrix.Identity(4), need_rotation_correction:bool = False) -> Vector: """Transform location.""" + correction = Quaternion((2**0.5/2, -2**0.5/2, 0.0, 0.0)) m = Matrix.Translation(location) + if need_rotation_correction: + m @= correction.to_matrix().to_4x4() m = transform @ m return m.to_translation() -def transform_rotation(rotation: Quaternion, transform: Matrix = Matrix.Identity(4)) -> Quaternion: +def transform_rotation(rotation: Quaternion, transform: Matrix = Matrix.Identity(4), need_rotation_correction: bool = False) -> Quaternion: """Transform rotation.""" rotation.normalize() + correction = Quaternion((2**0.5/2, -2**0.5/2, 0.0, 0.0)) m = rotation.to_matrix().to_4x4() + if need_rotation_correction: + m @= correction.to_matrix().to_4x4() m = transform @ m return m.to_quaternion() -def transform_scale(scale: Vector, transform: Matrix = Matrix.Identity(4)) -> Vector: +def transform_scale(scale: Vector, transform: Matrix = Matrix.Identity(4), need_rotation_correction: bool = False) -> Vector: """Transform scale.""" m = Matrix.Identity(4) m[0][0] = scale.x @@ -156,7 +151,7 @@ def transform_scale(scale: Vector, transform: Matrix = Matrix.Identity(4)) -> Ve return m.to_scale() -def transform_value(value: Vector, _: Matrix = Matrix.Identity(4)) -> Vector: +def transform_value(value: Vector, _: Matrix = Matrix.Identity(4), need_rotation_correction: bool = False) -> Vector: """Transform value.""" return value diff --git a/io_scene_gltf2/blender/com/gltf2_blender_ui.py b/io_scene_gltf2/blender/com/gltf2_blender_ui.py new file mode 100644 index 00000000..59c364fb --- /dev/null +++ b/io_scene_gltf2/blender/com/gltf2_blender_ui.py @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright 2018-2022 The glTF-Blender-IO authors. + +import bpy +from ..com.gltf2_blender_material_helpers import get_gltf_node_name, create_settings_group + +def create_gltf_ao_group(operator, group_name): + + # create a new group + gltf_ao_group = bpy.data.node_groups.new(group_name, "ShaderNodeTree") + + return gltf_ao_group + +class NODE_OT_GLTF_SETTINGS(bpy.types.Operator): + bl_idname = "node.gltf_settings_node_operator" + bl_label = "glTF Settings" + + + @classmethod + def poll(cls, context): + space = context.space_data + return space.type == "NODE_EDITOR" \ + and context.object and context.object.active_material \ + and context.object.active_material.use_nodes is True \ + and bpy.context.preferences.addons['io_scene_gltf2'].preferences.settings_node_ui is True + + def execute(self, context): + gltf_settings_node_name = get_gltf_node_name() + if gltf_settings_node_name in bpy.data.node_groups: + my_group = bpy.data.node_groups[get_gltf_node_name()] + else: + my_group = create_settings_group(gltf_settings_node_name) + node_tree = context.object.active_material.node_tree + new_node = node_tree.nodes.new("ShaderNodeGroup") + new_node.node_tree = bpy.data.node_groups[my_group.name] + return {"FINISHED"} + + +def add_gltf_settings_to_menu(self, context) : + if bpy.context.preferences.addons['io_scene_gltf2'].preferences.settings_node_ui is True: + self.layout.operator("node.gltf_settings_node_operator") + + +def register(): + bpy.utils.register_class(NODE_OT_GLTF_SETTINGS) + bpy.types.NODE_MT_category_SH_NEW_OUTPUT.append(add_gltf_settings_to_menu) + +def unregister(): + bpy.utils.unregister_class(NODE_OT_GLTF_SETTINGS) diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_export.py b/io_scene_gltf2/blender/exp/gltf2_blender_export.py index dc04fad2..539c6b74 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_export.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_export.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import time import bpy @@ -76,6 +65,8 @@ def __export(export_settings): def __gather_gltf(exporter, export_settings): active_scene_idx, scenes, animations = gltf2_blender_gather.gather_gltf2(export_settings) + unused_skins = export_settings['vtree'].get_unused_skins() + if export_settings['gltf_draco_mesh_compression']: gltf2_io_draco_compression_extension.encode_scene_primitives(scenes, export_settings) exporter.add_draco_extension() @@ -86,6 +77,7 @@ def __gather_gltf(exporter, export_settings): exporter.add_scene(scene, idx==active_scene_idx) for animation in animations: exporter.add_animation(animation) + exporter.traverse_unused_skins(unused_skins) def __create_buffer(exporter, export_settings): diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_export_keys.py b/io_scene_gltf2/blender/exp/gltf2_blender_export_keys.py index ea7b4361..812db3f9 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_export_keys.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_export_keys.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. FILTERED_VERTEX_GROUPS = 'filtered_vertex_groups' FILTERED_MESHES = 'filtered_meshes' @@ -30,6 +19,7 @@ VISIBLE = 'gltf_visible' RENDERABLE = 'gltf_renderable' ACTIVE_COLLECTION = 'gltf_active_collection' SKINS = 'gltf_skins' +DEF_BONES_ONLY = 'gltf_def_bones' DISPLACEMENT = 'gltf_displacement' FORCE_SAMPLING = 'gltf_force_sampling' FRAME_RANGE = 'gltf_frame_range' diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_extract.py b/io_scene_gltf2/blender/exp/gltf2_blender_extract.py index f7318c2b..98e2ac19 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_extract.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_extract.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import numpy as np from mathutils import Vector @@ -20,10 +9,14 @@ from ...io.com.gltf2_io_debug import print_console from io_scene_gltf2.blender.exp import gltf2_blender_gather_skins -def extract_primitives(glTF, blender_mesh, library, blender_object, blender_vertex_groups, modifiers, export_settings): +def extract_primitives(blender_mesh, uuid_for_skined_data, blender_vertex_groups, modifiers, export_settings): """Extract primitives from a mesh.""" print_console('INFO', 'Extracting primitive: ' + blender_mesh.name) + blender_object = None + if uuid_for_skined_data: + blender_object = export_settings['vtree'].nodes[uuid_for_skined_data].blender_object + use_normals = export_settings[gltf2_blender_export_keys.NORMALS] if use_normals: blender_mesh.calc_normals_split() @@ -68,7 +61,7 @@ def extract_primitives(glTF, blender_mesh, library, blender_object, blender_vert armature = None if armature: - skin = gltf2_blender_gather_skins.gather_skin(armature, export_settings) + skin = gltf2_blender_gather_skins.gather_skin(export_settings['vtree'].nodes[uuid_for_skined_data].armature, export_settings) if not skin: armature = None @@ -89,7 +82,14 @@ def extract_primitives(glTF, blender_mesh, library, blender_object, blender_vert locs, morph_locs = __get_positions(blender_mesh, key_blocks, armature, blender_object, export_settings) if skin: - vert_bones, num_joint_sets = __get_bone_data(blender_mesh, skin, blender_vertex_groups) + vert_bones, num_joint_sets, need_neutral_bone = __get_bone_data(blender_mesh, skin, blender_vertex_groups) + if need_neutral_bone is True: + # Need to create a fake joint at root of armature + # In order to assign not assigned vertices to it + # But for now, this is not yet possible, we need to wait the armature node is created + # Just store this, to be used later + armature_uuid = export_settings['vtree'].nodes[uuid_for_skined_data].armature + export_settings['vtree'].nodes[armature_uuid].need_neutral_bone = True # In Blender there is both per-vert data, like position, and also per-loop # (loop=corner-of-poly) data, like normals or UVs. glTF only has per-vert @@ -542,6 +542,9 @@ def __get_colors(blender_mesh, color_i): def __get_bone_data(blender_mesh, skin, blender_vertex_groups): + + need_neutral_bone = False + joint_name_to_index = {joint.name: index for index, joint in enumerate(skin.joints)} group_to_joint = [joint_name_to_index.get(g.name) for g in blender_vertex_groups] @@ -564,7 +567,10 @@ def __get_bone_data(blender_mesh, skin, blender_vertex_groups): continue bones.append((joint, weight)) bones.sort(key=lambda x: x[1], reverse=True) - if not bones: bones = ((0, 1.0),) # HACK for verts with zero weight (#308) + if not bones: + # Is not assign to any bone + bones = ((len(skin.joints), 1.0),) # Assign to a joint that will be created later + need_neutral_bone = True vert_bones.append(bones) if len(bones) > max_num_influences: max_num_influences = len(bones) @@ -572,7 +578,7 @@ def __get_bone_data(blender_mesh, skin, blender_vertex_groups): # How many joint sets do we need? 1 set = 4 influences num_joint_sets = (max_num_influences + 3) // 4 - return vert_bones, num_joint_sets + return vert_bones, num_joint_sets, need_neutral_bone def __zup2yup(array): diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather.py index 6f68c19e..b3f4fd2a 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy @@ -18,10 +7,12 @@ from io_scene_gltf2.io.com import gltf2_io from io_scene_gltf2.io.com.gltf2_io_debug import print_console from io_scene_gltf2.blender.exp import gltf2_blender_gather_nodes from io_scene_gltf2.blender.exp import gltf2_blender_gather_animations +from io_scene_gltf2.blender.exp import gltf2_blender_gather_animation_sampler_keyframes from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import cached from ..com.gltf2_blender_extras import generate_extras from io_scene_gltf2.blender.exp import gltf2_blender_export_keys from io_scene_gltf2.io.exp.gltf2_io_user_extensions import export_user_extensions +from io_scene_gltf2.blender.exp import gltf2_blender_gather_tree def gather_gltf2(export_settings): @@ -33,12 +24,18 @@ def gather_gltf2(export_settings): scenes = [] animations = [] # unfortunately animations in gltf2 are just as 'root' as scenes. active_scene = None + store_user_scene = bpy.context.scene for blender_scene in bpy.data.scenes: scenes.append(__gather_scene(blender_scene, export_settings)) if export_settings[gltf2_blender_export_keys.ANIMATIONS]: + # resetting object cache + gltf2_blender_gather_animation_sampler_keyframes.get_object_matrix.reset_cache() animations += __gather_animations(blender_scene, export_settings) if bpy.context.scene.name == blender_scene.name: active_scene = len(scenes) -1 + + # restore user scene + bpy.context.window.scene = store_user_scene return active_scene, scenes, animations @@ -51,15 +48,27 @@ def __gather_scene(blender_scene, export_settings): nodes=[] ) - for _blender_object in [obj for obj in blender_scene.objects if obj.proxy is None]: - if _blender_object.parent is None: - blender_object = _blender_object.proxy if _blender_object.proxy else _blender_object - node = gltf2_blender_gather_nodes.gather_node( - blender_object, - blender_object.library.name if blender_object.library else None, - blender_scene, None, export_settings) - if node is not None: - scene.nodes.append(node) + + vtree = gltf2_blender_gather_tree.VExportTree(export_settings) + vtree.construct(blender_scene) + vtree.search_missing_armature() # In case armature are no parented correctly + + export_user_extensions('vtree_before_filter_hook', export_settings, vtree) + + # Now, we can filter tree if needed + vtree.filter() + + export_user_extensions('vtree_after_filter_hook', export_settings, vtree) + + export_settings['vtree'] = vtree + + for r in [vtree.nodes[r] for r in vtree.roots]: + node = gltf2_blender_gather_nodes.gather_node( + r, export_settings) + if node is not None: + scene.nodes.append(node) + + vtree.add_neutral_bones() export_user_extensions('gather_scene_hook', export_settings, scene, blender_scene) @@ -70,18 +79,16 @@ def __gather_animations(blender_scene, export_settings): animations = [] merged_tracks = {} - for _blender_object in blender_scene.objects: + vtree = export_settings['vtree'] + for obj_uuid in vtree.get_all_objects(): + blender_object = vtree.nodes[obj_uuid].blender_object - blender_object = _blender_object.proxy if _blender_object.proxy else _blender_object + # Do not manage not exported objects + if vtree.nodes[obj_uuid].node is None: + continue - # First check if this object is exported or not. Do not export animation of not exported object - obj_node = gltf2_blender_gather_nodes.gather_node(blender_object, - blender_object.library.name if blender_object.library else None, - blender_scene, None, export_settings) - if obj_node is not None: - # Check was done on armature, but use here the _proxy object, because this is where the animation is - animations_, merged_tracks = gltf2_blender_gather_animations.gather_animations(_blender_object, merged_tracks, len(animations), export_settings) - animations += animations_ + animations_, merged_tracks = gltf2_blender_gather_animations.gather_animations(obj_uuid, merged_tracks, len(animations), export_settings) + animations += animations_ if export_settings['gltf_nla_strips'] is False: # Fake an animation with all animations of the scene diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_accessors.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_accessors.py index 4fa3700b..ecc053cd 100644 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_accessors.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_accessors.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import cached diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channel_target.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channel_target.py index 890ce0ab..0e542de8 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channel_target.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channel_target.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy @@ -23,18 +12,20 @@ from io_scene_gltf2.blender.exp import gltf2_blender_gather_skins from io_scene_gltf2.io.exp.gltf2_io_user_extensions import export_user_extensions @cached -def gather_animation_channel_target(channels: typing.Tuple[bpy.types.FCurve], - blender_object: bpy.types.Object, +def gather_animation_channel_target(obj_uuid: int, + channels: typing.Tuple[bpy.types.FCurve], bake_bone: typing.Union[str, None], bake_channel: typing.Union[str, None], - driver_obj, + driver_obj_uuid, export_settings ) -> gltf2_io.AnimationChannelTarget: + blender_object = export_settings['vtree'].nodes[obj_uuid].blender_object + animation_channel_target = gltf2_io.AnimationChannelTarget( extensions=__gather_extensions(channels, blender_object, export_settings, bake_bone), extras=__gather_extras(channels, blender_object, export_settings, bake_bone), - node=__gather_node(channels, blender_object, export_settings, bake_bone, driver_obj), + node=__gather_node(channels, obj_uuid, export_settings, bake_bone, driver_obj_uuid), path=__gather_path(channels, blender_object, export_settings, bake_bone, bake_channel) ) @@ -65,16 +56,16 @@ def __gather_extras(channels: typing.Tuple[bpy.types.FCurve], def __gather_node(channels: typing.Tuple[bpy.types.FCurve], - blender_object: bpy.types.Object, + obj_uuid: str, export_settings, bake_bone: typing.Union[str, None], - driver_obj + driver_obj_uuid ) -> gltf2_io.Node: - if driver_obj is not None: - return gltf2_blender_gather_nodes.gather_node(driver_obj, - driver_obj.library.name if driver_obj.library else None, - None, None, export_settings) + blender_object = export_settings['vtree'].nodes[obj_uuid].blender_object + + if driver_obj_uuid is not None: + return export_settings['vtree'].nodes[driver_obj_uuid].node if blender_object.type == "ARMATURE": # TODO: get joint from fcurve data_path and gather_joint @@ -85,18 +76,9 @@ def __gather_node(channels: typing.Tuple[bpy.types.FCurve], blender_bone = blender_object.path_resolve(channels[0].data_path.rsplit('.', 1)[0]) if isinstance(blender_bone, bpy.types.PoseBone): - if export_settings["gltf_def_bones"] is False: - obj = blender_object.proxy if blender_object.proxy else blender_object - return gltf2_blender_gather_joints.gather_joint(obj, blender_bone, export_settings) - else: - bones, _, _ = gltf2_blender_gather_skins.get_bone_tree(None, blender_object) - if blender_bone.name in [b.name for b in bones]: - obj = blender_object.proxy if blender_object.proxy else blender_object - return gltf2_blender_gather_joints.gather_joint(obj, blender_bone, export_settings) - - return gltf2_blender_gather_nodes.gather_node(blender_object, - blender_object.library.name if blender_object.library else None, - None, None, export_settings) + return gltf2_blender_gather_joints.gather_joint_vnode(export_settings['vtree'].nodes[obj_uuid].bones[blender_bone.name], export_settings) + + return export_settings['vtree'].nodes[obj_uuid].node def __gather_path(channels: typing.Tuple[bpy.types.FCurve], diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py index 726104f4..98ae8b82 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy import typing @@ -26,15 +15,18 @@ from io_scene_gltf2.blender.exp import gltf2_blender_get from io_scene_gltf2.blender.exp import gltf2_blender_gather_skins from io_scene_gltf2.blender.exp import gltf2_blender_gather_drivers from io_scene_gltf2.io.exp.gltf2_io_user_extensions import export_user_extensions +from io_scene_gltf2.blender.exp.gltf2_blender_gather_tree import VExportNode +from . import gltf2_blender_export_keys @cached -def gather_animation_channels(blender_action: bpy.types.Action, - blender_object: bpy.types.Object, +def gather_animation_channels(obj_uuid: int, + blender_action: bpy.types.Action, export_settings ) -> typing.List[gltf2_io.AnimationChannel]: channels = [] + blender_object = export_settings['vtree'].nodes[obj_uuid].blender_object # First calculate range of animation for baking # This is need if user set 'Force sampling' and in case we need to bake @@ -70,11 +62,8 @@ def gather_animation_channels(blender_action: bpy.types.Action, # Then bake all bones bones_to_be_animated = [] - if export_settings["gltf_def_bones"] is False: - bones_to_be_animated = blender_object.data.bones - else: - bones_to_be_animated, _, _ = gltf2_blender_gather_skins.get_bone_tree(None, blender_object) - bones_to_be_animated = [blender_object.pose.bones[b.name] for b in bones_to_be_animated] + bones_uuid = export_settings["vtree"].get_all_bones(obj_uuid) + bones_to_be_animated = [blender_object.pose.bones[export_settings["vtree"].nodes[b].blender_bone.name] for b in bones_uuid] list_of_animated_bone_channels = [] for channel_group in __get_channel_groups(blender_action, blender_object, export_settings): @@ -83,9 +72,9 @@ def gather_animation_channels(blender_action: bpy.types.Action, for bone in bones_to_be_animated: for p in ["location", "rotation_quaternion", "scale"]: - channel = __gather_animation_channel( + channel = gather_animation_channel( + obj_uuid, (), - blender_object, export_settings, bone.name, p, @@ -106,18 +95,17 @@ def gather_animation_channels(blender_action: bpy.types.Action, if len(channel_group) == 0: # Only errors on channels, ignoring continue - channel = __gather_animation_channel(channel_group, blender_object, export_settings, None, None, bake_range_start, bake_range_end, force_range, blender_action.name, None, True) + channel = gather_animation_channel(obj_uuid, channel_group, export_settings, None, None, bake_range_start, bake_range_end, force_range, blender_action.name, None, True) if channel is not None: channels.append(channel) # Retrieve channels for drivers, if needed - obj_driver = blender_object.proxy if blender_object.proxy else blender_object - drivers_to_manage = gltf2_blender_gather_drivers.get_sk_drivers(obj_driver) - for obj, fcurves in drivers_to_manage: - channel = __gather_animation_channel( + drivers_to_manage = gltf2_blender_gather_drivers.get_sk_drivers(obj_uuid, export_settings) + for obj_driver_uuid, fcurves in drivers_to_manage: + channel = gather_animation_channel( + obj_uuid, fcurves, - blender_object, export_settings, None, None, @@ -125,31 +113,77 @@ def gather_animation_channels(blender_action: bpy.types.Action, bake_range_end, force_range, blender_action.name, - obj, - False) + obj_driver_uuid, + True) if channel is not None: channels.append(channel) else: + done_paths = [] for channel_group in __get_channel_groups(blender_action, blender_object, export_settings): channel_group_sorted = __get_channel_group_sorted(channel_group, blender_object) if len(channel_group_sorted) == 0: # Only errors on channels, ignoring continue - channel = __gather_animation_channel( - channel_group_sorted, - blender_object, + channel = gather_animation_channel( + obj_uuid, + channel_group_sorted, + export_settings, + None, + None, + bake_range_start, + bake_range_end, + force_range, + blender_action.name, + None, + True + ) + if channel is not None: + channels.append(channel) + + # Store already done channel path + target = [c for c in channel_group_sorted if c is not None][0].data_path.split('.')[-1] + path = { + "delta_location": "location", + "delta_rotation_euler": "rotation_quaternion", + "location": "location", + "rotation_axis_angle": "rotation_quaternion", + "rotation_euler": "rotation_quaternion", + "rotation_quaternion": "rotation_quaternion", + "scale": "scale", + "value": "weights" + }.get(target) + if path is not None: + done_paths.append(path) + done_paths = list(set(done_paths)) + + if export_settings['gltf_selected'] is True and export_settings['vtree'].tree_troncated is True: + start_frame = min([v[0] for v in [a.frame_range for a in bpy.data.actions]]) + end_frame = max([v[1] for v in [a.frame_range for a in bpy.data.actions]]) + to_be_done = ['location', 'rotation_quaternion', 'scale'] + to_be_done = [c for c in to_be_done if c not in done_paths] + + # In case of weight action, do nothing. + # If there is only weight --> TRS is already managed at first + if not (len(done_paths) == 1 and 'weights' in done_paths): + for p in to_be_done: + channel = gather_animation_channel( + obj_uuid, + (), export_settings, None, - None, - bake_range_start, - bake_range_end, + p, + start_frame, + end_frame, force_range, blender_action.name, None, - False) - if channel is not None: - channels.append(channel) + False #If Object is not animated, don't keep animation for this channel + ) + + if channel is not None: + channels.append(channel) + # resetting driver caches @@ -210,8 +244,9 @@ def __get_channel_group_sorted(channels: typing.Tuple[bpy.types.FCurve], blender # if not shapekeys, stay in same order, because order doesn't matter return channels -def __gather_animation_channel(channels: typing.Tuple[bpy.types.FCurve], - blender_object: bpy.types.Object, +# This function can be called directly from gather_animation in case of bake animation (non animated selected object) +def gather_animation_channel(obj_uuid: str, + channels: typing.Tuple[bpy.types.FCurve], export_settings, bake_bone: typing.Union[str, None], bake_channel: typing.Union[str, None], @@ -219,15 +254,18 @@ def __gather_animation_channel(channels: typing.Tuple[bpy.types.FCurve], bake_range_end, force_range: bool, action_name: str, - driver_obj, + driver_obj_uuid, node_channel_is_animated: bool ) -> typing.Union[gltf2_io.AnimationChannel, None]: + + blender_object = export_settings['vtree'].nodes[obj_uuid].blender_object + if not __filter_animation_channel(channels, blender_object, export_settings): return None - __target= __gather_target(channels, blender_object, export_settings, bake_bone, bake_channel, driver_obj) + __target= __gather_target(obj_uuid, channels, export_settings, bake_bone, bake_channel, driver_obj_uuid) if __target.path is not None: - sampler = __gather_sampler(channels, blender_object, export_settings, bake_bone, bake_channel, bake_range_start, bake_range_end, force_range, action_name, driver_obj, node_channel_is_animated) + sampler = __gather_sampler(channels, obj_uuid, export_settings, bake_bone, bake_channel, bake_range_start, bake_range_end, force_range, action_name, driver_obj_uuid, node_channel_is_animated) if sampler is None: # After check, no need to animate this node for this channel @@ -280,7 +318,7 @@ def __gather_extras(channels: typing.Tuple[bpy.types.FCurve], def __gather_sampler(channels: typing.Tuple[bpy.types.FCurve], - blender_object: bpy.types.Object, + obj_uuid: str, export_settings, bake_bone: typing.Union[str, None], bake_channel: typing.Union[str, None], @@ -288,33 +326,38 @@ def __gather_sampler(channels: typing.Tuple[bpy.types.FCurve], bake_range_end, force_range: bool, action_name, - driver_obj, + driver_obj_uuid, node_channel_is_animated: bool ) -> gltf2_io.AnimationSampler: + + need_rotation_correction = (export_settings[gltf2_blender_export_keys.CAMERAS] and export_settings['vtree'].nodes[obj_uuid].blender_type == VExportNode.CAMERA) or \ + (export_settings[gltf2_blender_export_keys.LIGHTS] and export_settings['vtree'].nodes[obj_uuid].blender_type == VExportNode.LIGHT) + return gltf2_blender_gather_animation_samplers.gather_animation_sampler( channels, - blender_object, + obj_uuid, bake_bone, bake_channel, bake_range_start, bake_range_end, force_range, action_name, - driver_obj, + driver_obj_uuid, node_channel_is_animated, + need_rotation_correction, export_settings ) -def __gather_target(channels: typing.Tuple[bpy.types.FCurve], - blender_object: bpy.types.Object, +def __gather_target(obj_uuid: str, + channels: typing.Tuple[bpy.types.FCurve], export_settings, bake_bone: typing.Union[str, None], bake_channel: typing.Union[str, None], - driver_obj + driver_obj_uuid ) -> gltf2_io.AnimationChannelTarget: return gltf2_blender_gather_animation_channel_target.gather_animation_channel_target( - channels, blender_object, bake_bone, bake_channel, driver_obj, export_settings) + obj_uuid, channels, bake_bone, bake_channel, driver_obj_uuid, export_settings) def __get_channel_groups(blender_action: bpy.types.Action, blender_object: bpy.types.Object, export_settings): diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py index 780460f6..e1ed19ea 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py @@ -1,27 +1,17 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy import mathutils import typing -from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import cached, bonecache +from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import cached, bonecache, objectcache from io_scene_gltf2.blender.com import gltf2_blender_math from io_scene_gltf2.blender.exp import gltf2_blender_get from io_scene_gltf2.blender.exp.gltf2_blender_gather_drivers import get_sk_drivers, get_sk_driver_values from . import gltf2_blender_export_keys from io_scene_gltf2.io.com import gltf2_io_debug +from io_scene_gltf2.blender.exp.gltf2_blender_gather_tree import VExportNode import numpy as np @@ -106,6 +96,10 @@ class Keyframe: def value(self, value: typing.List[float]): self.__value = self.__set_indexed(value) + @value.setter + def value_total(self, value: typing.List[float]): + self.__value = value + @property def in_tangent(self) -> typing.Union[mathutils.Vector, mathutils.Euler, mathutils.Quaternion, typing.List[float]]: if self.__in_tangent is None: @@ -131,9 +125,81 @@ class Keyframe: self.__out_tangent = self.__set_indexed(value) +@objectcache +def get_object_matrix(blender_obj_uuid: str, + action_name: str, + bake_range_start: int, + bake_range_end: int, + current_frame: int, + step: int, + export_settings, + only_gather_provided=False + ): + + data = {} + + # TODO : bake_range_start & bake_range_end are no more needed here + # Because we bake, we don't know exactly the frame range, + # So using min / max of all actions + + start_frame = min([v[0] for v in [a.frame_range for a in bpy.data.actions]]) + end_frame = max([v[1] for v in [a.frame_range for a in bpy.data.actions]]) + + if only_gather_provided: + obj_uuids = [blender_obj_uuid] + else: + obj_uuids = [uid for (uid, n) in export_settings['vtree'].nodes.items() if n.blender_type not in [VExportNode.BONE]] + + frame = start_frame + while frame <= end_frame: + bpy.context.scene.frame_set(int(frame)) + + for obj_uuid in obj_uuids: + blender_obj = export_settings['vtree'].nodes[obj_uuid].blender_object + + # if this object is not animated, do not skip : + # We need this object too in case of bake + + # calculate local matrix + if export_settings['vtree'].nodes[obj_uuid].parent_uuid is None: + parent_mat = mathutils.Matrix.Identity(4).freeze() + else: + if export_settings['vtree'].nodes[export_settings['vtree'].nodes[obj_uuid].parent_uuid].blender_type not in [VExportNode.BONE]: + parent_mat = export_settings['vtree'].nodes[export_settings['vtree'].nodes[obj_uuid].parent_uuid].blender_object.matrix_world + else: + # Object animated is parented to a bone + blender_bone = export_settings['vtree'].nodes[export_settings['vtree'].nodes[obj_uuid].parent_bone_uuid].blender_bone + armature_object = export_settings['vtree'].nodes[export_settings['vtree'].nodes[export_settings['vtree'].nodes[obj_uuid].parent_bone_uuid].armature].blender_object + axis_basis_change = mathutils.Matrix( + ((1.0, 0.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, -1.0, 0.0, 0.0), (0.0, 0.0, 0.0, 1.0))) + + parent_mat = armature_object.matrix_world @ blender_bone.matrix @ axis_basis_change + + #For object inside collection (at root), matrix world is already expressed regarding collection parent + if export_settings['vtree'].nodes[obj_uuid].parent_uuid is not None and export_settings['vtree'].nodes[export_settings['vtree'].nodes[obj_uuid].parent_uuid].blender_type == VExportNode.COLLECTION: + parent_mat = mathutils.Matrix.Identity(4).freeze() + + mat = parent_mat.inverted_safe() @ blender_obj.matrix_world + + if obj_uuid not in data.keys(): + data[obj_uuid] = {} + + if blender_obj.animation_data and blender_obj.animation_data.action: + if blender_obj.animation_data.action.name not in data[obj_uuid].keys(): + data[obj_uuid][blender_obj.animation_data.action.name] = {} + data[obj_uuid][blender_obj.animation_data.action.name][frame] = mat + else: + # case of baking selected object. + # There is no animation, so use uuid of object as key + if obj_uuid not in data[obj_uuid].keys(): + data[obj_uuid][obj_uuid] = {} + data[obj_uuid][obj_uuid][frame] = mat + + frame += step + return data @bonecache -def get_bone_matrix(blender_object_if_armature: typing.Optional[bpy.types.Object], +def get_bone_matrix(blender_obj_uuid_if_armature: typing.Optional[str], channels: typing.Tuple[bpy.types.FCurve], bake_bone: typing.Union[str, None], bake_channel: typing.Union[str, None], @@ -141,9 +207,11 @@ def get_bone_matrix(blender_object_if_armature: typing.Optional[bpy.types.Object bake_range_end, action_name: str, current_frame: int, - step: int + step: int, + export_settings ): + blender_object_if_armature = export_settings['vtree'].nodes[blender_obj_uuid_if_armature].blender_object if blender_obj_uuid_if_armature is not None else None data = {} # Always using bake_range, because some bones may need to be baked, @@ -156,36 +224,40 @@ def get_bone_matrix(blender_object_if_armature: typing.Optional[bpy.types.Object frame = start_frame while frame <= end_frame: data[frame] = {} - # we need to bake in the constraints bpy.context.scene.frame_set(int(frame)) - for pbone in blender_object_if_armature.pose.bones: - if bake_bone is None: - matrix = pbone.matrix_basis.copy() + bones = export_settings['vtree'].get_all_bones(blender_obj_uuid_if_armature) + + for bone_uuid in bones: + blender_bone = export_settings['vtree'].nodes[bone_uuid].blender_bone + + if export_settings['vtree'].nodes[bone_uuid].parent_uuid is not None and export_settings['vtree'].nodes[export_settings['vtree'].nodes[bone_uuid].parent_uuid].blender_type == VExportNode.BONE: + blender_bone_parent = export_settings['vtree'].nodes[export_settings['vtree'].nodes[bone_uuid].parent_uuid].blender_bone + rest_mat = blender_bone_parent.bone.matrix_local.inverted_safe() @ blender_bone.bone.matrix_local + matrix = rest_mat.inverted_safe() @ blender_bone_parent.matrix.inverted_safe() @ blender_bone.matrix else: - if (pbone.bone.use_inherit_rotation == False or pbone.bone.inherit_scale != "FULL") and pbone.parent != None: - rest_mat = (pbone.parent.bone.matrix_local.inverted_safe() @ pbone.bone.matrix_local) - matrix = (rest_mat.inverted_safe() @ pbone.parent.matrix.inverted_safe() @ pbone.matrix) + if blender_bone.parent is None: + matrix = blender_bone.bone.matrix_local.inverted_safe() @ blender_bone.matrix else: - matrix = pbone.matrix - matrix = blender_object_if_armature.convert_space(pose_bone=pbone, matrix=matrix, from_space='POSE', to_space='LOCAL') + # Bone has a parent, but in export, after filter, is at root of armature + matrix = blender_bone.matrix.copy() - - data[frame][pbone.name] = matrix + data[frame][blender_bone.name] = matrix # If some drivers must be evaluated, do it here, to avoid to have to change frame by frame later - obj_driver = blender_object_if_armature.proxy if blender_object_if_armature.proxy else blender_object_if_armature - drivers_to_manage = get_sk_drivers(obj_driver) - for dr_obj, dr_fcurves in drivers_to_manage: - vals = get_sk_driver_values(dr_obj, frame, dr_fcurves) + drivers_to_manage = get_sk_drivers(blender_obj_uuid_if_armature, export_settings) + for dr_obj_uuid, dr_fcurves in drivers_to_manage: + vals = get_sk_driver_values(dr_obj_uuid, frame, dr_fcurves, export_settings) frame += step return data # cache for performance reasons +# This function is called 2 times, for input (timing) and output (key values) @cached -def gather_keyframes(blender_object_if_armature: typing.Optional[bpy.types.Object], +def gather_keyframes(blender_obj_uuid: str, + is_armature: bool, channels: typing.Tuple[bpy.types.FCurve], non_keyed_values: typing.Tuple[typing.Optional[float]], bake_bone: typing.Union[str, None], @@ -194,32 +266,40 @@ def gather_keyframes(blender_object_if_armature: typing.Optional[bpy.types.Objec bake_range_end, force_range: bool, action_name: str, - driver_obj, + driver_obj_uuid, node_channel_is_animated: bool, export_settings - ) -> typing.List[Keyframe]: + ) -> typing.Tuple[typing.List[Keyframe], bool]: """Convert the blender action groups' fcurves to keyframes for use in glTF.""" + + blender_object_if_armature = export_settings['vtree'].nodes[blender_obj_uuid].blender_object if is_armature is True is not None else None + blender_obj_uuid_if_armature = blender_obj_uuid if is_armature is True else None + if force_range is True: start_frame = bake_range_start end_frame = bake_range_end else: - if bake_bone is None and driver_obj is None: + if bake_bone is None and driver_obj_uuid is None: # Find the start and end of the whole action group # Note: channels has some None items only for SK if some SK are not animated ranges = [channel.range() for channel in channels if channel is not None] - start_frame = min([channel.range()[0] for channel in channels if channel is not None]) - end_frame = max([channel.range()[1] for channel in channels if channel is not None]) + if len(channels) != 0: + start_frame = min([channel.range()[0] for channel in channels if channel is not None]) + end_frame = max([channel.range()[1] for channel in channels if channel is not None]) + else: + start_frame = bake_range_start + end_frame = bake_range_end else: start_frame = bake_range_start end_frame = bake_range_end keyframes = [] - if needs_baking(blender_object_if_armature, channels, export_settings): + baking_is_needed = needs_baking(blender_object_if_armature, channels, export_settings) + if baking_is_needed: # Bake the animation, by evaluating the animation for all frames - # TODO: maybe baking can also be done with FCurve.convert_to_samples - if blender_object_if_armature is not None and driver_obj is None: + if blender_object_if_armature is not None and driver_obj_uuid is None: if bake_bone is None: pose_bone_if_armature = gltf2_blender_get.get_object_from_datapath(blender_object_if_armature, channels[0].data_path) @@ -236,7 +316,7 @@ def gather_keyframes(blender_object_if_armature: typing.Optional[bpy.types.Objec if isinstance(pose_bone_if_armature, bpy.types.PoseBone): mat = get_bone_matrix( - blender_object_if_armature, + blender_obj_uuid_if_armature, channels, bake_bone, bake_channel, @@ -244,7 +324,8 @@ def gather_keyframes(blender_object_if_armature: typing.Optional[bpy.types.Objec bake_range_end, action_name, frame, - step + step, + export_settings ) trans, rot, scale = mat.decompose() @@ -260,12 +341,36 @@ def gather_keyframes(blender_object_if_armature: typing.Optional[bpy.types.Objec "scale": scale }[target_property] else: - if driver_obj is None: - # Note: channels has some None items only for SK if some SK are not animated - key.value = [c.evaluate(frame) for c in channels if c is not None] - complete_key(key, non_keyed_values) + if driver_obj_uuid is None: + # If channel is TRS, we bake from world matrix, else this is SK + if len(channels) != 0: + target = [c for c in channels if c is not None][0].data_path.split('.')[-1] + else: + target = bake_channel + if target == "value": #SK + # Note: channels has some None items only for SK if some SK are not animated + key.value = [c.evaluate(frame) for c in channels if c is not None] + complete_key(key, non_keyed_values) + else: + + mat = get_object_matrix(blender_obj_uuid, + action_name, + bake_range_start, + bake_range_end, + frame, + step, + export_settings) + + trans, rot, sca = mat.decompose() + key.value_total = { + "location": trans, + "rotation_axis_angle": [rot.to_axis_angle()[1], rot.to_axis_angle()[0][0], rot.to_axis_angle()[0][1], rot.to_axis_angle()[0][2]], + "rotation_euler": rot.to_euler(), + "rotation_quaternion": rot, + "scale": sca + }[target] else: - key.value = get_sk_driver_values(driver_obj, frame, channels) + key.value = get_sk_driver_values(driver_obj_uuid, frame, channels, export_settings) complete_key(key, non_keyed_values) keyframes.append(key) frame += step @@ -319,7 +424,7 @@ def gather_keyframes(blender_object_if_armature: typing.Optional[bpy.types.Objec keyframes.append(key) if not export_settings[gltf2_blender_export_keys.OPTIMIZE_ANIMS]: - return keyframes + return (keyframes, baking_is_needed) # For armature only # Check if all values are the same @@ -331,17 +436,20 @@ def gather_keyframes(blender_object_if_armature: typing.Optional[bpy.types.Objec if node_channel_is_animated is True: # fcurve on this bone for this property # Keep animation, but keep only 2 keyframes if data are not changing - return [keyframes[0], keyframes[-1]] if cst is True and len(keyframes) >= 2 else keyframes + return ([keyframes[0], keyframes[-1]], baking_is_needed) if cst is True and len(keyframes) >= 2 else (keyframes, baking_is_needed) else: # bone is not animated (no fcurve) # Not keeping if not changing property - return None if cst is True else keyframes + return (None, baking_is_needed) if cst is True else (keyframes, baking_is_needed) else: # For objects, if all values are the same, we keep only first and last cst = fcurve_is_constant(keyframes) - return [keyframes[0], keyframes[-1]] if cst is True and len(keyframes) >= 2 else keyframes - + if node_channel_is_animated is True: + return ([keyframes[0], keyframes[-1]], baking_is_needed) if cst is True and len(keyframes) >= 2 else (keyframes, baking_is_needed) + else: + # baked object (selected but not animated) + return (None, baking_is_needed) if cst is True else (keyframes, baking_is_needed) - return keyframes + return (keyframes, baking_is_needed) def fcurve_is_constant(keyframes): @@ -386,6 +494,10 @@ def needs_baking(blender_object_if_armature: typing.Optional[bpy.types.Object], if export_settings[gltf2_blender_export_keys.FORCE_SAMPLING]: return True + # If tree is troncated, sampling is forced + if export_settings['vtree'].tree_troncated is True: + return True + # Sampling due to unsupported interpolation interpolation = [c for c in channels if c is not None][0].keyframe_points[0].interpolation if interpolation not in ["BEZIER", "LINEAR", "CONSTANT"]: diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py index 61fe17a6..143fccea 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py @@ -1,19 +1,9 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import typing +from io_scene_gltf2.blender.exp.gltf2_blender_gather_tree import VExportNode import bpy import mathutils @@ -32,20 +22,23 @@ from io_scene_gltf2.io.exp.gltf2_io_user_extensions import export_user_extension @cached def gather_animation_sampler(channels: typing.Tuple[bpy.types.FCurve], - blender_object: bpy.types.Object, + obj_uuid: str, bake_bone: typing.Union[str, None], bake_channel: typing.Union[str, None], bake_range_start, bake_range_end, force_range: bool, action_name: str, - driver_obj, + driver_obj_uuid, node_channel_is_animated: bool, + need_rotation_correction, export_settings ) -> gltf2_io.AnimationSampler: - blender_object_if_armature = blender_object if blender_object.type == "ARMATURE" else None - if blender_object_if_armature is not None and driver_obj is None: + blender_object = export_settings['vtree'].nodes[obj_uuid].blender_object + is_armature = True if blender_object.type == "ARMATURE" else False + blender_object_if_armature = blender_object if is_armature is True else None + if is_armature is True and driver_obj_uuid is None: if bake_bone is None: pose_bone_if_armature = gltf2_blender_get.get_object_from_datapath(blender_object_if_armature, channels[0].data_path) @@ -56,15 +49,15 @@ def gather_animation_sampler(channels: typing.Tuple[bpy.types.FCurve], non_keyed_values = __gather_non_keyed_values(channels, blender_object, blender_object_if_armature, pose_bone_if_armature, bake_channel, - driver_obj, + driver_obj_uuid, export_settings) if blender_object.parent is not None: matrix_parent_inverse = blender_object.matrix_parent_inverse.copy().freeze() else: matrix_parent_inverse = mathutils.Matrix.Identity(4).freeze() - input = __gather_input(channels, blender_object_if_armature, non_keyed_values, - bake_bone, bake_channel, bake_range_start, bake_range_end, force_range, action_name, driver_obj, node_channel_is_animated, export_settings) + input = __gather_input(channels, obj_uuid, is_armature, non_keyed_values, + bake_bone, bake_channel, bake_range_start, bake_range_end, force_range, action_name, driver_obj_uuid, node_channel_is_animated, export_settings) if input is None: # After check, no need to animate this node for this channel @@ -77,7 +70,8 @@ def gather_animation_sampler(channels: typing.Tuple[bpy.types.FCurve], interpolation=__gather_interpolation(channels, blender_object_if_armature, export_settings, bake_bone, bake_channel), output=__gather_output(channels, matrix_parent_inverse, - blender_object_if_armature, + obj_uuid, + is_armature, non_keyed_values, bake_bone, bake_channel, @@ -85,8 +79,9 @@ def gather_animation_sampler(channels: typing.Tuple[bpy.types.FCurve], bake_range_end, force_range, action_name, - driver_obj, + driver_obj_uuid, node_channel_is_animated, + need_rotation_correction, export_settings) ) @@ -108,12 +103,13 @@ def __gather_non_keyed_values(channels: typing.Tuple[bpy.types.FCurve], blender_object_if_armature: typing.Optional[bpy.types.Object], pose_bone_if_armature: typing.Optional[bpy.types.PoseBone], bake_channel: typing.Union[str, None], - driver_obj, + driver_obj_uuid, export_settings ) -> typing.Tuple[typing.Optional[float]]: non_keyed_values = [] + driver_obj = export_settings['vtree'].nodes[driver_obj_uuid].blender_object if driver_obj_uuid is not None else None obj = blender_object if driver_obj is None else driver_obj # Note: channels has some None items only for SK if some SK are not animated @@ -228,10 +224,10 @@ def __gather_extras(channels: typing.Tuple[bpy.types.FCurve], ) -> typing.Any: return None - @cached def __gather_input(channels: typing.Tuple[bpy.types.FCurve], - blender_object_if_armature: typing.Optional[bpy.types.Object], + blender_obj_uuid: str, + is_armature: bool, non_keyed_values: typing.Tuple[typing.Optional[float]], bake_bone: typing.Union[str, None], bake_channel: typing.Union[str, None], @@ -239,12 +235,13 @@ def __gather_input(channels: typing.Tuple[bpy.types.FCurve], bake_range_end, force_range: bool, action_name, - driver_obj, + driver_obj_uuid, node_channel_is_animated: bool, export_settings ) -> gltf2_io.Accessor: """Gather the key time codes.""" - keyframes = gltf2_blender_gather_animation_sampler_keyframes.gather_keyframes(blender_object_if_armature, + keyframes, is_baked = gltf2_blender_gather_animation_sampler_keyframes.gather_keyframes(blender_obj_uuid, + is_armature, channels, non_keyed_values, bake_bone, @@ -253,7 +250,7 @@ def __gather_input(channels: typing.Tuple[bpy.types.FCurve], bake_range_end, force_range, action_name, - driver_obj, + driver_obj_uuid, node_channel_is_animated, export_settings) if keyframes is None: @@ -288,14 +285,15 @@ def __gather_interpolation(channels: typing.Tuple[bpy.types.FCurve], # TODO: check if the bone was animated with CONSTANT return 'LINEAR' else: - max_keyframes = max([len(ch.keyframe_points) for ch in channels if ch is not None]) - # If only single keyframe revert to STEP - if max_keyframes < 2: - return 'STEP' + if len(channels) != 0: # channels can be empty when baking object (non animated selected object) + max_keyframes = max([len(ch.keyframe_points) for ch in channels if ch is not None]) + # If only single keyframe revert to STEP + if max_keyframes < 2: + return 'STEP' - # If all keyframes are CONSTANT, we can use STEP. - if all(all(k.interpolation == 'CONSTANT' for k in c.keyframe_points) for c in channels if c is not None): - return 'STEP' + # If all keyframes are CONSTANT, we can use STEP. + if all(all(k.interpolation == 'CONSTANT' for k in c.keyframe_points) for c in channels if c is not None): + return 'STEP' # Otherwise, sampled keyframes use LINEAR interpolation. return 'LINEAR' @@ -315,7 +313,8 @@ def __gather_interpolation(channels: typing.Tuple[bpy.types.FCurve], @cached def __gather_output(channels: typing.Tuple[bpy.types.FCurve], parent_inverse, - blender_object_if_armature: typing.Optional[bpy.types.Object], + blender_obj_uuid: str, + is_armature: bool, non_keyed_values: typing.Tuple[typing.Optional[float]], bake_bone: typing.Union[str, None], bake_channel: typing.Union[str, None], @@ -325,10 +324,12 @@ def __gather_output(channels: typing.Tuple[bpy.types.FCurve], action_name, driver_obj, node_channel_is_animated: bool, + need_rotation_correction: bool, export_settings ) -> gltf2_io.Accessor: """Gather the data of the keyframes.""" - keyframes = gltf2_blender_gather_animation_sampler_keyframes.gather_keyframes(blender_object_if_armature, + keyframes, is_baked = gltf2_blender_gather_animation_sampler_keyframes.gather_keyframes(blender_obj_uuid, + is_armature, channels, non_keyed_values, bake_bone, @@ -340,10 +341,19 @@ def __gather_output(channels: typing.Tuple[bpy.types.FCurve], driver_obj, node_channel_is_animated, export_settings) + + if is_baked is True: + parent_inverse = mathutils.Matrix.Identity(4).freeze() + + blender_object_if_armature = export_settings['vtree'].nodes[blender_obj_uuid].blender_object if is_armature is True else None + if bake_bone is not None: target_datapath = "pose.bones['" + bake_bone + "']." + bake_channel else: - target_datapath = [c for c in channels if c is not None][0].data_path + if len(channels) != 0: # channels can be empty when baking object (non animated selected object) + target_datapath = [c for c in channels if c is not None][0].data_path + else: + target_datapath = bake_channel is_yup = export_settings[gltf2_blender_export_keys.YUP] @@ -366,6 +376,7 @@ def __gather_output(channels: typing.Tuple[bpy.types.FCurve], bone = blender_object_if_armature.pose.bones[bake_bone] if isinstance(bone, bpy.types.PoseBone): if bone.parent is None: + # bone at root of armature axis_basis_change = mathutils.Matrix.Identity(4) if export_settings[gltf2_blender_export_keys.YUP]: axis_basis_change = mathutils.Matrix( @@ -375,10 +386,25 @@ def __gather_output(channels: typing.Tuple[bpy.types.FCurve], (0.0, 0.0, 0.0, 1.0))) correction_matrix_local = axis_basis_change @ bone.bone.matrix_local else: - correction_matrix_local = ( - bone.parent.bone.matrix_local.inverted_safe() @ - bone.bone.matrix_local - ) + # Bone is not at root of armature + # There are 2 cases : + parent_uuid = export_settings['vtree'].nodes[export_settings['vtree'].nodes[blender_obj_uuid].bones[bone.name]].parent_uuid + if parent_uuid is not None and export_settings['vtree'].nodes[parent_uuid].blender_type == VExportNode.BONE: + # export bone is not at root of armature neither + correction_matrix_local = ( + bone.parent.bone.matrix_local.inverted_safe() @ + bone.bone.matrix_local + ) + else: + # exported bone (after filter) is at root of armature + axis_basis_change = mathutils.Matrix.Identity(4) + if export_settings[gltf2_blender_export_keys.YUP]: + axis_basis_change = mathutils.Matrix( + ((1.0, 0.0, 0.0, 0.0), + (0.0, 0.0, 1.0, 0.0), + (0.0, -1.0, 0.0, 0.0), + (0.0, 0.0, 0.0, 1.0))) + correction_matrix_local = axis_basis_change transform = correction_matrix_local else: @@ -389,14 +415,14 @@ def __gather_output(channels: typing.Tuple[bpy.types.FCurve], values = [] for keyframe in keyframes: # Transform the data and build gltf control points - value = gltf2_blender_math.transform(keyframe.value, target_datapath, transform) + value = gltf2_blender_math.transform(keyframe.value, target_datapath, transform, need_rotation_correction) if is_yup and not is_armature_animation: value = gltf2_blender_math.swizzle_yup(value, target_datapath) keyframe_value = gltf2_blender_math.mathutils_to_gltf(value) if keyframe.in_tangent is not None: # we can directly transform the tangent as it currently is represented by a control point - in_tangent = gltf2_blender_math.transform(keyframe.in_tangent, target_datapath, transform) + in_tangent = gltf2_blender_math.transform(keyframe.in_tangent, target_datapath, transform, need_rotation_correction) if is_yup and blender_object_if_armature is None: in_tangent = gltf2_blender_math.swizzle_yup(in_tangent, target_datapath) # the tangent in glTF is relative to the keyframe value @@ -408,7 +434,7 @@ def __gather_output(channels: typing.Tuple[bpy.types.FCurve], if keyframe.out_tangent is not None: # we can directly transform the tangent as it currently is represented by a control point - out_tangent = gltf2_blender_math.transform(keyframe.out_tangent, target_datapath, transform) + out_tangent = gltf2_blender_math.transform(keyframe.out_tangent, target_datapath, transform, need_rotation_correction) if is_yup and blender_object_if_armature is None: out_tangent = gltf2_blender_math.swizzle_yup(out_tangent, target_datapath) # the tangent in glTF is relative to the keyframe value diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py index 978346f4..0a513521 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy import typing @@ -20,9 +9,39 @@ from io_scene_gltf2.blender.exp import gltf2_blender_gather_animation_channels from io_scene_gltf2.io.com.gltf2_io_debug import print_console from ..com.gltf2_blender_extras import generate_extras from io_scene_gltf2.io.exp.gltf2_io_user_extensions import export_user_extensions +from io_scene_gltf2.blender.exp.gltf2_blender_gather_tree import VExportNode -def gather_animations(blender_object: bpy.types.Object, +def __gather_channels_baked(obj_uuid, export_settings): + channels = [] + + # If no animation in file, no need to bake + if len(bpy.data.actions) == 0: + return None + + start_frame = min([v[0] for v in [a.frame_range for a in bpy.data.actions]]) + end_frame = max([v[1] for v in [a.frame_range for a in bpy.data.actions]]) + + for p in ["location", "rotation_quaternion", "scale"]: + channel = gltf2_blender_gather_animation_channels.gather_animation_channel( + obj_uuid, + (), + export_settings, + None, + p, + start_frame, + end_frame, + False, + obj_uuid, # Use obj uuid as action name for caching + None, + False #If Object is not animated, don't keep animation for this channel + ) + if channel is not None: + channels.append(channel) + + return channels if len(channels) > 0 else None + +def gather_animations( obj_uuid: int, tracks: typing.Dict[str, typing.List[int]], offset: int, export_settings) -> typing.Tuple[typing.List[gltf2_io.Animation], typing.Dict[str, typing.List[int]]]: @@ -35,11 +54,35 @@ def gather_animations(blender_object: bpy.types.Object, """ animations = [] + blender_object = export_settings['vtree'].nodes[obj_uuid].blender_object + # Collect all 'actions' affecting this object. There is a direct mapping between blender actions and glTF animations blender_actions = __get_blender_actions(blender_object, export_settings) - # save the current active action of the object, if any - # We will restore it after export + if len([a for a in blender_actions if a[2] == "OBJECT"]) == 0: + # No TRS animation are found for this object. + # But we need to bake, in case we export selection + if export_settings['gltf_selected'] is True and blender_object.type != "ARMATURE": + channels = __gather_channels_baked(obj_uuid, export_settings) + if channels is not None: + animation = gltf2_io.Animation( + channels=channels, + extensions=None, # as other animations + extras=None, # Because there is no animation to get extras from + name=blender_object.name, # Use object name as animation name + samplers=[] + ) + + __link_samplers(animation, export_settings) + if animation is not None: + animations.append(animation) + elif export_settings['gltf_selected'] is True and blender_object.type == "ARMATURE": + # We need to bake all bones. Because some bone can have some constraints linking to + # some other armature bones, for example + #TODO + pass + + current_action = None if blender_object.animation_data and blender_object.animation_data.action: current_action = blender_object.animation_data.action @@ -74,7 +117,7 @@ def gather_animations(blender_object: bpy.types.Object, # No need to set active shapekeys animations, this is needed for bone baking - animation = __gather_animation(blender_action, blender_object, export_settings) + animation = __gather_animation(obj_uuid, blender_action, export_settings) if animation is not None: animations.append(animation) @@ -102,21 +145,24 @@ def gather_animations(blender_object: bpy.types.Object, return animations, tracks -def __gather_animation(blender_action: bpy.types.Action, - blender_object: bpy.types.Object, - export_settings +def __gather_animation( obj_uuid: int, + blender_action: bpy.types.Action, + export_settings ) -> typing.Optional[gltf2_io.Animation]: + + blender_object = export_settings['vtree'].nodes[obj_uuid].blender_object + if not __filter_animation(blender_action, blender_object, export_settings): return None name = __gather_name(blender_action, blender_object, export_settings) try: animation = gltf2_io.Animation( - channels=__gather_channels(blender_action, blender_object, export_settings), + channels=__gather_channels(obj_uuid, blender_action, export_settings), extensions=__gather_extensions(blender_action, blender_object, export_settings), extras=__gather_extras(blender_action, blender_object, export_settings), name=name, - samplers=__gather_samplers(blender_action, blender_object, export_settings) + samplers=__gather_samplers(obj_uuid, blender_action, export_settings) ) except RuntimeError as error: print_console("WARNING", "Animation '{}' could not be exported. Cause: {}".format(name, error)) @@ -145,12 +191,12 @@ def __filter_animation(blender_action: bpy.types.Action, return True -def __gather_channels(blender_action: bpy.types.Action, - blender_object: bpy.types.Object, +def __gather_channels(obj_uuid: int, + blender_action: bpy.types.Action, export_settings ) -> typing.List[gltf2_io.AnimationChannel]: return gltf2_blender_gather_animation_channels.gather_animation_channels( - blender_action, blender_object, export_settings) + obj_uuid, blender_action, export_settings) def __gather_extensions(blender_action: bpy.types.Action, @@ -177,8 +223,8 @@ def __gather_name(blender_action: bpy.types.Action, return blender_action.name -def __gather_samplers(blender_action: bpy.types.Action, - blender_object: bpy.types.Object, +def __gather_samplers(obj_uuid: str, + blender_action: bpy.types.Action, export_settings ) -> typing.List[gltf2_io.AnimationSampler]: # We need to gather the samplers after gathering all channels --> populate this list in __link_samplers @@ -262,6 +308,15 @@ def __get_blender_actions(blender_object: bpy.types.Object, blender_tracks[strip.action.name] = track.name # Always set after possible active action -> None will be overwrite action_on_type[strip.action.name] = "SHAPEKEY" + # If there are only 1 armature, include all animations, even if not in NLA + if blender_object.type == "ARMATURE": + if len(export_settings['vtree'].get_all_node_of_type(VExportNode.ARMATURE)) == 1: + # Keep all actions on objects (no keyframe animation) + # Some other object animation can be added here, and will affect armature object itself :-/ + for act in [a for a in bpy.data.actions if a.id_root == "OBJECT"]: + blender_actions.append(act) + blender_tracks[act.name] = None + export_user_extensions('gather_actions_hook', export_settings, blender_object, blender_actions, blender_tracks, action_on_type) # Remove duplicate actions. diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py index 20e3e6d9..3539b968 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py @@ -1,99 +1,139 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import functools import bpy from io_scene_gltf2.blender.exp import gltf2_blender_get -def cached(func): +def cached_by_key(key): + """ + Decorates functions whose result should be cached. Use it like: + @cached_by_key(key=...) + def func(..., export_settings): + ... + The decorated function, func, must always take an "export_settings" arg + (the cache is stored here). + The key argument to the decorator is a function that computes the key to + cache on. It is passed all the arguments to func. """ - Decorate the cache gather functions results. + def inner(func): + @functools.wraps(func) + def wrapper_cached(*args, **kwargs): + if kwargs.get("export_settings"): + export_settings = kwargs["export_settings"] + else: + export_settings = args[-1] + + cache_key = key(*args, **kwargs) + + # invalidate cache if export settings have changed + if not hasattr(func, "__export_settings") or export_settings != func.__export_settings: + func.__cache = {} + func.__export_settings = export_settings + # use or fill cache + if cache_key in func.__cache: + return func.__cache[cache_key] + else: + result = func(*args, **kwargs) + func.__cache[cache_key] = result + return result + + return wrapper_cached + + return inner + - The gather function is only executed if its result isn't in the cache yet - :param func: the function to be decorated. It will have a static __cache member afterwards - :return: +def default_key(*args, **kwargs): """ + Default cache key for @cached functions. + Cache on all arguments (except export_settings). + """ + assert len(args) >= 2 and 0 <= len(kwargs) <= 1, "Wrong signature for cached function" + cache_key_args = args + # make a shallow copy of the keyword arguments so that 'export_settings' can be removed + cache_key_kwargs = dict(kwargs) + if kwargs.get("export_settings"): + del cache_key_kwargs["export_settings"] + else: + cache_key_args = args[:-1] + + cache_key = () + for i in cache_key_args: + cache_key += (i,) + for i in cache_key_kwargs.values(): + cache_key += (i,) + + return cache_key + + +def cached(func): + return cached_by_key(key=default_key)(func) + +def objectcache(func): + + def reset_cache_objectcache(): + func.__objectcache = {} + + func.reset_cache = reset_cache_objectcache + @functools.wraps(func) - def wrapper_cached(*args, **kwargs): - assert len(args) >= 2 and 0 <= len(kwargs) <= 1, "Wrong signature for cached function" + def wrapper_objectcache(*args, **kwargs): cache_key_args = args - # make a shallow copy of the keyword arguments so that 'export_settings' can be removed - cache_key_kwargs = dict(kwargs) - if kwargs.get("export_settings"): - export_settings = kwargs["export_settings"] - # 'export_settings' should not be cached - del cache_key_kwargs["export_settings"] - else: - export_settings = args[-1] - cache_key_args = args[:-1] + cache_key_args = args[:-1] - __by_name = [bpy.types.Object, bpy.types.Scene, bpy.types.Material, bpy.types.Action, bpy.types.Mesh, bpy.types.PoseBone] + if not hasattr(func, "__objectcache"): + func.reset_cache() - # we make a tuple from the function arguments so that they can be used as a key to the cache - cache_key = () - for i in cache_key_args: - if type(i) in __by_name: - cache_key += (i.name,) - else: - cache_key += (i,) - for i in cache_key_kwargs.values(): - if type(i) in __by_name: - cache_key += (i.name,) - else: - cache_key += (i,) - - # invalidate cache if export settings have changed - if not hasattr(func, "__export_settings") or export_settings != func.__export_settings: - func.__cache = {} - func.__export_settings = export_settings - # use or fill cache - if cache_key in func.__cache: - return func.__cache[cache_key] - else: + # object is not cached yet + if cache_key_args[0] not in func.__objectcache.keys(): result = func(*args) - func.__cache[cache_key] = result - return result - return wrapper_cached + func.__objectcache = result + return result[cache_key_args[0]][cache_key_args[1]][cache_key_args[4]] + # object is in cache, but not this action + # We need to keep other actions + elif cache_key_args[1] not in func.__objectcache[cache_key_args[0]].keys(): + result = func(*args, only_gather_provided=True) + func.__objectcache[cache_key_args[0]][cache_key_args[1]] = result[cache_key_args[0]][cache_key_args[1]] + return result[cache_key_args[0]][cache_key_args[1]][cache_key_args[4]] + # all is already cached + else: + return func.__objectcache[cache_key_args[0]][cache_key_args[1]][cache_key_args[4]] + return wrapper_objectcache def bonecache(func): def reset_cache_bonecache(): func.__current_action_name = None - func.__current_armature_name = None + func.__current_armature_uuid = None func.__bonecache = {} func.reset_cache = reset_cache_bonecache @functools.wraps(func) def wrapper_bonecache(*args, **kwargs): - if args[2] is None: - pose_bone_if_armature = gltf2_blender_get.get_object_from_datapath(args[0], - args[1][0].data_path) + + armature = args[-1]['vtree'].nodes[args[0]].blender_object + + cache_key_args = args + cache_key_args = args[:-1] + + if cache_key_args[2] is None: + pose_bone_if_armature = gltf2_blender_get.get_object_from_datapath(armature, + cache_key_args[1][0].data_path) else: - pose_bone_if_armature = args[0].pose.bones[args[2]] + pose_bone_if_armature = armature.pose.bones[cache_key_args[2]] if not hasattr(func, "__current_action_name"): func.reset_cache() - if args[6] != func.__current_action_name or args[0] != func.__current_armature_name: + if cache_key_args[6] != func.__current_action_name or cache_key_args[0] != func.__current_armature_uuid: result = func(*args) func.__bonecache = result - func.__current_action_name = args[6] - func.__current_armature_name = args[0] - return result[args[7]][pose_bone_if_armature.name] + func.__current_action_name = cache_key_args[6] + func.__current_armature_uuid = cache_key_args[0] + return result[cache_key_args[7]][pose_bone_if_armature.name] else: - return func.__bonecache[args[7]][pose_bone_if_armature.name] + return func.__bonecache[cache_key_args[7]][pose_bone_if_armature.name] return wrapper_bonecache # TODO: replace "cached" with "unique" in all cases where the caching is functional and not only for performance reasons @@ -103,23 +143,27 @@ unique = cached def skdriverdiscovercache(func): def reset_cache_skdriverdiscovercache(): - func.__current_armature_name = None + func.__current_armature_uuid = None func.__skdriverdiscover = {} func.reset_cache = reset_cache_skdriverdiscovercache @functools.wraps(func) def wrapper_skdriverdiscover(*args, **kwargs): - if not hasattr(func, "__current_armature_name") or func.__current_armature_name is None: + + cache_key_args = args + cache_key_args = args[:-1] + + if not hasattr(func, "__current_armature_uuid") or func.__current_armature_uuid is None: func.reset_cache() - if args[0] != func.__current_armature_name: + if cache_key_args[0] != func.__current_armature_uuid: result = func(*args) - func.__skdriverdiscover[args[0]] = result - func.__current_armature_name = args[0] + func.__skdriverdiscover[cache_key_args[0]] = result + func.__current_armature_uuid = cache_key_args[0] return result else: - return func.__skdriverdiscover[args[0]] + return func.__skdriverdiscover[cache_key_args[0]] return wrapper_skdriverdiscover def skdrivervalues(func): @@ -134,12 +178,17 @@ def skdrivervalues(func): if not hasattr(func, "__skdrivervalues") or func.__skdrivervalues is None: func.reset_cache() - if args[0].name not in func.__skdrivervalues.keys(): - func.__skdrivervalues[args[0].name] = {} - if args[1] not in func.__skdrivervalues[args[0].name]: + armature = args[-1]['vtree'].nodes[args[0]].blender_object + + cache_key_args = args + cache_key_args = args[:-1] + + if armature.name not in func.__skdrivervalues.keys(): + func.__skdrivervalues[armature.name] = {} + if cache_key_args[1] not in func.__skdrivervalues[armature.name]: vals = func(*args) - func.__skdrivervalues[args[0].name][args[1]] = vals + func.__skdrivervalues[armature.name][cache_key_args[1]] = vals return vals else: - return func.__skdrivervalues[args[0].name][args[1]] + return func.__skdrivervalues[armature.name][cache_key_args[1]] return wrapper_skdrivervalues diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_cameras.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_cameras.py index 8ac15307..cee3cb06 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_cameras.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_cameras.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import cached from ..com.gltf2_blender_extras import generate_extras diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_drivers.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_drivers.py index d639c9ac..4e77f60e 100644 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_drivers.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_drivers.py @@ -1,28 +1,24 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import skdriverdiscovercache, skdrivervalues from io_scene_gltf2.blender.com.gltf2_blender_data_path import get_target_object_path - @skdriverdiscovercache -def get_sk_drivers(blender_armature): +def get_sk_drivers(blender_armature_uuid, export_settings): + + blender_armature = export_settings['vtree'].nodes[blender_armature_uuid].blender_object drivers = [] - for child in blender_armature.children: + for child_uuid in export_settings['vtree'].nodes[blender_armature_uuid].children: + + if export_settings['vtree'].nodes[child_uuid].blender_type == "BONE": + continue + + child = export_settings['vtree'].nodes[child_uuid].blender_object + if not child.data: continue # child.data can be an armature - which has no shapekeys @@ -74,13 +70,14 @@ def get_sk_drivers(blender_armature): all_sorted_channels.append(existing_idx[i]) if len(all_sorted_channels) > 0: - drivers.append((child, tuple(all_sorted_channels))) + drivers.append((child_uuid, tuple(all_sorted_channels))) return tuple(drivers) @skdrivervalues -def get_sk_driver_values(blender_object, frame, fcurves): +def get_sk_driver_values(blender_object_uuid, frame, fcurves, export_settings): sk_values = [] + blender_object = export_settings['vtree'].nodes[blender_object_uuid].blender_object for f in [f for f in fcurves if f is not None]: sk_values.append(blender_object.data.shape_keys.path_resolve(get_target_object_path(f.data_path)).value) diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py index baee02bd..8e43c2c1 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy import typing diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_joints.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_joints.py index 1abe9ec1..f4fd6c51 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_joints.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_joints.py @@ -1,18 +1,7 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import mathutils + +from mathutils import Matrix, Quaternion, Vector from . import gltf2_blender_export_keys from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import cached @@ -20,9 +9,40 @@ from io_scene_gltf2.io.com import gltf2_io from io_scene_gltf2.blender.exp import gltf2_blender_gather_skins from io_scene_gltf2.io.exp.gltf2_io_user_extensions import export_user_extensions from ..com.gltf2_blender_extras import generate_extras +from io_scene_gltf2.blender.exp import gltf2_blender_gather_tree + + + +# TODO these 3 functions move to shared file +def __convert_swizzle_location(loc, export_settings): + """Convert a location from Blender coordinate system to glTF coordinate system.""" + if export_settings[gltf2_blender_export_keys.YUP]: + return Vector((loc[0], loc[2], -loc[1])) + else: + return Vector((loc[0], loc[1], loc[2])) + + +def __convert_swizzle_rotation(rot, export_settings): + """ + Convert a quaternion rotation from Blender coordinate system to glTF coordinate system. + + 'w' is still at first position. + """ + if export_settings[gltf2_blender_export_keys.YUP]: + return Quaternion((rot[0], rot[1], rot[3], -rot[2])) + else: + return Quaternion((rot[0], rot[1], rot[2], rot[3])) + + +def __convert_swizzle_scale(scale, export_settings): + """Convert a scale from Blender coordinate system to glTF coordinate system.""" + if export_settings[gltf2_blender_export_keys.YUP]: + return Vector((scale[0], scale[2], scale[1])) + else: + return Vector((scale[0], scale[1], scale[2])) @cached -def gather_joint(blender_object, blender_bone, export_settings): +def gather_joint_vnode(vnode, export_settings): """ Generate a glTF2 node from a blender bone, as joints in glTF2 are simply nodes. @@ -30,28 +50,19 @@ def gather_joint(blender_object, blender_bone, export_settings): :param export_settings: the settings for this export :return: a glTF2 node (acting as a joint) """ - axis_basis_change = mathutils.Matrix.Identity(4) - if export_settings[gltf2_blender_export_keys.YUP]: - axis_basis_change = mathutils.Matrix( - ((1.0, 0.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, -1.0, 0.0, 0.0), (0.0, 0.0, 0.0, 1.0))) + vtree = export_settings['vtree'] + blender_object = vtree.nodes[vnode].blender_object + blender_bone = vtree.nodes[vnode].blender_bone - # extract bone transform - if blender_bone.parent is None: - correction_matrix_local = axis_basis_change @ blender_bone.bone.matrix_local - else: - correction_matrix_local = ( - blender_bone.parent.bone.matrix_local.inverted_safe() @ - blender_bone.bone.matrix_local - ) - - if (blender_bone.bone.use_inherit_rotation == False or blender_bone.bone.inherit_scale != "FULL") and blender_bone.parent != None: - rest_mat = (blender_bone.parent.bone.matrix_local.inverted_safe() @ blender_bone.bone.matrix_local) - matrix_basis = (rest_mat.inverted_safe() @ blender_bone.parent.matrix.inverted_safe() @ blender_bone.matrix) - else: - matrix_basis = blender_bone.matrix - matrix_basis = blender_object.convert_space(pose_bone=blender_bone, matrix=matrix_basis, from_space='POSE', to_space='LOCAL') - trans, rot, sca = (correction_matrix_local @ matrix_basis).decompose() + mat = vtree.nodes[vtree.nodes[vnode].parent_uuid].matrix_world.inverted_safe() @ vtree.nodes[vnode].matrix_world + + trans, rot, sca = mat.decompose() + + trans = __convert_swizzle_location(trans, export_settings) + rot = __convert_swizzle_rotation(rot, export_settings) + sca = __convert_swizzle_scale(sca, export_settings) + translation, rotation, scale = (None, None, None) if trans[0] != 0.0 or trans[1] != 0.0 or trans[2] != 0.0: translation = [trans[0], trans[1], trans[2]] @@ -63,14 +74,8 @@ def gather_joint(blender_object, blender_bone, export_settings): # traverse into children children = [] - if export_settings["gltf_def_bones"] is False: - for bone in blender_bone.children: - children.append(gather_joint(blender_object, bone, export_settings)) - else: - _, children_, _ = gltf2_blender_gather_skins.get_bone_tree(None, blender_bone.id_data) - if blender_bone.name in children_.keys(): - for bone in children_[blender_bone.name]: - children.append(gather_joint(blender_object, blender_bone.id_data.pose.bones[bone], export_settings)) + for bone_uuid in [c for c in vtree.nodes[vnode].children if vtree.nodes[c].blender_type == gltf2_blender_gather_tree.VExportNode.BONE]: + children.append(gather_joint_vnode(bone_uuid, export_settings)) # finally add to the joints array containing all the joints in the hierarchy node = gltf2_io.Node( @@ -90,6 +95,8 @@ def gather_joint(blender_object, blender_bone, export_settings): export_user_extensions('gather_joint_hook', export_settings, node, blender_bone) + vtree.nodes[vnode].node = node + return node def __gather_extras(blender_bone, export_settings): diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_light_spots.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_light_spots.py index b9b9f324..b740b294 100644 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_light_spots.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_light_spots.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. from typing import Optional from io_scene_gltf2.io.com import gltf2_io_lights_punctual diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_lights.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_lights.py index 9614263c..615bd01b 100644 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_lights.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_lights.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy import math diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py index ff0c2cfe..3805e9bd 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py @@ -1,20 +1,10 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +from copy import deepcopy import bpy -from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import cached +from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import cached, cached_by_key from io_scene_gltf2.io.com import gltf2_io from io_scene_gltf2.io.com.gltf2_io_extensions import Extension from io_scene_gltf2.blender.exp import gltf2_blender_gather_texture_info, gltf2_blender_export_keys @@ -27,9 +17,18 @@ from io_scene_gltf2.blender.exp import gltf2_blender_get from io_scene_gltf2.io.exp.gltf2_io_user_extensions import export_user_extensions from io_scene_gltf2.io.com.gltf2_io_debug import print_console - @cached -def gather_material(blender_material, export_settings): +def get_material_cache_key(blender_material, active_uvmap_index, export_settings): + # Use id of material + # Do not use bpy.types that can be unhashable + # Do not use material name, that can be not unique (when linked) + return ( + (id(blender_material),), + (active_uvmap_index,) + ) + +@cached_by_key(key=get_material_cache_key) +def gather_material(blender_material, active_uvmap_index, export_settings): """ Gather the material used by the blender primitive. @@ -40,26 +39,85 @@ def gather_material(blender_material, export_settings): if not __filter_material(blender_material, export_settings): return None - mat_unlit = __gather_material_unlit(blender_material, export_settings) + mat_unlit = __gather_material_unlit(blender_material, active_uvmap_index, export_settings) if mat_unlit is not None: return mat_unlit orm_texture = __gather_orm_texture(blender_material, export_settings) - material = gltf2_io.Material( + emissive_texture, uvmap_actives_emissive_texture = __gather_emissive_texture(blender_material, export_settings) + extensions, uvmap_actives_extensions = __gather_extensions(blender_material, export_settings) + normal_texture, uvmap_actives_normal_texture = __gather_normal_texture(blender_material, export_settings) + occlusion_texture, uvmap_actives_occlusion_texture = __gather_occlusion_texture(blender_material, orm_texture, export_settings) + pbr_metallic_roughness, uvmap_actives_pbr_metallic_roughness = __gather_pbr_metallic_roughness(blender_material, orm_texture, export_settings) + + base_material = gltf2_io.Material( alpha_cutoff=__gather_alpha_cutoff(blender_material, export_settings), alpha_mode=__gather_alpha_mode(blender_material, export_settings), double_sided=__gather_double_sided(blender_material, export_settings), emissive_factor=__gather_emissive_factor(blender_material, export_settings), - emissive_texture=__gather_emissive_texture(blender_material, export_settings), - extensions=__gather_extensions(blender_material, export_settings), + emissive_texture=emissive_texture, + extensions=extensions, extras=__gather_extras(blender_material, export_settings), name=__gather_name(blender_material, export_settings), - normal_texture=__gather_normal_texture(blender_material, export_settings), - occlusion_texture=__gather_occlusion_texture(blender_material, orm_texture, export_settings), - pbr_metallic_roughness=__gather_pbr_metallic_roughness(blender_material, orm_texture, export_settings) + normal_texture=normal_texture, + occlusion_texture=occlusion_texture, + pbr_metallic_roughness=pbr_metallic_roughness ) + + # merge all uvmap_actives + uvmap_actives = [] + if uvmap_actives_emissive_texture: + uvmap_actives.extend(uvmap_actives_emissive_texture) + if uvmap_actives_extensions: + uvmap_actives.extend(uvmap_actives_extensions) + if uvmap_actives_normal_texture: + uvmap_actives.extend(uvmap_actives_normal_texture) + if uvmap_actives_occlusion_texture: + uvmap_actives.extend(uvmap_actives_occlusion_texture) + if uvmap_actives_pbr_metallic_roughness: + uvmap_actives.extend(uvmap_actives_pbr_metallic_roughness) + + # Because some part of material are shared (eg pbr_metallic_roughness), we must copy the material + # Texture must be shared, but not TextureInfo + material = deepcopy(base_material) + __get_new_material_texture_shared(base_material, material) + + active_uvmap_index = active_uvmap_index if active_uvmap_index != 0 else None + + for tex in uvmap_actives: + if tex == "emissiveTexture": + material.emissive_texture.tex_coord = active_uvmap_index + elif tex == "normalTexture": + material.normal_texture.tex_coord = active_uvmap_index + elif tex == "occlusionTexture": + material.occlusion_texture.tex_coord = active_uvmap_index + elif tex == "baseColorTexture": + material.pbr_metallic_roughness.base_color_texture.tex_coord = active_uvmap_index + elif tex == "metallicRoughnessTexture": + material.pbr_metallic_roughness.metallic_roughness_texture.tex_coord = active_uvmap_index + elif tex == "clearcoatTexture": + material.extensions["KHR_materials_clearcoat"].extension['clearcoatTexture'].tex_coord = active_uvmap_index + elif tex == "clearcoatRoughnessTexture": + material.extensions["KHR_materials_clearcoat"].extension['clearcoatRoughnessTexture'].tex_coord = active_uvmap_index + elif tex == "clearcoatNormalTexture": #TODO not tested yet + material.extensions["KHR_materials_clearcoat"].extension['clearcoatNormalTexture'].tex_coord = active_uvmap_index + elif tex == "transmissionTexture": #TODO not tested yet + material.extensions["KHR_materials_transmission"].extension['transmissionTexture'].tex_coord = active_uvmap_index + + # If material is not using active UVMap, we need to return the same material, + # Even if multiples meshes are using different active UVMap + if len(uvmap_actives) == 0 and active_uvmap_index != -1: + material = gather_material(blender_material, -1, export_settings) + + + # If emissive is set, from an emissive node (not PBR) + # We need to set manually default values for + # pbr_metallic_roughness.baseColor + if material.emissive_factor is not None and gltf2_blender_get.get_node_socket(blender_material, bpy.types.ShaderNodeBsdfPrincipled, "Base Color") is None: + material.pbr_metallic_roughness = gltf2_blender_gather_materials_pbr_metallic_roughness.get_default_pbr_for_emissive_node() + export_user_extensions('gather_material_hook', export_settings, material, blender_material) return material @@ -79,6 +137,25 @@ def gather_material(blender_material, export_settings): # 'material'] + ' not found. Please assign glTF 2.0 material or enable Blinn-Phong material in export.') +def __get_new_material_texture_shared(base, node): + if node is None: + return + if callable(node) is True: + return + if node.__str__().startswith('__'): + return + if type(node) in [gltf2_io.TextureInfo, gltf2_io.MaterialOcclusionTextureInfoClass, gltf2_io.MaterialNormalTextureInfoClass]: + node.index = base.index + else: + if hasattr(node, '__dict__'): + for attr, value in node.__dict__.items(): + __get_new_material_texture_shared(getattr(base, attr), value) + else: + # For extensions (on a dict) + if type(node).__name__ == 'dict': + for i in node.keys(): + __get_new_material_texture_shared(base[i], node[i]) + def __filter_material(blender_material, export_settings): return export_settings[gltf2_blender_export_keys.MATERIALS] @@ -154,25 +231,29 @@ def __gather_emissive_texture(blender_material, export_settings): emissive = gltf2_blender_get.get_socket(blender_material, "Emissive") if emissive is None: emissive = gltf2_blender_get.get_socket_old(blender_material, "Emissive") - return gltf2_blender_gather_texture_info.gather_texture_info(emissive, (emissive,), export_settings) + emissive_texture, use_actives_uvmap_emissive = gltf2_blender_gather_texture_info.gather_texture_info(emissive, (emissive,), export_settings) + return emissive_texture, ["emissiveTexture"] if use_actives_uvmap_emissive else None def __gather_extensions(blender_material, export_settings): extensions = {} # KHR_materials_clearcoat + actives_uvmaps = [] - clearcoat_extension = __gather_clearcoat_extension(blender_material, export_settings) + clearcoat_extension, use_actives_uvmap_clearcoat = __gather_clearcoat_extension(blender_material, export_settings) if clearcoat_extension: extensions["KHR_materials_clearcoat"] = clearcoat_extension + actives_uvmaps.extend(use_actives_uvmap_clearcoat) # KHR_materials_transmission - transmission_extension = __gather_transmission_extension(blender_material, export_settings) + transmission_extension, use_actives_uvmap_transmission = __gather_transmission_extension(blender_material, export_settings) if transmission_extension: extensions["KHR_materials_transmission"] = transmission_extension + actives_uvmaps.extend(use_actives_uvmap_transmission) - return extensions if extensions else None + return extensions, actives_uvmaps if extensions else None def __gather_extras(blender_material, export_settings): @@ -189,10 +270,11 @@ def __gather_normal_texture(blender_material, export_settings): normal = gltf2_blender_get.get_socket(blender_material, "Normal") if normal is None: normal = gltf2_blender_get.get_socket_old(blender_material, "Normal") - return gltf2_blender_gather_texture_info.gather_material_normal_texture_info_class( + normal_texture, use_active_uvmap_normal = gltf2_blender_gather_texture_info.gather_material_normal_texture_info_class( normal, (normal,), export_settings) + return normal_texture, ["normalTexture"] if use_active_uvmap_normal else None def __gather_orm_texture(blender_material, export_settings): @@ -230,7 +312,7 @@ def __gather_orm_texture(blender_material, export_settings): return None # Double-check this will past the filter in texture_info - info = gltf2_blender_gather_texture_info.gather_texture_info(result[0], result, export_settings) + info, info_use_active_uvmap = gltf2_blender_gather_texture_info.gather_texture_info(result[0], result, export_settings) if info is None: return None @@ -240,10 +322,11 @@ def __gather_occlusion_texture(blender_material, orm_texture, export_settings): occlusion = gltf2_blender_get.get_socket(blender_material, "Occlusion") if occlusion is None: occlusion = gltf2_blender_get.get_socket_old(blender_material, "Occlusion") - return gltf2_blender_gather_texture_info.gather_material_occlusion_texture_info_class( + occlusion_texture, use_active_uvmap_occlusion = gltf2_blender_gather_texture_info.gather_material_occlusion_texture_info_class( occlusion, orm_texture or (occlusion,), export_settings) + return occlusion_texture, ["occlusionTexture"] if use_active_uvmap_occlusion else None def __gather_pbr_metallic_roughness(blender_material, orm_texture, export_settings): @@ -283,7 +366,7 @@ def __gather_clearcoat_extension(blender_material, export_settings): clearcoat_enabled = True if not clearcoat_enabled: - return None + return None, None if isinstance(clearcoat_roughness_socket, bpy.types.NodeSocket) and not clearcoat_roughness_socket.is_linked: clearcoat_extension['clearcoatRoughnessFactor'] = clearcoat_roughness_socket.default_value @@ -301,28 +384,38 @@ def __gather_clearcoat_extension(blender_material, export_settings): elif has_clearcoat_roughness_texture: clearcoat_roughness_slots = (clearcoat_roughness_socket,) + use_actives_uvmaps = [] + if len(clearcoat_roughness_slots) > 0: if has_clearcoat_texture: - clearcoat_extension['clearcoatTexture'] = gltf2_blender_gather_texture_info.gather_texture_info( + clearcoat_texture, clearcoat_texture_use_active_uvmap = gltf2_blender_gather_texture_info.gather_texture_info( clearcoat_socket, clearcoat_roughness_slots, export_settings, ) + clearcoat_extension['clearcoatTexture'] = clearcoat_texture + if clearcoat_texture_use_active_uvmap: + use_actives_uvmaps.append("clearcoatTexture") if has_clearcoat_roughness_texture: - clearcoat_extension['clearcoatRoughnessTexture'] = gltf2_blender_gather_texture_info.gather_texture_info( + clearcoat_roughness_texture, clearcoat_roughness_texture_use_active_uvmap = gltf2_blender_gather_texture_info.gather_texture_info( clearcoat_roughness_socket, clearcoat_roughness_slots, export_settings, ) - + clearcoat_extension['clearcoatRoughnessTexture'] = clearcoat_roughness_texture + if clearcoat_roughness_texture_use_active_uvmap: + use_actives_uvmaps.append("clearcoatRoughnessTexture") if __has_image_node_from_socket(clearcoat_normal_socket): - clearcoat_extension['clearcoatNormalTexture'] = gltf2_blender_gather_texture_info.gather_material_normal_texture_info_class( + clearcoat_normal_texture, clearcoat_normal_texture_use_active_uvmap = gltf2_blender_gather_texture_info.gather_material_normal_texture_info_class( clearcoat_normal_socket, (clearcoat_normal_socket,), export_settings ) + clearcoat_extension['clearcoatNormalTexture'] = clearcoat_normal_texture + if clearcoat_normal_texture_use_active_uvmap: + use_actives_uvmaps.append("clearcoatNormalTexture") - return Extension('KHR_materials_clearcoat', clearcoat_extension, False) + return Extension('KHR_materials_clearcoat', clearcoat_extension, False), use_actives_uvmaps def __gather_transmission_extension(blender_material, export_settings): transmission_enabled = False @@ -337,37 +430,43 @@ def __gather_transmission_extension(blender_material, export_settings): transmission_extension['transmissionFactor'] = transmission_socket.default_value transmission_enabled = transmission_extension['transmissionFactor'] > 0 elif __has_image_node_from_socket(transmission_socket): - transmission_extension['transmissionFactor'] = 1 + transmission_extension['transmissionFactor'] = 1.0 has_transmission_texture = True transmission_enabled = True if not transmission_enabled: - return None + return None, None # Pack transmission channel (R). if has_transmission_texture: transmission_slots = (transmission_socket,) + use_actives_uvmaps = [] + if len(transmission_slots) > 0: - combined_texture = gltf2_blender_gather_texture_info.gather_texture_info( + combined_texture, use_active_uvmap = gltf2_blender_gather_texture_info.gather_texture_info( transmission_socket, transmission_slots, export_settings, ) if has_transmission_texture: transmission_extension['transmissionTexture'] = combined_texture + if use_active_uvmap: + use_actives_uvmaps.append("transmissionTexture") - return Extension('KHR_materials_transmission', transmission_extension, False) + return Extension('KHR_materials_transmission', transmission_extension, False), use_actives_uvmaps -def __gather_material_unlit(blender_material, export_settings): +def __gather_material_unlit(blender_material, active_uvmap_index, export_settings): gltf2_unlit = gltf2_blender_gather_materials_unlit info = gltf2_unlit.detect_shadeless_material(blender_material, export_settings) if info is None: return None - material = gltf2_io.Material( + base_color_texture, use_active_uvmap = gltf2_unlit.gather_base_color_texture(info, export_settings) + + base_material = gltf2_io.Material( alpha_cutoff=__gather_alpha_cutoff(blender_material, export_settings), alpha_mode=__gather_alpha_mode(blender_material, export_settings), double_sided=__gather_double_sided(blender_material, export_settings), @@ -381,7 +480,7 @@ def __gather_material_unlit(blender_material, export_settings): pbr_metallic_roughness=gltf2_io.MaterialPBRMetallicRoughness( base_color_factor=gltf2_unlit.gather_base_color_factor(info, export_settings), - base_color_texture=gltf2_unlit.gather_base_color_texture(info, export_settings), + base_color_texture=base_color_texture, metallic_factor=0.0, roughness_factor=0.9, metallic_roughness_texture=None, @@ -390,6 +489,19 @@ def __gather_material_unlit(blender_material, export_settings): ) ) + if use_active_uvmap is not None: + # Because some part of material are shared (eg pbr_metallic_roughness), we must copy the material + # Texture must be shared, but not TextureInfo + material = deepcopy(base_material) + __get_new_material_texture_shared(base_material, material) + material.pbr_metallic_roughness.base_color_texture.tex_coord = active_uvmap_index + elif use_active_uvmap is None and active_uvmap_index != -1: + # If material is not using active UVMap, we need to return the same material, + # Even if multiples meshes are using different active UVMap + material = gather_material(blender_material, -1, export_settings) + else: + material = base_material + export_user_extensions('gather_material_unlit_hook', export_settings, material, blender_material) return material diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_pbr_metallic_roughness.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_pbr_metallic_roughness.py index e885b21b..0b40ffd6 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_pbr_metallic_roughness.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_pbr_metallic_roughness.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy @@ -24,21 +13,31 @@ from io_scene_gltf2.io.exp.gltf2_io_user_extensions import export_user_extension @cached def gather_material_pbr_metallic_roughness(blender_material, orm_texture, export_settings): if not __filter_pbr_material(blender_material, export_settings): - return None + return None, None + + base_color_texture, use_active_uvmap_base_color_texture = __gather_base_color_texture(blender_material, export_settings) + metallic_roughness_texture, use_active_uvmap_metallic_roughness_texture = __gather_metallic_roughness_texture(blender_material, orm_texture, export_settings) material = gltf2_io.MaterialPBRMetallicRoughness( base_color_factor=__gather_base_color_factor(blender_material, export_settings), - base_color_texture=__gather_base_color_texture(blender_material, export_settings), + base_color_texture=base_color_texture, extensions=__gather_extensions(blender_material, export_settings), extras=__gather_extras(blender_material, export_settings), metallic_factor=__gather_metallic_factor(blender_material, export_settings), - metallic_roughness_texture=__gather_metallic_roughness_texture(blender_material, orm_texture, export_settings), + metallic_roughness_texture=metallic_roughness_texture, roughness_factor=__gather_roughness_factor(blender_material, export_settings) ) + # merge all use_active_uvmap infos + uvmap_actives = [] + if use_active_uvmap_base_color_texture is True: + uvmap_actives.append("baseColorTexture") + if use_active_uvmap_metallic_roughness_texture is True: + uvmap_actives.append("metallicRoughnessTexture") + export_user_extensions('gather_material_pbr_metallic_roughness_hook', export_settings, material, blender_material, orm_texture) - return material + return material, uvmap_actives def __filter_pbr_material(blender_material, export_settings): @@ -53,7 +52,7 @@ def __gather_base_color_factor(blender_material, export_settings): alpha_socket = gltf2_blender_get.get_socket(blender_material, "Alpha") if isinstance(alpha_socket, bpy.types.NodeSocket): - if export_settings['gltf_image_format'] != "NONE": + if export_settings['gltf_image_format'] != "NONE": alpha = gltf2_blender_get.get_factor_from_socket(alpha_socket, kind='VALUE') else: alpha = gltf2_blender_get.get_const_from_default_value_socket(alpha_socket, kind='VALUE') @@ -93,7 +92,7 @@ def __gather_base_color_texture(blender_material, export_settings): if socket is not None and __has_image_node_from_socket(socket) ) if not inputs: - return None + return None, None return gltf2_blender_gather_texture_info.gather_texture_info(inputs[0], inputs, export_settings) @@ -129,7 +128,7 @@ def __gather_metallic_roughness_texture(blender_material, orm_texture, export_se if not hasMetal and not hasRough: metallic_roughness = gltf2_blender_get.get_socket_old(blender_material, "MetallicRoughness") if metallic_roughness is None or not __has_image_node_from_socket(metallic_roughness): - return None + return None, None texture_input = (metallic_roughness,) elif not hasMetal: texture_input = (roughness_socket,) @@ -164,3 +163,14 @@ def __has_image_node_from_socket(socket): if not result: return False return True + +def get_default_pbr_for_emissive_node(): + return gltf2_io.MaterialPBRMetallicRoughness( + base_color_factor=[0.0,0.0,0.0,1.0], + base_color_texture=None, + extensions=None, + extras=None, + metallic_factor=None, + metallic_roughness_texture=None, + roughness_factor=None + ) diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_unlit.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_unlit.py index 36e6b4b4..e104b7f1 100644 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_unlit.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_unlit.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. from io_scene_gltf2.blender.exp import gltf2_blender_gather_texture_info from io_scene_gltf2.blender.exp import gltf2_blender_get @@ -138,9 +127,10 @@ def gather_base_color_texture(info, export_settings): # because gather_image determines how to pack images based on the # names of sockets, and the names are hard-coded to a Principled # style graph. - return gltf2_blender_gather_texture_info.gather_texture_info( + unlit_texture, unlit_use_active_uvmap = gltf2_blender_gather_texture_info.gather_texture_info( sockets[0], sockets, export_settings, ) - return None + return unlit_texture, ["unlitTexture"] if unlit_use_active_uvmap else None + return None, None diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_mesh.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_mesh.py index 4b301d22..fd334cb3 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_mesh.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_mesh.py @@ -1,21 +1,10 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy from typing import Optional, Dict, List, Any, Tuple from .gltf2_blender_export_keys import MORPH -from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import cached +from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import cached, cached_by_key from io_scene_gltf2.io.com import gltf2_io from io_scene_gltf2.blender.exp import gltf2_blender_gather_primitives from ..com.gltf2_blender_extras import generate_extras @@ -23,31 +12,64 @@ from io_scene_gltf2.io.com.gltf2_io_debug import print_console from io_scene_gltf2.io.exp.gltf2_io_user_extensions import export_user_extensions -@cached +def get_mesh_cache_key(blender_mesh, + blender_object, + vertex_groups, + modifiers, + skip_filter, + materials, + original_mesh, + export_settings): + # Use id of original mesh + # Do not use bpy.types that can be unhashable + # Do not use mesh name, that can be not unique (when linked) + + # If materials are not exported, no need to cache by material + if export_settings['gltf_materials'] is None: + mats = None + else: + mats = tuple(id(m) if m is not None else None for m in materials) + + # TODO check what is really needed for modifiers + + mesh_to_id_cache = blender_mesh if original_mesh is None else original_mesh + return ( + (id(mesh_to_id_cache),), + (modifiers,), + (skip_filter,), #TODO to check if still needed + mats + ) + +@cached_by_key(key=get_mesh_cache_key) def gather_mesh(blender_mesh: bpy.types.Mesh, - library: Optional[str], - blender_object: Optional[bpy.types.Object], + uuid_for_skined_data, vertex_groups: Optional[bpy.types.VertexGroups], modifiers: Optional[bpy.types.ObjectModifiers], skip_filter: bool, - material_names: Tuple[str], + materials: Tuple[bpy.types.Material], + original_mesh: bpy.types.Mesh, export_settings ) -> Optional[gltf2_io.Mesh]: - if not skip_filter and not __filter_mesh(blender_mesh, library, vertex_groups, modifiers, export_settings): + if not skip_filter and not __filter_mesh(blender_mesh, vertex_groups, modifiers, export_settings): return None mesh = gltf2_io.Mesh( - extensions=__gather_extensions(blender_mesh, library, vertex_groups, modifiers, export_settings), - extras=__gather_extras(blender_mesh, library, vertex_groups, modifiers, export_settings), - name=__gather_name(blender_mesh, library, vertex_groups, modifiers, export_settings), - weights=__gather_weights(blender_mesh, library, vertex_groups, modifiers, export_settings), - primitives=__gather_primitives(blender_mesh, library, blender_object, vertex_groups, modifiers, material_names, export_settings), + extensions=__gather_extensions(blender_mesh, vertex_groups, modifiers, export_settings), + extras=__gather_extras(blender_mesh, vertex_groups, modifiers, export_settings), + name=__gather_name(blender_mesh, vertex_groups, modifiers, export_settings), + weights=__gather_weights(blender_mesh, vertex_groups, modifiers, export_settings), + primitives=__gather_primitives(blender_mesh, uuid_for_skined_data, vertex_groups, modifiers, materials, export_settings), ) if len(mesh.primitives) == 0: print_console("WARNING", "Mesh '{}' has no primitives and will be omitted.".format(mesh.name)) return None + blender_object = None + if uuid_for_skined_data: + blender_object = export_settings['vtree'].nodes[uuid_for_skined_data].blender_object + + export_user_extensions('gather_mesh_hook', export_settings, mesh, @@ -56,13 +78,12 @@ def gather_mesh(blender_mesh: bpy.types.Mesh, vertex_groups, modifiers, skip_filter, - material_names) + materials) return mesh def __filter_mesh(blender_mesh: bpy.types.Mesh, - library: Optional[str], vertex_groups: Optional[bpy.types.VertexGroups], modifiers: Optional[bpy.types.ObjectModifiers], export_settings @@ -74,7 +95,6 @@ def __filter_mesh(blender_mesh: bpy.types.Mesh, def __gather_extensions(blender_mesh: bpy.types.Mesh, - library: Optional[str], vertex_groups: Optional[bpy.types.VertexGroups], modifiers: Optional[bpy.types.ObjectModifiers], export_settings @@ -83,7 +103,6 @@ def __gather_extensions(blender_mesh: bpy.types.Mesh, def __gather_extras(blender_mesh: bpy.types.Mesh, - library: Optional[str], vertex_groups: Optional[bpy.types.VertexGroups], modifiers: Optional[bpy.types.ObjectModifiers], export_settings @@ -111,7 +130,6 @@ def __gather_extras(blender_mesh: bpy.types.Mesh, def __gather_name(blender_mesh: bpy.types.Mesh, - library: Optional[str], vertex_groups: Optional[bpy.types.VertexGroups], modifiers: Optional[bpy.types.ObjectModifiers], export_settings @@ -120,24 +138,21 @@ def __gather_name(blender_mesh: bpy.types.Mesh, def __gather_primitives(blender_mesh: bpy.types.Mesh, - library: Optional[str], - blender_object: Optional[bpy.types.Object], + uuid_for_skined_data, vertex_groups: Optional[bpy.types.VertexGroups], modifiers: Optional[bpy.types.ObjectModifiers], - material_names: Tuple[str], + materials: Tuple[bpy.types.Material], export_settings ) -> List[gltf2_io.MeshPrimitive]: return gltf2_blender_gather_primitives.gather_primitives(blender_mesh, - library, - blender_object, + uuid_for_skined_data, vertex_groups, modifiers, - material_names, + materials, export_settings) def __gather_weights(blender_mesh: bpy.types.Mesh, - library: Optional[str], vertex_groups: Optional[bpy.types.VertexGroups], modifiers: Optional[bpy.types.ObjectModifiers], export_settings diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py index 13c347dc..b0b2d4b8 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import math import bpy @@ -24,135 +13,47 @@ from io_scene_gltf2.blender.exp import gltf2_blender_gather_cameras from io_scene_gltf2.blender.exp import gltf2_blender_gather_mesh from io_scene_gltf2.blender.exp import gltf2_blender_gather_joints from io_scene_gltf2.blender.exp import gltf2_blender_gather_lights +from io_scene_gltf2.blender.exp.gltf2_blender_gather_tree import VExportNode from ..com.gltf2_blender_extras import generate_extras from io_scene_gltf2.io.com import gltf2_io from io_scene_gltf2.io.com import gltf2_io_extensions from io_scene_gltf2.io.exp.gltf2_io_user_extensions import export_user_extensions from io_scene_gltf2.io.com.gltf2_io_debug import print_console +from io_scene_gltf2.blender.exp import gltf2_blender_gather_tree -def gather_node(blender_object, library, blender_scene, dupli_object_parent, export_settings): - # custom cache to avoid cache miss when called from animation - # with blender_scene=None - - # invalidate cache if export settings have changed - if not hasattr(gather_node, "__export_settings") or export_settings != gather_node.__export_settings: - gather_node.__cache = {} - gather_node.__export_settings = export_settings - - if blender_scene is None and (blender_object.name, library) in gather_node.__cache: - return gather_node.__cache[(blender_object.name, library)] - - node = __gather_node(blender_object, library, blender_scene, dupli_object_parent, export_settings) - gather_node.__cache[(blender_object.name, library)] = node - return node - -@cached -def __gather_node(blender_object, library, blender_scene, dupli_object_parent, export_settings): - children, only_bone_children = __gather_children(blender_object, blender_scene, export_settings) - - camera = None - mesh = None - skin = None - weights = None - - # If blender_scene is None, we are coming from animation export - # Check to know if object is exported is already done, so we don't check - # again if object is instanced in scene : this check was already done when exporting object itself - if not __filter_node(blender_object, blender_scene, export_settings): - if children: - # This node should be filtered out, but has un-filtered children present. - # So, export this node, excluding its camera, mesh, skin, and weights. - # The transformations and animations on this node will have visible effects on children. - - # Armature always have children node(s) (that are bone(s)) - # We have to check if children are only bones or not for armatures - if blender_object.type == "ARMATURE" and only_bone_children is True: - return None - - pass - else: - # This node is filtered out, and has no un-filtered children or descendants. - return None - else: - # This node is being fully exported. - camera = __gather_camera(blender_object, export_settings) - mesh = __gather_mesh(blender_object, library, export_settings) - skin = __gather_skin(blender_object, export_settings) - weights = __gather_weights(blender_object, export_settings) +def gather_node(vnode, export_settings): + blender_object = vnode.blender_object + skin = __gather_skin(vnode, blender_object, export_settings) node = gltf2_io.Node( - camera=camera, - children=children, + camera=__gather_camera(blender_object, export_settings), + children=__gather_children(vnode, blender_object, export_settings), extensions=__gather_extensions(blender_object, export_settings), extras=__gather_extras(blender_object, export_settings), matrix=__gather_matrix(blender_object, export_settings), - mesh=mesh, + mesh=__gather_mesh(vnode, blender_object, export_settings), name=__gather_name(blender_object, export_settings), rotation=None, scale=None, skin=skin, translation=None, - weights=weights + weights=__gather_weights(blender_object, export_settings) ) # If node mesh is skined, transforms should be ignored at import, so no need to set them here if node.skin is None: - node.translation, node.rotation, node.scale = __gather_trans_rot_scale(blender_object, export_settings) + node.translation, node.rotation, node.scale = __gather_trans_rot_scale(vnode, export_settings) - if export_settings[gltf2_blender_export_keys.YUP]: - # Checking node.extensions is making sure that the type of lamp is managed, and will be exported - if blender_object.type == 'LIGHT' and export_settings[gltf2_blender_export_keys.LIGHTS] and node.extensions: - correction_node = __get_correction_node(blender_object, export_settings) - correction_node.extensions = {"KHR_lights_punctual": node.extensions["KHR_lights_punctual"]} - del node.extensions["KHR_lights_punctual"] - node.children.append(correction_node) - if blender_object.type == 'CAMERA' and export_settings[gltf2_blender_export_keys.CAMERAS]: - correction_node = __get_correction_node(blender_object, export_settings) - correction_node.camera = node.camera - node.children.append(correction_node) - node.camera = None export_user_extensions('gather_node_hook', export_settings, node, blender_object) - return node - - -def __filter_node(blender_object, blender_scene, export_settings): - if blender_object.users == 0: - return False - if blender_scene is not None: - instanced = any([blender_object.name in layer.objects for layer in blender_scene.view_layers]) - if instanced is False: - # Check if object is from a linked collection - if any([blender_object.name in coll.objects for coll in bpy.data.collections if coll.library is not None]): - pass - else: - # Not instanced, not linked -> We don't keep this object - return False - if export_settings[gltf2_blender_export_keys.SELECTED] and blender_object.select_get() is False: - return False + vnode.node = node - if export_settings[gltf2_blender_export_keys.VISIBLE] and blender_object.visible_get() is False: - return False + if node.skin is not None: + vnode.skin = skin - # render_get() doesn't exist, so unfortunately this won't take into account the Collection settings - if export_settings[gltf2_blender_export_keys.RENDERABLE] and blender_object.hide_render is True: - return False - - if export_settings[gltf2_blender_export_keys.ACTIVE_COLLECTION]: - found = any(x == blender_object for x in bpy.context.collection.all_objects) - - if not found: - return False - - if blender_object.type == 'LIGHT': - return export_settings[gltf2_blender_export_keys.LIGHTS] - - if blender_object.type == 'CAMERA': - return export_settings[gltf2_blender_export_keys.CAMERAS] - - return True + return node def __gather_camera(blender_object, export_settings): @@ -162,56 +63,35 @@ def __gather_camera(blender_object, export_settings): return gltf2_blender_gather_cameras.gather_camera(blender_object.data, export_settings) -def __gather_children(blender_object, blender_scene, export_settings): +def __gather_children(vnode, blender_object, export_settings): children = [] - only_bone_children = True # True by default, will be set to False if needed - # standard children - for _child_object in blender_object.children: - if _child_object.parent_bone: - # this is handled further down, - # as the object should be a child of the specific bone, - # not the Armature object - continue - - child_object = _child_object.proxy if _child_object.proxy else _child_object - - node = gather_node(child_object, - child_object.library.name if child_object.library else None, - blender_scene, None, export_settings) + + vtree = export_settings['vtree'] + + # Standard Children / Collection + for c in [vtree.nodes[c] for c in vnode.children if vtree.nodes[c].blender_type != gltf2_blender_gather_tree.VExportNode.BONE]: + node = gather_node(c, export_settings) if node is not None: children.append(node) - only_bone_children = False - # blender dupli objects - if blender_object.instance_type == 'COLLECTION' and blender_object.instance_collection: - for dupli_object in blender_object.instance_collection.objects: - if dupli_object.parent is not None: - continue - if dupli_object.type == "ARMATURE": - continue # There is probably a proxy - node = gather_node(dupli_object, - dupli_object.library.name if dupli_object.library else None, - blender_scene, blender_object.name, export_settings) - if node is not None: - children.append(node) - only_bone_children = False - - # blender bones - if blender_object.type == "ARMATURE": + + + # Armature --> Retrieve Blender bones + if vnode.blender_type == gltf2_blender_gather_tree.VExportNode.ARMATURE: root_joints = [] - if export_settings["gltf_def_bones"] is False: - bones = blender_object.pose.bones - else: - bones, _, _ = gltf2_blender_gather_skins.get_bone_tree(None, blender_object) - bones = [blender_object.pose.bones[b.name] for b in bones] - for blender_bone in bones: - if not blender_bone.parent: - joint = gltf2_blender_gather_joints.gather_joint(blender_object, blender_bone, export_settings) - children.append(joint) - root_joints.append(joint) - # handle objects directly parented to bones - direct_bone_children = [child for child in blender_object.children if child.parent_bone] - if len(direct_bone_children) != 0: - only_bone_children = False + + all_armature_children = vnode.children + root_bones_uuid = [c for c in all_armature_children if export_settings['vtree'].nodes[c].blender_type == VExportNode.BONE] + for bone_uuid in root_bones_uuid: + joint = gltf2_blender_gather_joints.gather_joint_vnode(bone_uuid, export_settings) + children.append(joint) + root_joints.append(joint) + + # Object parented to bones + direct_bone_children = [] + for n in [vtree.nodes[i] for i in vtree.get_all_bones(vnode.uuid)]: + direct_bone_children.extend([c for c in n.children if vtree.nodes[c].blender_type != gltf2_blender_gather_tree.VExportNode.BONE]) + + def find_parent_joint(joints, name): for joint in joints: if joint.name == name: @@ -220,44 +100,40 @@ def __gather_children(blender_object, blender_scene, export_settings): if parent_joint: return parent_joint return None - for child in direct_bone_children: + + for child in direct_bone_children: # List of object that are parented to bones # find parent joint - parent_joint = find_parent_joint(root_joints, child.parent_bone) + parent_joint = find_parent_joint(root_joints, vtree.nodes[child].blender_object.parent_bone) if not parent_joint: continue - child_node = gather_node(child, None, blender_scene, None, export_settings) + child_node = gather_node(vtree.nodes[child], export_settings) if child_node is None: continue blender_bone = blender_object.pose.bones[parent_joint.name] - # fix rotation - if export_settings[gltf2_blender_export_keys.YUP]: - rot = child_node.rotation - if rot is None: - rot = [0, 0, 0, 1] - - rot_quat = Quaternion(rot) - axis_basis_change = Matrix( - ((1.0, 0.0, 0.0, 0.0), (0.0, 0.0, -1.0, 0.0), (0.0, 1.0, 0.0, 0.0), (0.0, 0.0, 0.0, 1.0))) - mat = child.matrix_parent_inverse @ child.matrix_basis - mat = mat @ axis_basis_change - - _, rot_quat, _ = mat.decompose() - child_node.rotation = [rot_quat[1], rot_quat[2], rot_quat[3], rot_quat[0]] - - # fix translation (in blender bone's tail is the origin for children) - trans, _, _ = child.matrix_local.decompose() - if trans is None: - trans = [0, 0, 0] - # bones go down their local y axis - if blender_bone.matrix.to_scale()[1] >= 1e-6: - bone_tail = [0, blender_bone.length / blender_bone.matrix.to_scale()[1], 0] - else: - bone_tail = [0,0,0] # If scale is 0, tail == head - child_node.translation = [trans[idx] + bone_tail[idx] for idx in range(3)] + + mat = vtree.nodes[vtree.nodes[child].parent_bone_uuid].matrix_world.inverted_safe() @ vtree.nodes[child].matrix_world + loc, rot_quat, scale = mat.decompose() + + trans = __convert_swizzle_location(loc, export_settings) + rot = __convert_swizzle_rotation(rot_quat, export_settings) + sca = __convert_swizzle_scale(scale, export_settings) + + + translation, rotation, scale = (None, None, None) + if trans[0] != 0.0 or trans[1] != 0.0 or trans[2] != 0.0: + translation = [trans[0], trans[1], trans[2]] + if rot[0] != 1.0 or rot[1] != 0.0 or rot[2] != 0.0 or rot[3] != 0.0: + rotation = [rot[1], rot[2], rot[3], rot[0]] + if sca[0] != 1.0 or sca[1] != 1.0 or sca[2] != 1.0: + scale = [sca[0], sca[1], sca[2]] + + child_node.translation = translation + child_node.rotation = rotation + child_node.scale = scale parent_joint.children.append(child_node) - return children, only_bone_children + return children def __gather_extensions(blender_object, export_settings): @@ -296,13 +172,17 @@ def __gather_matrix(blender_object, export_settings): return [] -def __gather_mesh(blender_object, library, export_settings): +def __gather_mesh(vnode, blender_object, export_settings): if blender_object.type in ['CURVE', 'SURFACE', 'FONT']: - return __gather_mesh_from_nonmesh(blender_object, library, export_settings) + return __gather_mesh_from_nonmesh(blender_object, export_settings) if blender_object.type != "MESH": return None + # For duplis instancer, when show is off -> export as empty + if vnode.force_as_empty is True: + return None + # Be sure that object is valid (no NaN for example) blender_object.data.validate() @@ -314,26 +194,31 @@ def __gather_mesh(blender_object, library, export_settings): if len(modifiers) == 0: modifiers = None - if export_settings[gltf2_blender_export_keys.APPLY]: - armature_modifiers = {} - if export_settings[gltf2_blender_export_keys.SKINS]: - # temporarily disable Armature modifiers if exporting skins - for idx, modifier in enumerate(blender_object.modifiers): - if modifier.type == 'ARMATURE': - armature_modifiers[idx] = modifier.show_viewport - modifier.show_viewport = False - - depsgraph = bpy.context.evaluated_depsgraph_get() - blender_mesh_owner = blender_object.evaluated_get(depsgraph) - blender_mesh = blender_mesh_owner.to_mesh(preserve_all_data_layers=True, depsgraph=depsgraph) - for prop in blender_object.data.keys(): - blender_mesh[prop] = blender_object.data[prop] - skip_filter = True - if export_settings[gltf2_blender_export_keys.SKINS]: - # restore Armature modifiers - for idx, show_viewport in armature_modifiers.items(): - blender_object.modifiers[idx].show_viewport = show_viewport + if export_settings[gltf2_blender_export_keys.APPLY]: + if modifiers is None: # If no modifier, use original mesh, it will instance all shared mesh in a single glTF mesh + blender_mesh = blender_object.data + skip_filter = False + else: + armature_modifiers = {} + if export_settings[gltf2_blender_export_keys.SKINS]: + # temporarily disable Armature modifiers if exporting skins + for idx, modifier in enumerate(blender_object.modifiers): + if modifier.type == 'ARMATURE': + armature_modifiers[idx] = modifier.show_viewport + modifier.show_viewport = False + + depsgraph = bpy.context.evaluated_depsgraph_get() + blender_mesh_owner = blender_object.evaluated_get(depsgraph) + blender_mesh = blender_mesh_owner.to_mesh(preserve_all_data_layers=True, depsgraph=depsgraph) + for prop in blender_object.data.keys(): + blender_mesh[prop] = blender_object.data[prop] + skip_filter = True + + if export_settings[gltf2_blender_export_keys.SKINS]: + # restore Armature modifiers + for idx, show_viewport in armature_modifiers.items(): + blender_object.modifiers[idx].show_viewport = show_viewport else: blender_mesh = blender_object.data skip_filter = False @@ -348,33 +233,32 @@ def __gather_mesh(blender_object, library, export_settings): modifiers = None materials = tuple(ms.material for ms in blender_object.material_slots) - material_names = tuple(None if mat is None else mat.name for mat in materials) # retrieve armature # Because mesh data will be transforms to skeleton space, # we can't instantiate multiple object at different location, skined by same armature - blender_object_for_skined_data = None + uuid_for_skined_data = None if export_settings[gltf2_blender_export_keys.SKINS]: for idx, modifier in enumerate(blender_object.modifiers): if modifier.type == 'ARMATURE': - blender_object_for_skined_data = blender_object + uuid_for_skined_data = vnode.uuid result = gltf2_blender_gather_mesh.gather_mesh(blender_mesh, - library, - blender_object_for_skined_data, + uuid_for_skined_data, vertex_groups, modifiers, skip_filter, - material_names, + materials, + None, export_settings) - if export_settings[gltf2_blender_export_keys.APPLY]: + if export_settings[gltf2_blender_export_keys.APPLY] and modifiers is not None: blender_mesh_owner.to_mesh_clear() return result -def __gather_mesh_from_nonmesh(blender_object, library, export_settings): +def __gather_mesh_from_nonmesh(blender_object, export_settings): """Handles curves, surfaces, text, etc.""" needs_to_mesh_clear = False try: @@ -400,18 +284,18 @@ def __gather_mesh_from_nonmesh(blender_object, library, export_settings): needs_to_mesh_clear = True skip_filter = True - material_names = tuple([ms.material.name for ms in blender_object.material_slots if ms.material is not None]) + materials = tuple([ms.material for ms in blender_object.material_slots if ms.material is not None]) vertex_groups = None modifiers = None blender_object_for_skined_data = None result = gltf2_blender_gather_mesh.gather_mesh(blender_mesh, - library, blender_object_for_skined_data, vertex_groups, modifiers, skip_filter, - material_names, + materials, + blender_object.data, export_settings) finally: @@ -424,33 +308,15 @@ def __gather_mesh_from_nonmesh(blender_object, library, export_settings): def __gather_name(blender_object, export_settings): return blender_object.name - -def __gather_trans_rot_scale(blender_object, export_settings): - if blender_object.matrix_parent_inverse == Matrix.Identity(4): - trans = blender_object.location - - if blender_object.rotation_mode in ['QUATERNION', 'AXIS_ANGLE']: - rot = blender_object.rotation_quaternion - else: - rot = blender_object.rotation_euler.to_quaternion() - - sca = blender_object.scale +def __gather_trans_rot_scale(vnode, export_settings): + if vnode.parent_uuid is None: + # No parent, so matrix is world matrix + trans, rot, sca = vnode.matrix_world.decompose() else: - # matrix_local = matrix_parent_inverse*location*rotation*scale - # Decomposing matrix_local gives less accuracy, but is needed if matrix_parent_inverse is not the identity. + # calculate local matrix + trans, rot, sca = (export_settings['vtree'].nodes[vnode.parent_uuid].matrix_world.inverted_safe() @ vnode.matrix_world).decompose() - if blender_object.matrix_local[3][3] != 0.0: - trans, rot, sca = blender_object.matrix_local.decompose() - else: - # Some really weird cases, scale is null (if parent is null when evaluation is done) - print_console('WARNING', 'Some nodes are 0 scaled during evaluation. Result can be wrong') - trans = blender_object.location - if blender_object.rotation_mode in ['QUATERNION', 'AXIS_ANGLE']: - rot = blender_object.rotation_quaternion - else: - rot = blender_object.rotation_euler.to_quaternion() - sca = blender_object.scale # make sure the rotation is normalized rot.normalize() @@ -459,9 +325,9 @@ def __gather_trans_rot_scale(blender_object, export_settings): rot = __convert_swizzle_rotation(rot, export_settings) sca = __convert_swizzle_scale(sca, export_settings) - if blender_object.instance_type == 'COLLECTION' and blender_object.instance_collection: + if vnode.blender_object.instance_type == 'COLLECTION' and vnode.blender_object.instance_collection: offset = -__convert_swizzle_location( - blender_object.instance_collection.instance_offset, export_settings) + vnode.blender_object.instance_collection.instance_offset, export_settings) s = Matrix.Diagonal(sca).to_4x4() r = rot.to_matrix().to_4x4() @@ -486,8 +352,7 @@ def __gather_trans_rot_scale(blender_object, export_settings): scale = [sca[0], sca[1], sca[2]] return translation, rotation, scale - -def __gather_skin(blender_object, export_settings): +def __gather_skin(vnode, blender_object, export_settings): modifiers = {m.type: m for m in blender_object.modifiers} if "ARMATURE" not in modifiers or modifiers["ARMATURE"].object is None: return None @@ -514,34 +379,12 @@ def __gather_skin(blender_object, export_settings): return None # Skins and meshes must be in the same glTF node, which is different from how blender handles armatures - return gltf2_blender_gather_skins.gather_skin(modifiers["ARMATURE"].object, export_settings) + return gltf2_blender_gather_skins.gather_skin(vnode.armature, export_settings) def __gather_weights(blender_object, export_settings): return None - -def __get_correction_node(blender_object, export_settings): - correction_quaternion = __convert_swizzle_rotation( - Quaternion((1.0, 0.0, 0.0), math.radians(-90.0)), export_settings) - correction_quaternion = [correction_quaternion[1], correction_quaternion[2], - correction_quaternion[3], correction_quaternion[0]] - return gltf2_io.Node( - camera=None, - children=[], - extensions=None, - extras=None, - matrix=None, - mesh=None, - name=blender_object.name + '_Orientation', - rotation=correction_quaternion, - scale=None, - skin=None, - translation=None, - weights=None - ) - - def __convert_swizzle_location(loc, export_settings): """Convert a location from Blender coordinate system to glTF coordinate system.""" if export_settings[gltf2_blender_export_keys.YUP]: diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitive_attributes.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitive_attributes.py index 126037ab..776b872a 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitive_attributes.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitive_attributes.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import numpy as np diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py index 9f9b949a..367c30f5 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy from typing import List, Optional, Tuple @@ -18,7 +7,7 @@ import numpy as np from .gltf2_blender_export_keys import NORMALS, MORPH_NORMAL, TANGENTS, MORPH_TANGENT, MORPH -from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import cached +from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import cached, cached_by_key from io_scene_gltf2.blender.exp import gltf2_blender_extract from io_scene_gltf2.blender.exp import gltf2_blender_gather_accessors from io_scene_gltf2.blender.exp import gltf2_blender_gather_primitive_attributes @@ -31,13 +20,34 @@ from io_scene_gltf2.io.com.gltf2_io_debug import print_console @cached +def get_primitive_cache_key( + blender_mesh, + blender_object, + vertex_groups, + modifiers, + materials, + export_settings): + + # Use id of mesh + # Do not use bpy.types that can be unhashable + # Do not use mesh name, that can be not unique (when linked) + + # TODO check what is really needed for modifiers + + return ( + (id(blender_mesh),), + (modifiers,), + tuple(id(m) if m is not None else None for m in materials) + ) + + +@cached_by_key(key=get_primitive_cache_key) def gather_primitives( blender_mesh: bpy.types.Mesh, - library: Optional[str], - blender_object: Optional[bpy.types.Object], + uuid_for_skined_data, vertex_groups: Optional[bpy.types.VertexGroups], modifiers: Optional[bpy.types.ObjectModifiers], - material_names: Tuple[str], + materials: Tuple[bpy.types.Material], export_settings ) -> List[gltf2_io.MeshPrimitive]: """ @@ -47,7 +57,14 @@ def gather_primitives( """ primitives = [] - blender_primitives = __gather_cache_primitives(blender_mesh, library, blender_object, + # retrieve active render UVMap + active_uvmap_idx = 0 + for i in range(len(blender_mesh.uv_layers)): + if blender_mesh.uv_layers[i].active_render is True: + active_uvmap_idx = i + break + + blender_primitives = __gather_cache_primitives(blender_mesh, uuid_for_skined_data, vertex_groups, modifiers, export_settings) for internal_primitive in blender_primitives: @@ -56,15 +73,15 @@ def gather_primitives( if export_settings['gltf_materials'] == "EXPORT" and material_idx is not None: blender_material = None - if material_names: - i = material_idx if material_idx < len(material_names) else -1 - material_name = material_names[i] - if material_name is not None: - blender_material = bpy.data.materials[material_name] - if blender_material is not None: + mat = None + if materials: + i = material_idx if material_idx < len(materials) else -1 + mat = materials[i] + if mat is not None: material = gltf2_blender_gather_materials.gather_material( - blender_material, - export_settings, + mat, + active_uvmap_idx, + export_settings ) primitive = gltf2_io.MeshPrimitive( @@ -83,8 +100,7 @@ def gather_primitives( @cached def __gather_cache_primitives( blender_mesh: bpy.types.Mesh, - library: Optional[str], - blender_object: Optional[bpy.types.Object], + uuid_for_skined_data, vertex_groups: Optional[bpy.types.VertexGroups], modifiers: Optional[bpy.types.ObjectModifiers], export_settings @@ -95,7 +111,7 @@ def __gather_cache_primitives( primitives = [] blender_primitives = gltf2_blender_extract.extract_primitives( - None, blender_mesh, library, blender_object, vertex_groups, modifiers, export_settings) + blender_mesh, uuid_for_skined_data, vertex_groups, modifiers, export_settings) for internal_primitive in blender_primitives: primitive = { diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_sampler.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_sampler.py index 6f4123ad..5685a242 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_sampler.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_sampler.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy from io_scene_gltf2.io.com import gltf2_io diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_skins.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_skins.py index 5d9e31ed..3e4673e1 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_skins.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_skins.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import mathutils from . import gltf2_blender_export_keys @@ -21,10 +10,12 @@ from io_scene_gltf2.io.com import gltf2_io_constants from io_scene_gltf2.blender.exp import gltf2_blender_gather_accessors from io_scene_gltf2.blender.exp import gltf2_blender_gather_joints from io_scene_gltf2.io.exp.gltf2_io_user_extensions import export_user_extensions +from io_scene_gltf2.blender.exp import gltf2_blender_gather_tree +from io_scene_gltf2.blender.exp.gltf2_blender_gather_tree import VExportNode @cached -def gather_skin(blender_object, export_settings): +def gather_skin(armature_uuid, export_settings): """ Gather armatures, bones etc into a glTF2 skin object. @@ -32,78 +23,73 @@ def gather_skin(blender_object, export_settings): :param export_settings: :return: a glTF2 skin object """ - if not __filter_skin(blender_object, export_settings): + + blender_armature_object = export_settings['vtree'].nodes[armature_uuid].blender_object + + if not __filter_skin(blender_armature_object, export_settings): return None skin = gltf2_io.Skin( - extensions=__gather_extensions(blender_object, export_settings), - extras=__gather_extras(blender_object, export_settings), - inverse_bind_matrices=__gather_inverse_bind_matrices(blender_object, export_settings), - joints=__gather_joints(blender_object, export_settings), - name=__gather_name(blender_object, export_settings), - skeleton=__gather_skeleton(blender_object, export_settings) + extensions=__gather_extensions(blender_armature_object, export_settings), + extras=__gather_extras(blender_armature_object, export_settings), + inverse_bind_matrices=__gather_inverse_bind_matrices(armature_uuid, export_settings), + joints=__gather_joints(armature_uuid, export_settings), + name=__gather_name(blender_armature_object, export_settings), + skeleton=__gather_skeleton(blender_armature_object, export_settings) ) - export_user_extensions('gather_skin_hook', export_settings, skin, blender_object) + # If armature is not exported, joints will be empty. + # Do not construct skin in that case + if len(skin.joints) == 0: + return None + + export_user_extensions('gather_skin_hook', export_settings, skin, blender_armature_object) return skin -def __filter_skin(blender_object, export_settings): +def __filter_skin(blender_armature_object, export_settings): if not export_settings[gltf2_blender_export_keys.SKINS]: return False - if blender_object.type != 'ARMATURE' or len(blender_object.pose.bones) == 0: + if blender_armature_object.type != 'ARMATURE' or len(blender_armature_object.pose.bones) == 0: return False return True -def __gather_extensions(blender_object, export_settings): +def __gather_extensions(blender_armature_object, export_settings): return None -def __gather_extras(blender_object, export_settings): +def __gather_extras(blender_armature_object, export_settings): return None -def __gather_inverse_bind_matrices(blender_object, export_settings): +def __gather_inverse_bind_matrices(armature_uuid, export_settings): + + blender_armature_object = export_settings['vtree'].nodes[armature_uuid].blender_object + axis_basis_change = mathutils.Matrix.Identity(4) if export_settings[gltf2_blender_export_keys.YUP]: axis_basis_change = mathutils.Matrix( ((1.0, 0.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, -1.0, 0.0, 0.0), (0.0, 0.0, 0.0, 1.0))) - if export_settings['gltf_def_bones'] is False: - # build the hierarchy of nodes out of the bones - root_bones = [] - for blender_bone in blender_object.pose.bones: - if not blender_bone.parent: - root_bones.append(blender_bone) - else: - _, children_, root_bones = get_bone_tree(None, blender_object) - - matrices = [] + # store matrix_world of armature in case we need to add a neutral bone + export_settings['vtree'].nodes[armature_uuid].matrix_world_armature = blender_armature_object.matrix_world.copy() - # traverse the matrices in the same order as the joints and compute the inverse bind matrix + bones_uuid = export_settings['vtree'].get_all_bones(armature_uuid) def __collect_matrices(bone): inverse_bind_matrix = ( axis_basis_change @ ( - blender_object.matrix_world @ + blender_armature_object.matrix_world @ bone.bone.matrix_local ) ).inverted_safe() matrices.append(inverse_bind_matrix) - if export_settings['gltf_def_bones'] is False: - for child in bone.children: - __collect_matrices(child) - else: - if bone.name in children_.keys(): - for child in children_[bone.name]: - __collect_matrices(blender_object.pose.bones[child]) - - # start with the "root" bones and recurse into children, in the same ordering as the how joints are gathered - for root_bone in root_bones: - __collect_matrices(root_bone) + matrices = [] + for b in bones_uuid: + __collect_matrices(blender_armature_object.pose.bones[export_settings['vtree'].nodes[b].blender_bone.name]) # flatten the matrices inverse_matrices = [] @@ -124,67 +110,26 @@ def __gather_inverse_bind_matrices(blender_object, export_settings): ) -def __gather_joints(blender_object, export_settings): - root_joints = [] - if export_settings['gltf_def_bones'] is False: - # build the hierarchy of nodes out of the bones - for blender_bone in blender_object.pose.bones: - if not blender_bone.parent: - root_joints.append(gltf2_blender_gather_joints.gather_joint(blender_object, blender_bone, export_settings)) - else: - _, children_, root_joints = get_bone_tree(None, blender_object) - root_joints = [gltf2_blender_gather_joints.gather_joint(blender_object, i, export_settings) for i in root_joints] - - # joints is a flat list containing all nodes belonging to the skin - joints = [] - - def __collect_joints(node): - joints.append(node) - if export_settings['gltf_def_bones'] is False: - for child in node.children: - __collect_joints(child) - else: - if node.name in children_.keys(): - for child in children_[node.name]: - __collect_joints(gltf2_blender_gather_joints.gather_joint(blender_object, blender_object.pose.bones[child], export_settings)) - - for joint in root_joints: - __collect_joints(joint) +def __gather_joints(armature_uuid, export_settings): + + blender_armature_object = export_settings['vtree'].nodes[armature_uuid].blender_object + + all_armature_children = export_settings['vtree'].nodes[armature_uuid].children + root_bones_uuid = [c for c in all_armature_children if export_settings['vtree'].nodes[c].blender_type == VExportNode.BONE] + # Create bone nodes + for root_bone_uuid in root_bones_uuid: + gltf2_blender_gather_joints.gather_joint_vnode(root_bone_uuid, export_settings) + + bones_uuid = export_settings['vtree'].get_all_bones(armature_uuid) + joints = [export_settings['vtree'].nodes[b].node for b in bones_uuid] return joints -def __gather_name(blender_object, export_settings): - return blender_object.name +def __gather_name(blender_armature_object, export_settings): + return blender_armature_object.name -def __gather_skeleton(blender_object, export_settings): +def __gather_skeleton(blender_armature_object, export_settings): # In the future support the result of https://github.com/KhronosGroup/glTF/pull/1195 - return None # gltf2_blender_gather_nodes.gather_node(blender_object, blender_scene, export_settings) - -@cached -def get_bone_tree(blender_dummy, blender_object): - - bones = [] - children = {} - root_bones = [] - - def get_parent(bone): - bones.append(bone.name) - if bone.parent is not None: - if bone.parent.name not in children.keys(): - children[bone.parent.name] = [] - children[bone.parent.name].append(bone.name) - get_parent(bone.parent) - else: - root_bones.append(bone.name) - - for bone in [b for b in blender_object.data.bones if b.use_deform is True]: - get_parent(bone) - - # remove duplicates - for k, v in children.items(): - children[k] = list(set(v)) - list_ = list(set(bones)) - root_ = list(set(root_bones)) - return [blender_object.data.bones[b] for b in list_], children, [blender_object.pose.bones[b] for b in root_] + return None diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture.py index 96146523..0761b19c 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import typing import bpy diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture_info.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture_info.py index a99ae86a..15b101ad 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture_info.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture_info.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy import typing @@ -47,15 +36,15 @@ def __gather_texture_info_helper( kind: str, export_settings): if not __filter_texture_info(primary_socket, blender_shader_sockets, export_settings): - return None + return None, None - tex_transform, tex_coord = __gather_texture_transform_and_tex_coord(primary_socket, export_settings) + tex_transform, tex_coord, use_active_uvmap = __gather_texture_transform_and_tex_coord(primary_socket, export_settings) fields = { 'extensions': __gather_extensions(tex_transform, export_settings), 'extras': __gather_extras(blender_shader_sockets, export_settings), 'index': __gather_index(blender_shader_sockets, export_settings), - 'tex_coord': tex_coord, + 'tex_coord': tex_coord } if kind == 'DEFAULT': @@ -70,11 +59,11 @@ def __gather_texture_info_helper( texture_info = gltf2_io.MaterialOcclusionTextureInfoClass(**fields) if texture_info.index is None: - return None + return None, None export_user_extensions('gather_texture_info_hook', export_settings, texture_info, blender_shader_sockets) - return texture_info + return texture_info, use_active_uvmap def __filter_texture_info(primary_socket, blender_shader_sockets, export_settings): @@ -162,15 +151,17 @@ def __gather_texture_transform_and_tex_coord(primary_socket, export_settings): node = previous_node(node.inputs['Vector']) texcoord_idx = 0 + use_active_uvmap = True if node and node.type == 'UVMAP' and node.uv_map: # Try to gather map index. for blender_mesh in bpy.data.meshes: i = blender_mesh.uv_layers.find(node.uv_map) if i >= 0: texcoord_idx = i + use_active_uvmap = False break - return texture_transform, texcoord_idx or None + return texture_transform, texcoord_idx or None, use_active_uvmap def __get_tex_from_socket(socket): diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py new file mode 100644 index 00000000..cf4983e1 --- /dev/null +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py @@ -0,0 +1,457 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright 2021 The glTF-Blender-IO authors. + +import bpy +import uuid +import numpy as np + +from . import gltf2_blender_export_keys +from io_scene_gltf2.io.exp.gltf2_io_user_extensions import export_user_extensions +from mathutils import Quaternion, Matrix +from io_scene_gltf2.io.com import gltf2_io +from io_scene_gltf2.io.imp.gltf2_io_binary import BinaryData +from io_scene_gltf2.io.com import gltf2_io_constants +from .gltf2_blender_gather_primitive_attributes import array_to_accessor +from io_scene_gltf2.io.exp import gltf2_io_binary_data +from io_scene_gltf2.blender.exp import gltf2_blender_gather_accessors + +class VExportNode: + + OBJECT = 1 + ARMATURE = 2 + BONE = 3 + LIGHT = 4 + CAMERA = 5 + COLLECTION = 6 + + # Parent type, to be set on child regarding its parent + NO_PARENT = 54 + PARENT_OBJECT = 50 + PARENT_BONE = 51 + PARENT_BONE_RELATIVE = 52 + PARENT_ROOT_BONE = 53 + PARENT_BONE_BONE = 55 + + + def __init__(self): + self.children = [] + self.blender_type = None + self.world_matrix = None + self.parent_type = None + + self.blender_object = None + self.blender_bone = None + + self.force_as_empty = False # Used for instancer display + + # Only for bone/bone and object parented to bone + self.parent_bone_uuid = None + + # Only for bones + self.use_deform = None + + # Only for armature + self.bones = {} + + # For deformed object + self.armature = None # for deformed object and for bone + self.skin = None + + # glTF + self.node = None + + def add_child(self, uuid): + self.children.append(uuid) + + def set_world_matrix(self, matrix): + self.world_matrix = matrix + + def set_blender_data(self, blender_object, blender_bone): + self.blender_object = blender_object + self.blender_bone = blender_bone + + def recursive_display(self, tree, mode): + if mode == "simple": + for c in self.children: + print(self.blender_object.name, "/", self.blender_bone.name if self.blender_bone else "", "-->", tree.nodes[c].blender_object.name, "/", tree.nodes[c].blender_bone.name if tree.nodes[c].blender_bone else "" ) + tree.nodes[c].recursive_display(tree, mode) + +class VExportTree: + def __init__(self, export_settings): + self.nodes = {} + self.roots = [] + + self.export_settings = export_settings + + self.tree_troncated = False + + def add_node(self, node): + self.nodes[node.uuid] = node + + def add_children(self, uuid_parent, uuid_child): + self.nodes[uuid_parent].add_child(uuid_child) + + def construct(self, blender_scene): + bpy.context.window.scene = blender_scene + depsgraph = bpy.context.evaluated_depsgraph_get() + + for blender_object in [obj.original for obj in depsgraph.scene_eval.objects if obj.parent is None]: + self.recursive_node_traverse(blender_object, None, None, Matrix.Identity(4)) + + def recursive_node_traverse(self, blender_object, blender_bone, parent_uuid, parent_coll_matrix_world, armature_uuid=None, dupli_world_matrix=None): + node = VExportNode() + node.uuid = str(uuid.uuid4()) + node.parent_uuid = parent_uuid + node.set_blender_data(blender_object, blender_bone) + + # add to parent if needed + if parent_uuid is not None: + self.add_children(parent_uuid, node.uuid) + else: + self.roots.append(node.uuid) + + # Set blender type + if blender_bone is not None: + node.blender_type = VExportNode.BONE + self.nodes[armature_uuid].bones[blender_bone.name] = node.uuid + node.use_deform = blender_bone.id_data.data.bones[blender_bone.name].use_deform + elif blender_object.type == "ARMATURE": + node.blender_type = VExportNode.ARMATURE + elif blender_object.type == "CAMERA": + node.blender_type = VExportNode.CAMERA + elif blender_object.type == "LIGHT": + node.blender_type = VExportNode.LIGHT + elif blender_object.instance_type == "COLLECTION": + node.blender_type = VExportNode.COLLECTION + else: + node.blender_type = VExportNode.OBJECT + + # For meshes with armature modifier (parent is armature), keep armature uuid + if node.blender_type == VExportNode.OBJECT: + modifiers = {m.type: m for m in blender_object.modifiers} + if "ARMATURE" in modifiers and modifiers["ARMATURE"].object is not None: + if parent_uuid is None or not self.nodes[parent_uuid].blender_type == VExportNode.ARMATURE: + # correct workflow is to parent skinned mesh to armature, but ... + # all users don't use correct workflow + print("WARNING: Armature must be the parent of skinned mesh") + print("Armature is selected by its name, but may be false in case of instances") + # Search an armature by name, and use the first found + # This will be done after all objects are setup + node.armature_needed = modifiers["ARMATURE"].object.name + else: + node.armature = parent_uuid + + # For bones, store uuid of armature + if blender_bone is not None: + node.armature = armature_uuid + + # for bone/bone parenting, store parent, this will help armature tree management + if parent_uuid is not None and self.nodes[parent_uuid].blender_type == VExportNode.BONE and node.blender_type == VExportNode.BONE: + node.parent_bone_uuid = parent_uuid + + + # Objects parented to bone + if parent_uuid is not None and self.nodes[parent_uuid].blender_type == VExportNode.BONE and node.blender_type != VExportNode.BONE: + node.parent_bone_uuid = parent_uuid + + # World Matrix + # Store World Matrix for objects + if dupli_world_matrix is not None: + node.matrix_world = dupli_world_matrix + elif node.blender_type in [VExportNode.OBJECT, VExportNode.COLLECTION, VExportNode.ARMATURE, VExportNode.CAMERA, VExportNode.LIGHT]: + # Matrix World of object is expressed based on collection instance objects are + # So real world matrix is collection world_matrix @ "world_matrix" of object + node.matrix_world = parent_coll_matrix_world @ blender_object.matrix_world.copy() + if node.blender_type == VExportNode.CAMERA and self.export_settings[gltf2_blender_export_keys.CAMERAS]: + correction = Quaternion((2**0.5/2, -2**0.5/2, 0.0, 0.0)) + node.matrix_world @= correction.to_matrix().to_4x4() + elif node.blender_type == VExportNode.LIGHT and self.export_settings[gltf2_blender_export_keys.LIGHTS]: + correction = Quaternion((2**0.5/2, -2**0.5/2, 0.0, 0.0)) + node.matrix_world @= correction.to_matrix().to_4x4() + elif node.blender_type == VExportNode.BONE: + node.matrix_world = self.nodes[node.armature].matrix_world @ blender_bone.matrix + axis_basis_change = Matrix( + ((1.0, 0.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, -1.0, 0.0, 0.0), (0.0, 0.0, 0.0, 1.0))) + node.matrix_world = node.matrix_world @ axis_basis_change + + # Force empty ? + # For duplis, if instancer is not display, we should create an empty + if blender_object.is_instancer is True and blender_object.show_instancer_for_render is False: + node.force_as_empty = True + + # Storing this node + self.add_node(node) + + ###### Manage children ###### + + # standard children + if blender_bone is None and blender_object.is_instancer is False: + for child_object in blender_object.children: + if child_object.parent_bone: + # Object parented to bones + # Will be manage later + continue + else: + # Classic parenting + self.recursive_node_traverse(child_object, None, node.uuid, parent_coll_matrix_world) + + # Collections + if blender_object.instance_type == 'COLLECTION' and blender_object.instance_collection: + for dupli_object in blender_object.instance_collection.objects: + if dupli_object.parent is not None: + continue + self.recursive_node_traverse(dupli_object, None, node.uuid, node.matrix_world) + + # Armature : children are bones with no parent + if blender_object.type == "ARMATURE" and blender_bone is None: + for b in [b for b in blender_object.pose.bones if b.parent is None]: + self.recursive_node_traverse(blender_object, b, node.uuid, parent_coll_matrix_world, node.uuid) + + # Bones + if blender_object.type == "ARMATURE" and blender_bone is not None: + for b in blender_bone.children: + self.recursive_node_traverse(blender_object, b, node.uuid, parent_coll_matrix_world, armature_uuid) + + # Object parented to bone + if blender_bone is not None: + for child_object in [c for c in blender_object.children if c.parent_bone is not None and c.parent_bone == blender_bone.name]: + self.recursive_node_traverse(child_object, None, node.uuid, parent_coll_matrix_world) + + # Duplis + if blender_object.is_instancer is True and blender_object.instance_type != 'COLLECTION': + depsgraph = bpy.context.evaluated_depsgraph_get() + for (dupl, mat) in [(dup.object.original, dup.matrix_world.copy()) for dup in depsgraph.object_instances if dup.parent and id(dup.parent.original) == id(blender_object)]: + self.recursive_node_traverse(dupl, None, node.uuid, parent_coll_matrix_world, dupli_world_matrix=mat) + + def get_all_objects(self): + return [n.uuid for n in self.nodes.values() if n.blender_type != VExportNode.BONE] + + def get_all_bones(self, uuid): #For armatue Only + if self.nodes[uuid].blender_type == VExportNode.ARMATURE: + def recursive_get_all_bones(uuid): + total = [] + if self.nodes[uuid].blender_type == VExportNode.BONE: + total.append(uuid) + for child_uuid in self.nodes[uuid].children: + total.extend(recursive_get_all_bones(child_uuid)) + + return total + + tot = [] + for c_uuid in self.nodes[uuid].children: + tot.extend(recursive_get_all_bones(c_uuid)) + return tot + else: + return [] + + def get_all_node_of_type(self, node_type): + return [n.uuid for n in self.nodes.values() if n.blender_type == node_type] + + def display(self, mode): + if mode == "simple": + for n in self.roots: + print("Root", self.nodes[n].blender_object.name, "/", self.nodes[n].blender_bone.name if self.nodes[n].blender_bone else "" ) + self.nodes[n].recursive_display(self, mode) + + + def filter_tag(self): + roots = self.roots.copy() + for r in roots: + self.recursive_filter_tag(r, None) + + def filter_perform(self): + roots = self.roots.copy() + for r in roots: + self.recursive_filter(r, None) # Root, so no parent + + def filter(self): + self.filter_tag() + export_user_extensions('gather_tree_filter_tag_hook', self.export_settings, self) + self.filter_perform() + + + def recursive_filter_tag(self, uuid, parent_keep_tag): + # parent_keep_tag is for collection instance + # some properties (selection, visibility, renderability) + # are defined at collection level, and we need to use these values + # for all objects of the collection instance. + # But some properties (camera, lamp ...) are not defined at collection level + if parent_keep_tag is None: + self.nodes[uuid].keep_tag = self.node_filter_not_inheritable_is_kept(uuid) and self.node_filter_inheritable_is_kept(uuid) + elif parent_keep_tag is True: + self.nodes[uuid].keep_tag = self.node_filter_not_inheritable_is_kept(uuid) + elif parent_keep_tag is False: + self.nodes[uuid].keep_tag = False + else: + print("This should not happen!") + + for child in self.nodes[uuid].children: + if self.nodes[uuid].blender_type == VExportNode.COLLECTION: + self.recursive_filter_tag(child, self.nodes[uuid].keep_tag) + else: + self.recursive_filter_tag(child, parent_keep_tag) + + def recursive_filter(self, uuid, parent_kept_uuid): + children = self.nodes[uuid].children.copy() + + new_parent_kept_uuid = None + if self.nodes[uuid].keep_tag is False: + new_parent_kept_uuid = parent_kept_uuid + # Need to modify tree + if self.nodes[uuid].parent_uuid is not None: + self.nodes[self.nodes[uuid].parent_uuid].children.remove(uuid) + else: + # Remove from root + self.roots.remove(uuid) + else: + new_parent_kept_uuid = uuid + + # If parent_uuid is not parent_kept_uuid, we need to modify children list of parent_kept_uuid + if parent_kept_uuid != self.nodes[uuid].parent_uuid and parent_kept_uuid is not None: + self.tree_troncated = True + self.nodes[parent_kept_uuid].children.append(uuid) + + # If parent_kept_uuid is None, and parent_uuid was not, add to root list + if self.nodes[uuid].parent_uuid is not None and parent_kept_uuid is None: + self.tree_troncated = True + self.roots.append(uuid) + + # Modify parent uuid + self.nodes[uuid].parent_uuid = parent_kept_uuid + + for child in children: + self.recursive_filter(child, new_parent_kept_uuid) + + + def node_filter_not_inheritable_is_kept(self, uuid): + # Export Camera or not + if self.nodes[uuid].blender_type == VExportNode.CAMERA: + if self.export_settings[gltf2_blender_export_keys.CAMERAS] is False: + return False + + # Export Lamp or not + if self.nodes[uuid].blender_type == VExportNode.LIGHT: + if self.export_settings[gltf2_blender_export_keys.LIGHTS] is False: + return False + + # Export deform bones only + if self.nodes[uuid].blender_type == VExportNode.BONE: + if self.export_settings['gltf_def_bones'] is True and self.nodes[uuid].use_deform is False: + # Check if bone has some objected parented to bone. We need to keep it in that case, even if this is not a def bone + if len([c for c in self.nodes[uuid].children if self.nodes[c].blender_type != VExportNode.BONE]) != 0: + return True + return False + + return True + + def node_filter_inheritable_is_kept(self, uuid): + + if self.export_settings[gltf2_blender_export_keys.SELECTED] and self.nodes[uuid].blender_object.select_get() is False: + return False + + if self.export_settings[gltf2_blender_export_keys.VISIBLE]: + # The eye in outliner (object) + if self.nodes[uuid].blender_object.visible_get() is False: + return False + + # The screen in outliner (object) + if self.nodes[uuid].blender_object.hide_viewport is True: + return False + + # The screen in outliner (collections) + if all([c.hide_viewport for c in self.nodes[uuid].blender_object.users_collection]): + return False + + # The camera in outliner (object) + if self.export_settings[gltf2_blender_export_keys.RENDERABLE]: + if self.nodes[uuid].blender_object.hide_render is True: + return False + + # The camera in outliner (collections) + if all([c.hide_render for c in self.nodes[uuid].blender_object.users_collection]): + return False + + if self.export_settings[gltf2_blender_export_keys.ACTIVE_COLLECTION]: + found = any(x == self.nodes[uuid].blender_object for x in bpy.context.collection.all_objects) + if not found: + return False + + return True + + def search_missing_armature(self): + for n in [n for n in self.nodes.values() if hasattr(n, "armature_needed") is True]: + candidates = [i for i in self.nodes.values() if i.blender_type == VExportNode.ARMATURE and i.blender_object.name == n.armature_needed] + if len(candidates) > 0: + n.armature = candidates[0].uuid + del n.armature_needed + + def add_neutral_bones(self): + for n in [n for n in self.nodes.values() if n.armature is not None and n.blender_type == VExportNode.OBJECT and hasattr(self.nodes[n.armature], "need_neutral_bone")]: #all skin meshes objects where neutral bone is needed + # First add a new node + + axis_basis_change = Matrix.Identity(4) + if self.export_settings[gltf2_blender_export_keys.YUP]: + axis_basis_change = Matrix(((1.0, 0.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, -1.0, 0.0, 0.0), (0.0, 0.0, 0.0, 1.0))) + + trans, rot, sca = axis_basis_change.decompose() + translation, rotation, scale = (None, None, None) + if trans[0] != 0.0 or trans[1] != 0.0 or trans[2] != 0.0: + translation = [trans[0], trans[1], trans[2]] + if rot[0] != 1.0 or rot[1] != 0.0 or rot[2] != 0.0 or rot[3] != 0.0: + rotation = [rot[1], rot[2], rot[3], rot[0]] + if sca[0] != 1.0 or sca[1] != 1.0 or sca[2] != 1.0: + scale = [sca[0], sca[1], sca[2]] + neutral_bone = gltf2_io.Node( + camera=None, + children=None, + extensions=None, + extras=None, + matrix=None, + mesh=None, + name='neutral_bone', + rotation=rotation, + scale=scale, + skin=None, + translation=translation, + weights=None + ) + # Add it to child list of armature + self.nodes[n.armature].node.children.append(neutral_bone) + # Add it to joint list + n.node.skin.joints.append(neutral_bone) + + # Need to add an InverseBindMatrix + array = BinaryData.decode_accessor_internal(n.node.skin.inverse_bind_matrices) + + axis_basis_change = Matrix.Identity(4) + if self.export_settings[gltf2_blender_export_keys.YUP]: + axis_basis_change = Matrix( + ((1.0, 0.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, -1.0, 0.0, 0.0), (0.0, 0.0, 0.0, 1.0))) + + inverse_bind_matrix = ( + axis_basis_change @ self.nodes[n.armature].matrix_world_armature).inverted_safe() + + matrix = [] + for column in range(0, 4): + for row in range(0, 4): + matrix.append(inverse_bind_matrix[row][column]) + + array = np.append(array, np.array([matrix]), axis=0) + binary_data = gltf2_io_binary_data.BinaryData.from_list(array.flatten(), gltf2_io_constants.ComponentType.Float) + n.node.skin.inverse_bind_matrices = gltf2_blender_gather_accessors.gather_accessor( + binary_data, + gltf2_io_constants.ComponentType.Float, + len(array.flatten()) // gltf2_io_constants.DataType.num_elements(gltf2_io_constants.DataType.Mat4), + None, + None, + gltf2_io_constants.DataType.Mat4, + self.export_settings + ) + def get_unused_skins(self): + from .gltf2_blender_gather_skins import gather_skin + skins = [] + for n in [n for n in self.nodes.values() if n.blender_type == VExportNode.ARMATURE]: + if len([m for m in self.nodes.values() if m.keep_tag is True and m.blender_type == VExportNode.OBJECT and m.armature == n.uuid]) == 0: + skin = gather_skin(n.uuid, self.export_settings) + skins.append(skin) + return skins diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_get.py b/io_scene_gltf2/blender/exp/gltf2_blender_get.py index 0b1946e5..e38906e6 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_get.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_get.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy from mathutils import Vector, Matrix @@ -43,6 +32,21 @@ def get_object_from_datapath(blender_object, data_path: str): return prop +def get_node_socket(blender_material, type, name): + """ + For a given material input name, retrieve the corresponding node tree socket for a given node type. + + :param blender_material: a blender material for which to get the socket + :return: a blender NodeSocket for a given type + """ + nodes = [n for n in blender_material.node_tree.nodes if isinstance(n, type) and not n.mute] + nodes = [node for node in nodes if check_if_is_linked_to_active_output(node.outputs[0])] + inputs = sum([[input for input in node.inputs if input.name == name] for node in nodes], []) + if inputs: + return inputs[0] + return None + + def get_socket(blender_material: bpy.types.Material, name: str): """ For a given material input name, retrieve the corresponding node tree socket. @@ -57,13 +61,9 @@ def get_socket(blender_material: bpy.types.Material, name: str): if name == "Emissive": # Check for a dedicated Emission node first, it must supersede the newer built-in one # because the newer one is always present in all Principled BSDF materials. - type = bpy.types.ShaderNodeEmission - name = "Color" - nodes = [n for n in blender_material.node_tree.nodes if isinstance(n, type) and not n.mute] - nodes = [node for node in nodes if check_if_is_linked_to_active_output(node.outputs[0])] - inputs = sum([[input for input in node.inputs if input.name == name] for node in nodes], []) - if inputs: - return inputs[0] + emissive_socket = get_node_socket(blender_material, bpy.types.ShaderNodeEmission, "Color") + if emissive_socket: + return emissive_socket # If a dedicated Emission node was not found, fall back to the Principled BSDF Emission socket. name = "Emission" type = bpy.types.ShaderNodeBsdfPrincipled @@ -72,11 +72,8 @@ def get_socket(blender_material: bpy.types.Material, name: str): name = "Color" else: type = bpy.types.ShaderNodeBsdfPrincipled - nodes = [n for n in blender_material.node_tree.nodes if isinstance(n, type) and not n.mute] - nodes = [node for node in nodes if check_if_is_linked_to_active_output(node.outputs[0])] - inputs = sum([[input for input in node.inputs if input.name == name] for node in nodes], []) - if inputs: - return inputs[0] + + return get_node_socket(blender_material, type, name) return None diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gltf2_exporter.py b/io_scene_gltf2/blender/exp/gltf2_blender_gltf2_exporter.py index 77ea0c57..574693d7 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gltf2_exporter.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gltf2_exporter.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import re import os import urllib.parse @@ -185,6 +174,10 @@ class GlTF2Exporter: if active: self.__gltf.scene = scene_num + def traverse_unused_skins(self, skins): + for s in skins: + self.__traverse(s) + def add_animation(self, animation: gltf2_io.Animation): """ Add an animation to the glTF. diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_image.py b/io_scene_gltf2/blender/exp/gltf2_blender_image.py index 3f6a4442..8b9db89a 100644 --- a/io_scene_gltf2/blender/exp/gltf2_blender_image.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_image.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy import os diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_search_node_tree.py b/io_scene_gltf2/blender/exp/gltf2_blender_search_node_tree.py index c1fba51b..41de11d6 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_search_node_tree.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_search_node_tree.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. # # Imports diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_clearcoat.py b/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_clearcoat.py index 4629f3bf..73232f14 100644 --- a/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_clearcoat.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_clearcoat.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. from ...io.com.gltf2_io import TextureInfo, MaterialNormalTextureInfoClass from .gltf2_blender_texture import texture diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_pbrSpecularGlossiness.py b/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_pbrSpecularGlossiness.py index ed3aa788..bed63f7f 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_pbrSpecularGlossiness.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_pbrSpecularGlossiness.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. from ...io.com.gltf2_io import TextureInfo from .gltf2_blender_pbrMetallicRoughness import \ diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_unlit.py b/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_unlit.py index 5b949362..48ad46fd 100644 --- a/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_unlit.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_unlit.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. from .gltf2_blender_pbrMetallicRoughness import base_color, make_output_nodes diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_animation.py b/io_scene_gltf2/blender/imp/gltf2_blender_animation.py index ba030fab..c0dcd84e 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_animation.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_animation.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. from .gltf2_blender_animation_node import BlenderNodeAnim from .gltf2_blender_animation_weight import BlenderWeightAnim diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py b/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py index 03f8592c..acc7767f 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy from mathutils import Vector diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py b/io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py index 688a785c..c1392513 100644 --- a/io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_animation_weight.py b/io_scene_gltf2/blender/imp/gltf2_blender_animation_weight.py index 3b864d6b..351355fb 100644 --- a/io_scene_gltf2/blender/imp/gltf2_blender_animation_weight.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_animation_weight.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_camera.py b/io_scene_gltf2/blender/imp/gltf2_blender_camera.py index e5f6e3d1..6a580e03 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_camera.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_camera.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy from ..com.gltf2_blender_extras import set_extras diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py b/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py index 92f8f469..f2556465 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy from mathutils import Vector, Quaternion, Matrix diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_image.py b/io_scene_gltf2/blender/imp/gltf2_blender_image.py index cf4a9595..4f9af799 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_image.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_image.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy import os @@ -87,7 +76,7 @@ def create_from_file(gltf, img_idx): blender_image.name = img_name return blender_image - + def create_from_data(gltf, img_idx): # Image stored as data => pack diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_light.py b/io_scene_gltf2/blender/imp/gltf2_blender_light.py index 9e6b8a96..fb060598 100644 --- a/io_scene_gltf2/blender/imp/gltf2_blender_light.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_light.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy from math import pi diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_material.py b/io_scene_gltf2/blender/imp/gltf2_blender_material.py index 1a5be06f..1d18c65d 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_material.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_material.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py b/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py index 41dd4d03..01a2b42d 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy from mathutils import Matrix diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_node.py b/io_scene_gltf2/blender/imp/gltf2_blender_node.py index 2fdbcfa5..917c6cee 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_node.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_node.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy from mathutils import Vector @@ -132,7 +121,7 @@ class BlenderNode(): vnode = gltf.vnodes[vid] dist = vnode.trs()[0].length sizes.append(dist * 0.4) - return max(min(sizes, default=1), 0.001) + return max(min(sizes, default=1), 0.001) @staticmethod def create_bones(gltf, arma_id): diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py b/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py index 1fb76480..a5d10a7a 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py @@ -1,20 +1,9 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy from ...io.com.gltf2_io import TextureInfo, MaterialPBRMetallicRoughness -from ..com.gltf2_blender_material_helpers import get_gltf_node_name +from ..com.gltf2_blender_material_helpers import get_gltf_node_name, create_settings_group from .gltf2_blender_texture import texture from .gltf2_blender_KHR_materials_clearcoat import \ clearcoat, clearcoat_roughness, clearcoat_normal @@ -563,16 +552,11 @@ def make_settings_node(mh): node.node_tree = get_settings_group() return node - def get_settings_group(): gltf_node_group_name = get_gltf_node_name() if gltf_node_group_name in bpy.data.node_groups: gltf_node_group = bpy.data.node_groups[gltf_node_group_name] else: # Create a new node group - gltf_node_group = bpy.data.node_groups.new(gltf_node_group_name, 'ShaderNodeTree') - gltf_node_group.inputs.new("NodeSocketFloat", "Occlusion") - gltf_node_group.nodes.new('NodeGroupOutput') - gltf_node_group_input = gltf_node_group.nodes.new('NodeGroupInput') - gltf_node_group_input.location = -200, 0 + gltf_node_group = create_settings_group(gltf_node_group_name) return gltf_node_group diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_scene.py b/io_scene_gltf2/blender/imp/gltf2_blender_scene.py index 57c53527..2092a6be 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_scene.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_scene.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_texture.py b/io_scene_gltf2/blender/imp/gltf2_blender_texture.py index 2a41c28e..24c9df7c 100644 --- a/io_scene_gltf2/blender/imp/gltf2_blender_texture.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_texture.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_vnode.py b/io_scene_gltf2/blender/imp/gltf2_blender_vnode.py index 4aa687cd..95285860 100644 --- a/io_scene_gltf2/blender/imp/gltf2_blender_vnode.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_vnode.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import bpy from mathutils import Vector, Quaternion, Matrix diff --git a/io_scene_gltf2/blender/imp/gltf2_io_draco_compression_extension.py b/io_scene_gltf2/blender/imp/gltf2_io_draco_compression_extension.py index bb6e5022..a22da18f 100644 --- a/io_scene_gltf2/blender/imp/gltf2_io_draco_compression_extension.py +++ b/io_scene_gltf2/blender/imp/gltf2_io_draco_compression_extension.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. from ctypes import * diff --git a/io_scene_gltf2/io/__init__.py b/io_scene_gltf2/io/__init__.py index 3034b4b1..5867e947 100755 --- a/io_scene_gltf2/io/__init__.py +++ b/io_scene_gltf2/io/__init__.py @@ -1,15 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. from .imp import * diff --git a/io_scene_gltf2/io/com/gltf2_io.py b/io_scene_gltf2/io/com/gltf2_io.py index d00a914d..ce7ad557 100755 --- a/io_scene_gltf2/io/com/gltf2_io.py +++ b/io_scene_gltf2/io/com/gltf2_io.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. # NOTE: Generated from latest glTF 2.0 JSON Scheme specs using quicktype (https://github.com/quicktype/quicktype) # command used: diff --git a/io_scene_gltf2/io/com/gltf2_io_constants.py b/io_scene_gltf2/io/com/gltf2_io_constants.py index b34bd389..19ead516 100755 --- a/io_scene_gltf2/io/com/gltf2_io_constants.py +++ b/io_scene_gltf2/io/com/gltf2_io_constants.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. from enum import IntEnum diff --git a/io_scene_gltf2/io/com/gltf2_io_debug.py b/io_scene_gltf2/io/com/gltf2_io_debug.py index 290616cc..5b09da10 100755 --- a/io_scene_gltf2/io/com/gltf2_io_debug.py +++ b/io_scene_gltf2/io/com/gltf2_io_debug.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. # # Imports diff --git a/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py b/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py index e7518ac4..28f06e51 100644 --- a/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py +++ b/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import os import sys diff --git a/io_scene_gltf2/io/com/gltf2_io_extensions.py b/io_scene_gltf2/io/com/gltf2_io_extensions.py index dd7f7054..791da96d 100644 --- a/io_scene_gltf2/io/com/gltf2_io_extensions.py +++ b/io_scene_gltf2/io/com/gltf2_io_extensions.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. from typing import List, Dict, Any diff --git a/io_scene_gltf2/io/com/gltf2_io_lights_punctual.py b/io_scene_gltf2/io/com/gltf2_io_lights_punctual.py index 1dad79f4..2240bec2 100644 --- a/io_scene_gltf2/io/com/gltf2_io_lights_punctual.py +++ b/io_scene_gltf2/io/com/gltf2_io_lights_punctual.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. from io_scene_gltf2.io.com.gltf2_io import from_dict, from_union, from_none, from_float, from_str, from_list from io_scene_gltf2.io.com.gltf2_io import to_float, to_class diff --git a/io_scene_gltf2/io/exp/gltf2_io_binary_data.py b/io_scene_gltf2/io/exp/gltf2_io_binary_data.py index 95837481..10405551 100755 --- a/io_scene_gltf2/io/exp/gltf2_io_binary_data.py +++ b/io_scene_gltf2/io/exp/gltf2_io_binary_data.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import typing import array diff --git a/io_scene_gltf2/io/exp/gltf2_io_buffer.py b/io_scene_gltf2/io/exp/gltf2_io_buffer.py index c859f64c..5fae3834 100755 --- a/io_scene_gltf2/io/exp/gltf2_io_buffer.py +++ b/io_scene_gltf2/io/exp/gltf2_io_buffer.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import base64 @@ -21,8 +10,10 @@ from io_scene_gltf2.io.exp import gltf2_io_binary_data class Buffer: """Class representing binary data for use in a glTF file as 'buffer' property.""" - def __init__(self, buffer_index=0): + def __init__(self, buffer_index=0, initial_data=None): self.__data = bytearray(b"") + if initial_data is not None: + self.__data = bytearray(initial_data.tobytes()) self.__buffer_index = buffer_index def add_and_get_view(self, binary_data: gltf2_io_binary_data.BinaryData) -> gltf2_io.BufferView: diff --git a/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py b/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py index cf26f5bd..a5c84884 100644 --- a/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py +++ b/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. from ctypes import * from pathlib import Path diff --git a/io_scene_gltf2/io/exp/gltf2_io_export.py b/io_scene_gltf2/io/exp/gltf2_io_export.py index dbd2a44e..aee74ba9 100755 --- a/io_scene_gltf2/io/exp/gltf2_io_export.py +++ b/io_scene_gltf2/io/exp/gltf2_io_export.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. # # Imports @@ -18,6 +7,7 @@ import json import struct +from io_scene_gltf2.io.exp.gltf2_io_user_extensions import export_user_extensions # # Globals @@ -30,13 +20,18 @@ from collections import OrderedDict def save_gltf(gltf, export_settings, encoder, glb_buffer): - indent = None - separators = (',', ':') + # Use a class here, to be able to pass data by reference to hook (to be able to change them inside hook) + class GlTF_format: + def __init__(self, indent, separators): + self.indent = indent + self.separators = separators + + gltf_format = GlTF_format(None, (',', ':')) if export_settings['gltf_format'] != 'GLB': - indent = 4 + gltf_format.indent = 4 # The comma is typically followed by a newline, so no trailing whitespace is needed on it. - separators = (',', ' : ') + gltf_format.separators = (',', ' : ') sort_order = [ "asset", @@ -59,8 +54,11 @@ def save_gltf(gltf, export_settings, encoder, glb_buffer): "samplers", "buffers" ] + + export_user_extensions('gather_gltf_encoded_hook', export_settings, gltf_format, sort_order) + gltf_ordered = OrderedDict(sorted(gltf.items(), key=lambda item: sort_order.index(item[0]))) - gltf_encoded = json.dumps(gltf_ordered, indent=indent, separators=separators, cls=encoder, allow_nan=False) + gltf_encoded = json.dumps(gltf_ordered, indent=gltf_format.indent, separators=gltf_format.separators, cls=encoder, allow_nan=False) # diff --git a/io_scene_gltf2/io/exp/gltf2_io_image_data.py b/io_scene_gltf2/io/exp/gltf2_io_image_data.py index 3114493b..7e15a52c 100755 --- a/io_scene_gltf2/io/exp/gltf2_io_image_data.py +++ b/io_scene_gltf2/io/exp/gltf2_io_image_data.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import re diff --git a/io_scene_gltf2/io/exp/gltf2_io_user_extensions.py b/io_scene_gltf2/io/exp/gltf2_io_user_extensions.py index 1e1e37e3..4ea9795c 100644 --- a/io_scene_gltf2/io/exp/gltf2_io_user_extensions.py +++ b/io_scene_gltf2/io/exp/gltf2_io_user_extensions.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. def export_user_extensions(hook_name, export_settings, *args): if args and hasattr(args[0], "extensions"): diff --git a/io_scene_gltf2/io/imp/__init__.py b/io_scene_gltf2/io/imp/__init__.py index 666fdf3f..7d9ed59c 100755 --- a/io_scene_gltf2/io/imp/__init__.py +++ b/io_scene_gltf2/io/imp/__init__.py @@ -1,15 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """IO imp package.""" diff --git a/io_scene_gltf2/io/imp/gltf2_io_binary.py b/io_scene_gltf2/io/imp/gltf2_io_binary.py index bbeb0db4..995fd3c9 100755 --- a/io_scene_gltf2/io/imp/gltf2_io_binary.py +++ b/io_scene_gltf2/io/imp/gltf2_io_binary.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import struct import numpy as np @@ -88,6 +77,37 @@ class BinaryData(): return array + + @staticmethod + def decode_accessor_internal(accessor): + # Is use internally when accessor binary data is not yet in a glTF buffer_view + # MAT2/3 have special alignment requirements that aren't handled. But it + # doesn't matter because nothing uses them. + assert accessor.type not in ['MAT2', 'MAT3'] + + dtype = ComponentType.to_numpy_dtype(accessor.component_type) + component_nb = DataType.num_elements(accessor.type) + + buffer_data = accessor.buffer_view.data + + accessor_offset = accessor.byte_offset or 0 + buffer_data = buffer_data[accessor_offset:] + + bytes_per_elem = dtype(1).nbytes + default_stride = bytes_per_elem * component_nb + stride = default_stride + + array = np.frombuffer( + buffer_data, + dtype=np.dtype(dtype).newbyteorder('<'), + count=accessor.count * component_nb, + ) + array = array.reshape(accessor.count, component_nb) + + return array + + + @staticmethod def decode_accessor_obj(gltf, accessor): # MAT2/3 have special alignment requirements that aren't handled. But it diff --git a/io_scene_gltf2/io/imp/gltf2_io_gltf.py b/io_scene_gltf2/io/imp/gltf2_io_gltf.py index 407afccd..9f096e69 100755 --- a/io_scene_gltf2/io/imp/gltf2_io_gltf.py +++ b/io_scene_gltf2/io/imp/gltf2_io_gltf.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. from ..com.gltf2_io import gltf_from_dict from ..com.gltf2_io_debug import Log diff --git a/io_scene_gltf2/io/imp/gltf2_io_user_extensions.py b/io_scene_gltf2/io/imp/gltf2_io_user_extensions.py index 0c439251..505e3265 100644 --- a/io_scene_gltf2/io/imp/gltf2_io_user_extensions.py +++ b/io_scene_gltf2/io/imp/gltf2_io_user_extensions.py @@ -1,16 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 # Copyright 2018-2021 The glTF-Blender-IO authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. def import_user_extensions(hook_name, gltf_importer, *args): for extension in gltf_importer.import_user_extensions: diff --git a/io_scene_obj/__init__.py b/io_scene_obj/__init__.py index 78c2314e..8b5dad5f 100644 --- a/io_scene_obj/__init__.py +++ b/io_scene_obj/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> diff --git a/io_scene_obj/export_obj.py b/io_scene_obj/export_obj.py index e5466c76..ad10f7c4 100644 --- a/io_scene_obj/export_obj.py +++ b/io_scene_obj/export_obj.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_scene_obj/import_obj.py b/io_scene_obj/import_obj.py index 0ba4f898..4b996819 100644 --- a/io_scene_obj/import_obj.py +++ b/io_scene_obj/import_obj.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_scene_x3d/__init__.py b/io_scene_x3d/__init__.py index 450680f6..240cf104 100644 --- a/io_scene_x3d/__init__.py +++ b/io_scene_x3d/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py index 6a4daf91..f1422688 100644 --- a/io_scene_x3d/export_x3d.py +++ b/io_scene_x3d/export_x3d.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_scene_x3d/import_x3d.py b/io_scene_x3d/import_x3d.py index 6ca3ffc8..fbde81ad 100644 --- a/io_scene_x3d/import_x3d.py +++ b/io_scene_x3d/import_x3d.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -61,7 +45,7 @@ def imageConvertCompat(path): # rotation first defines axis then amount in radians -# =============================== VRML Spesific +# =============================== VRML Specific def vrml_split_fields(value): """ @@ -2023,23 +2007,18 @@ def importMesh_IndexedFaceSet(geom, ancestry): for v in f for co in tex_coord_points[v]] else: - x_min = x_max = y_min = y_max = z_min = z_max = None + x_min = y_min = z_min = math.inf + x_max = y_max = z_max = -math.inf for f in faces: # Unused vertices don't participate in size; X3DOM does so for v in f: (x, y, z) = points[v] - if x_min is None or x < x_min: - x_min = x - if x_max is None or x > x_max: - x_max = x - if y_min is None or y < y_min: - y_min = y - if y_max is None or y > y_max: - y_max = y - if z_min is None or z < z_min: - z_min = z - if z_max is None or z > z_max: - z_max = z + x_min = min(x_min, x) + x_max = max(x_max, x) + y_min = min(y_min, y) + y_max = max(y_max, y) + z_min = min(z_min, z) + z_max = max(z_max, z) mins = (x_min, y_min, z_min) deltas = (x_max - x_min, y_max - y_min, z_max - z_min) diff --git a/io_shape_mdd/__init__.py b/io_shape_mdd/__init__.py index fa59fe0d..9c4855e5 100644 --- a/io_shape_mdd/__init__.py +++ b/io_shape_mdd/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_shape_mdd/export_mdd.py b/io_shape_mdd/export_mdd.py index d5e88d51..d7ebf39b 100644 --- a/io_shape_mdd/export_mdd.py +++ b/io_shape_mdd/export_mdd.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/io_shape_mdd/import_mdd.py b/io_shape_mdd/import_mdd.py index f22f987e..7a21dd9b 100644 --- a/io_shape_mdd/import_mdd.py +++ b/io_shape_mdd/import_mdd.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/lighting_dynamic_sky.py b/lighting_dynamic_sky.py index 4152277d..5be1a438 100644 --- a/lighting_dynamic_sky.py +++ b/lighting_dynamic_sky.py @@ -1,23 +1,5 @@ -# Dynamic Sky.py (c) 2015 Pratik Solanki (Draguu) - -# ##### 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 ##### - +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright 2015 Pratik Solanki (Draguu) bl_info = { "name": "Dynamic Sky", diff --git a/lighting_tri_lights.py b/lighting_tri_lights.py index f86972ed..5b31ad27 100644 --- a/lighting_tri_lights.py +++ b/lighting_tri_lights.py @@ -1,4 +1,6 @@ -# gpl: author Daniel Schalla, maintained by meta-androcto +# SPDX-License-Identifier: GPL-2.0-or-later + +# author Daniel Schalla, maintained by meta-androcto bl_info = { "name": "Tri-lighting", diff --git a/magic_uv/__init__.py b/magic_uv/__init__.py index 4a4ed538..dc3c9641 100644 --- a/magic_uv/__init__.py +++ b/magic_uv/__init__.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" @@ -48,7 +32,7 @@ if "bpy" in locals(): utils.bl_class_registry.BlClassRegistry.cleanup() importlib.reload(op) importlib.reload(ui) - importlib.reload(properites) + importlib.reload(properties) importlib.reload(preferences) else: import bpy @@ -56,7 +40,7 @@ else: from . import utils from . import op from . import ui - from . import properites + from . import properties from . import preferences import bpy @@ -64,7 +48,7 @@ import bpy def register(): utils.bl_class_registry.BlClassRegistry.register() - properites.init_props(bpy.types.Scene) + properties.init_props(bpy.types.Scene) user_prefs = utils.compatibility.get_user_preferences(bpy.context) if user_prefs.addons['magic_uv'].preferences.enable_builtin_menu: preferences.add_builtin_menu() @@ -72,7 +56,7 @@ def register(): def unregister(): preferences.remove_builtin_menu() - properites.clear_props(bpy.types.Scene) + properties.clear_props(bpy.types.Scene) utils.bl_class_registry.BlClassRegistry.unregister() diff --git a/magic_uv/common.py b/magic_uv/common.py index 1d9d55cf..4e633408 100644 --- a/magic_uv/common.py +++ b/magic_uv/common.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/lib/__init__.py b/magic_uv/lib/__init__.py index 68d1843a..76eaf480 100644 --- a/magic_uv/lib/__init__.py +++ b/magic_uv/lib/__init__.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/lib/bglx.py b/magic_uv/lib/bglx.py index e72cd734..c1f696ab 100644 --- a/magic_uv/lib/bglx.py +++ b/magic_uv/lib/bglx.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + from threading import Lock import bgl diff --git a/magic_uv/op/__init__.py b/magic_uv/op/__init__.py index 702ee452..da77b17b 100644 --- a/magic_uv/op/__init__.py +++ b/magic_uv/op/__init__.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/align_uv.py b/magic_uv/op/align_uv.py index 0cc3bcda..9f606db9 100644 --- a/magic_uv/op/align_uv.py +++ b/magic_uv/op/align_uv.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "imdjs, Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/align_uv_cursor.py b/magic_uv/op/align_uv_cursor.py index 10f19a71..2b7f1491 100644 --- a/magic_uv/op/align_uv_cursor.py +++ b/magic_uv/op/align_uv_cursor.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/clip_uv.py b/magic_uv/op/clip_uv.py index b1532a36..c7475543 100644 --- a/magic_uv/op/clip_uv.py +++ b/magic_uv/op/clip_uv.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Dusan Stevanovic, Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/copy_paste_uv.py b/magic_uv/op/copy_paste_uv.py index 761aa36b..8ee83ad9 100644 --- a/magic_uv/op/copy_paste_uv.py +++ b/magic_uv/op/copy_paste_uv.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>, Jace Priester" __status__ = "production" diff --git a/magic_uv/op/copy_paste_uv_object.py b/magic_uv/op/copy_paste_uv_object.py index 37706c37..4e5d500a 100644 --- a/magic_uv/op/copy_paste_uv_object.py +++ b/magic_uv/op/copy_paste_uv_object.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/copy_paste_uv_uvedit.py b/magic_uv/op/copy_paste_uv_uvedit.py index 5ee7d62c..7055915f 100644 --- a/magic_uv/op/copy_paste_uv_uvedit.py +++ b/magic_uv/op/copy_paste_uv_uvedit.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "imdjs, Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/flip_rotate_uv.py b/magic_uv/op/flip_rotate_uv.py index 246e5fbf..cb40ede8 100644 --- a/magic_uv/op/flip_rotate_uv.py +++ b/magic_uv/op/flip_rotate_uv.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/mirror_uv.py b/magic_uv/op/mirror_uv.py index 3cad279d..dce3ca01 100644 --- a/magic_uv/op/mirror_uv.py +++ b/magic_uv/op/mirror_uv.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Keith (Wahooney) Boshoff, Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/move_uv.py b/magic_uv/op/move_uv.py index 210169ab..76022d12 100644 --- a/magic_uv/op/move_uv.py +++ b/magic_uv/op/move_uv.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "kgeogeo, mem, Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/pack_uv.py b/magic_uv/op/pack_uv.py index dd4a74d3..5eaceaf4 100644 --- a/magic_uv/op/pack_uv.py +++ b/magic_uv/op/pack_uv.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/preserve_uv_aspect.py b/magic_uv/op/preserve_uv_aspect.py index f1404b10..9d3cbdde 100644 --- a/magic_uv/op/preserve_uv_aspect.py +++ b/magic_uv/op/preserve_uv_aspect.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/select_uv.py b/magic_uv/op/select_uv.py index bf01f954..affc41e4 100644 --- a/magic_uv/op/select_uv.py +++ b/magic_uv/op/select_uv.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/smooth_uv.py b/magic_uv/op/smooth_uv.py index 232d6ccc..020bc78f 100644 --- a/magic_uv/op/smooth_uv.py +++ b/magic_uv/op/smooth_uv.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "imdjs, Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/texture_lock.py b/magic_uv/op/texture_lock.py index 6873cc4a..f54c9453 100644 --- a/magic_uv/op/texture_lock.py +++ b/magic_uv/op/texture_lock.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/texture_projection.py b/magic_uv/op/texture_projection.py index 9ce3cdc4..912447c3 100644 --- a/magic_uv/op/texture_projection.py +++ b/magic_uv/op/texture_projection.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/texture_wrap.py b/magic_uv/op/texture_wrap.py index 9a706fd7..4f9c868d 100644 --- a/magic_uv/op/texture_wrap.py +++ b/magic_uv/op/texture_wrap.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/transfer_uv.py b/magic_uv/op/transfer_uv.py index da308816..029a5de3 100644 --- a/magic_uv/op/transfer_uv.py +++ b/magic_uv/op/transfer_uv.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>, Mifth, MaxRobinot" __status__ = "production" diff --git a/magic_uv/op/unwrap_constraint.py b/magic_uv/op/unwrap_constraint.py index 489c3b69..da94c495 100644 --- a/magic_uv/op/unwrap_constraint.py +++ b/magic_uv/op/unwrap_constraint.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/uv_bounding_box.py b/magic_uv/op/uv_bounding_box.py index d7b9badb..436f6679 100644 --- a/magic_uv/op/uv_bounding_box.py +++ b/magic_uv/op/uv_bounding_box.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/uv_inspection.py b/magic_uv/op/uv_inspection.py index 7ee1633d..e974221e 100644 --- a/magic_uv/op/uv_inspection.py +++ b/magic_uv/op/uv_inspection.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/uv_sculpt.py b/magic_uv/op/uv_sculpt.py index 0821f0bc..24c76e13 100644 --- a/magic_uv/op/uv_sculpt.py +++ b/magic_uv/op/uv_sculpt.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/uvw.py b/magic_uv/op/uvw.py index 3b155b89..516a5da8 100644 --- a/magic_uv/op/uvw.py +++ b/magic_uv/op/uvw.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Alexander Milovsky, Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/op/world_scale_uv.py b/magic_uv/op/world_scale_uv.py index dd42ed3d..9c617ee4 100644 --- a/magic_uv/op/world_scale_uv.py +++ b/magic_uv/op/world_scale_uv.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "McBuff, Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/preferences.py b/magic_uv/preferences.py index 7d6ac957..27785ad9 100644 --- a/magic_uv/preferences.py +++ b/magic_uv/preferences.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/properites.py b/magic_uv/properites.py deleted file mode 100644 index a301d64f..00000000 --- a/magic_uv/properites.py +++ /dev/null @@ -1,43 +0,0 @@ -# <pep8-80 compliant> - -# ##### 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 ##### - -__author__ = "Nutti <nutti.metro@gmail.com>" -__status__ = "production" -__version__ = "6.5" -__date__ = "6 Mar 2021" - - -from .utils.property_class_registry import PropertyClassRegistry - - -# Properties used in this add-on. -# pylint: disable=W0612 -class MUV_Properties(): - pass - - -def init_props(scene): - scene.muv_props = MUV_Properties() - PropertyClassRegistry.init_props(scene) - - -def clear_props(scene): - PropertyClassRegistry.del_props(scene) - del scene.muv_props diff --git a/magic_uv/properties.py b/magic_uv/properties.py new file mode 100644 index 00000000..21506915 --- /dev/null +++ b/magic_uv/properties.py @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +# <pep8-80 compliant> + +__author__ = "Nutti <nutti.metro@gmail.com>" +__status__ = "production" +__version__ = "6.5" +__date__ = "6 Mar 2021" + + +from .utils.property_class_registry import PropertyClassRegistry + + +# Properties used in this add-on. +# pylint: disable=W0612 +class MUV_Properties(): + pass + + +def init_props(scene): + scene.muv_props = MUV_Properties() + PropertyClassRegistry.init_props(scene) + + +def clear_props(scene): + PropertyClassRegistry.del_props(scene) + del scene.muv_props diff --git a/magic_uv/ui/IMAGE_MT_uvs.py b/magic_uv/ui/IMAGE_MT_uvs.py index 79199cfd..adad2fe9 100644 --- a/magic_uv/ui/IMAGE_MT_uvs.py +++ b/magic_uv/ui/IMAGE_MT_uvs.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" @@ -107,7 +91,8 @@ class MUV_MT_AlignUV(bpy.types.Menu): ops.group = sc.muv_align_uv_snap_point_group ops.target = sc.muv_align_uv_snap_point_target - ops = layout.operator(MUV_OT_AlignUV_SnapToEdge, text="Snap to Edge") + ops = layout.operator(MUV_OT_AlignUV_SnapToEdge.bl_idname, + text="Snap to Edge") ops.group = sc.muv_align_uv_snap_edge_group ops.target_1 = sc.muv_align_uv_snap_edge_target_1 ops.target_2 = sc.muv_align_uv_snap_edge_target_2 diff --git a/magic_uv/ui/VIEW3D_MT_object.py b/magic_uv/ui/VIEW3D_MT_object.py index e4255c3a..29d5d607 100644 --- a/magic_uv/ui/VIEW3D_MT_object.py +++ b/magic_uv/ui/VIEW3D_MT_object.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/ui/VIEW3D_MT_uv_map.py b/magic_uv/ui/VIEW3D_MT_uv_map.py index a795ad48..ee99ccba 100644 --- a/magic_uv/ui/VIEW3D_MT_uv_map.py +++ b/magic_uv/ui/VIEW3D_MT_uv_map.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/ui/__init__.py b/magic_uv/ui/__init__.py index ebf11949..883e966f 100644 --- a/magic_uv/ui/__init__.py +++ b/magic_uv/ui/__init__.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/ui/uvedit_copy_paste_uv.py b/magic_uv/ui/uvedit_copy_paste_uv.py index 2f652460..847b6e9a 100644 --- a/magic_uv/ui/uvedit_copy_paste_uv.py +++ b/magic_uv/ui/uvedit_copy_paste_uv.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/ui/uvedit_editor_enhancement.py b/magic_uv/ui/uvedit_editor_enhancement.py index 3d1e9ba3..b73e5eb9 100644 --- a/magic_uv/ui/uvedit_editor_enhancement.py +++ b/magic_uv/ui/uvedit_editor_enhancement.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/ui/uvedit_uv_manipulation.py b/magic_uv/ui/uvedit_uv_manipulation.py index 4a4358da..636a0aca 100644 --- a/magic_uv/ui/uvedit_uv_manipulation.py +++ b/magic_uv/ui/uvedit_uv_manipulation.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/ui/view3d_copy_paste_uv_editmode.py b/magic_uv/ui/view3d_copy_paste_uv_editmode.py index 6a458aff..d0b52021 100644 --- a/magic_uv/ui/view3d_copy_paste_uv_editmode.py +++ b/magic_uv/ui/view3d_copy_paste_uv_editmode.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/ui/view3d_copy_paste_uv_objectmode.py b/magic_uv/ui/view3d_copy_paste_uv_objectmode.py index b4fb3934..1153bedd 100644 --- a/magic_uv/ui/view3d_copy_paste_uv_objectmode.py +++ b/magic_uv/ui/view3d_copy_paste_uv_objectmode.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/ui/view3d_uv_manipulation.py b/magic_uv/ui/view3d_uv_manipulation.py index dde58266..5e7ae28a 100644 --- a/magic_uv/ui/view3d_uv_manipulation.py +++ b/magic_uv/ui/view3d_uv_manipulation.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/ui/view3d_uv_mapping.py b/magic_uv/ui/view3d_uv_mapping.py index 22d20b4f..1fd05dff 100644 --- a/magic_uv/ui/view3d_uv_mapping.py +++ b/magic_uv/ui/view3d_uv_mapping.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/utils/__init__.py b/magic_uv/utils/__init__.py index 87c6eacb..22ed284a 100644 --- a/magic_uv/utils/__init__.py +++ b/magic_uv/utils/__init__.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/utils/bl_class_registry.py b/magic_uv/utils/bl_class_registry.py index 93f29244..56ee91eb 100644 --- a/magic_uv/utils/bl_class_registry.py +++ b/magic_uv/utils/bl_class_registry.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/utils/compatibility.py b/magic_uv/utils/compatibility.py index d17f2c66..cc8813e5 100644 --- a/magic_uv/utils/compatibility.py +++ b/magic_uv/utils/compatibility.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/magic_uv/utils/property_class_registry.py b/magic_uv/utils/property_class_registry.py index ef4f5872..62cba903 100644 --- a/magic_uv/utils/property_class_registry.py +++ b/magic_uv/utils/property_class_registry.py @@ -1,22 +1,6 @@ -# <pep8-80 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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-80 compliant> __author__ = "Nutti <nutti.metro@gmail.com>" __status__ = "production" diff --git a/materials_library_vx/__init__.py b/materials_library_vx/__init__.py index 60abb02b..c19eab87 100644 --- a/materials_library_vx/__init__.py +++ b/materials_library_vx/__init__.py @@ -1,22 +1,4 @@ -# -*- coding:utf-8 -*- - -# #####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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Material Library", @@ -767,7 +749,7 @@ class MATLIB_MT_CatsMenu(Menu): # def poll(cls, context): # return context.active_object is not None # -# def exectute(self, context): +# def execute(self, context): # print("executing") # return {"FINISHED"} diff --git a/materials_utils/__init__.py b/materials_utils/__init__.py index 84b10fc1..d684ce35 100644 --- a/materials_utils/__init__.py +++ b/materials_utils/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + # Material Utilities v2.2.0-Beta # # Usage: Shift + Q in the 3D viewport @@ -12,25 +14,6 @@ # (some code thanks to: CoDEmanX, SynaGl0w, ideasman42) # Link to base names: Sybren, Texture renamer: Yadoob # ### -# -# -# ##### 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 ##### bl_info = { "name": "Material Utilities", diff --git a/materials_utils/enum_values.py b/materials_utils/enum_values.py index 2f257400..9e198806 100644 --- a/materials_utils/enum_values.py +++ b/materials_utils/enum_values.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy diff --git a/materials_utils/functions.py b/materials_utils/functions.py index 4663fbeb..9397257a 100644 --- a/materials_utils/functions.py +++ b/materials_utils/functions.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy from math import radians, degrees diff --git a/materials_utils/menus.py b/materials_utils/menus.py index 2e444298..3fff4a0d 100644 --- a/materials_utils/menus.py +++ b/materials_utils/menus.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from .functions import * diff --git a/materials_utils/operators.py b/materials_utils/operators.py index a91c2301..98eab763 100644 --- a/materials_utils/operators.py +++ b/materials_utils/operators.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy from bpy.types import Operator diff --git a/materials_utils/preferences.py b/materials_utils/preferences.py index 7fdbd9ff..fdbb4993 100644 --- a/materials_utils/preferences.py +++ b/materials_utils/preferences.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy from bpy.types import ( diff --git a/measureit/__init__.py b/measureit/__init__.py index 660b02bb..8b0c827c 100644 --- a/measureit/__init__.py +++ b/measureit/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/measureit/measureit_geometry.py b/measureit/measureit_geometry.py index dbb9edd7..f9cdf5a8 100644 --- a/measureit/measureit_geometry.py +++ b/measureit/measureit_geometry.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/measureit/measureit_main.py b/measureit/measureit_main.py index 233501b6..b93ff1ab 100644 --- a/measureit/measureit_main.py +++ b/measureit/measureit_main.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/measureit/measureit_render.py b/measureit/measureit_render.py index a298fbd1..edb4c05a 100644 --- a/measureit/measureit_render.py +++ b/measureit/measureit_render.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/mesh_auto_mirror.py b/mesh_auto_mirror.py index 7057227b..114ee9d3 100644 --- a/mesh_auto_mirror.py +++ b/mesh_auto_mirror.py @@ -1,8 +1,9 @@ +# SPDX-License-Identifier: GPL-3.0-or-later + ###################################################################################################### # A simple add-on to auto cut in two and mirror an object # # Actually partially uncommented (see further version) # # Author: Lapineige, Bookyakuno # -# License: GPL v3 # ###################################################################################################### # 2.8 update by Bookyakuno, meta-androcto diff --git a/mesh_bsurfaces.py b/mesh_bsurfaces.py index ef2a88c8..58ddd7aa 100644 --- a/mesh_bsurfaces.py +++ b/mesh_bsurfaces.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { @@ -1,22 +1,6 @@ -# Updated for 2.8 jan 5 2019 +# SPDX-License-Identifier: GPL-2.0-or-later -# ##### 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 ##### +# Updated for 2.8 jan 5 2019 # <pep8 compliant> diff --git a/mesh_inset/__init__.py b/mesh_inset/__init__.py index 74148dfe..2f769dac 100644 --- a/mesh_inset/__init__.py +++ b/mesh_inset/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/mesh_inset/geom.py b/mesh_inset/geom.py index 4d3e652b..f9c83253 100644 --- a/mesh_inset/geom.py +++ b/mesh_inset/geom.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/mesh_inset/model.py b/mesh_inset/model.py index 446a7c4c..476cb8c0 100644 --- a/mesh_inset/model.py +++ b/mesh_inset/model.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/mesh_inset/offset.py b/mesh_inset/offset.py index 6bc81787..da4adaad 100644 --- a/mesh_inset/offset.py +++ b/mesh_inset/offset.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/mesh_inset/triquad.py b/mesh_inset/triquad.py index 1a5c266f..af1a9153 100644 --- a/mesh_inset/triquad.py +++ b/mesh_inset/triquad.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/mesh_looptools.py b/mesh_looptools.py index 3927c886..5bd663d4 100644 --- a/mesh_looptools.py +++ b/mesh_looptools.py @@ -1,20 +1,5 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later # -# 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 ##### # Contributed to Germano Cavalcante (mano-wii), Florian Meyer (testscreenings), # Brendon Murphy (meta-androcto), # Maintainer: Vladimir Spivak (cwolf3d) diff --git a/mesh_snap_utilities_line/__init__.py b/mesh_snap_utilities_line/__init__.py index 57479cee..9114e96e 100644 --- a/mesh_snap_utilities_line/__init__.py +++ b/mesh_snap_utilities_line/__init__.py @@ -1,19 +1,4 @@ -### 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 3 -# 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, see <http://www.gnu.org/licenses/>. -# -# ##### END GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Contact for more information about the Addon: # Email: germano.costa@ig.com.br diff --git a/mesh_snap_utilities_line/common_classes.py b/mesh_snap_utilities_line/common_classes.py index 3068100a..713b2698 100644 --- a/mesh_snap_utilities_line/common_classes.py +++ b/mesh_snap_utilities_line/common_classes.py @@ -1,19 +1,5 @@ -### 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 3 -# 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, see <http://www.gnu.org/licenses/>. -# -# ##### END GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy from mathutils import ( @@ -215,11 +201,11 @@ class CharMap: class Constrain: - def __init__(self, peferences, scene, obj): + def __init__(self, prefs, scene, obj): self.last_type = None self.last_vec = None self.rotMat = None - self.preferences = peferences + self.preferences = prefs trans_orient = scene.transform_orientation_slots[0] self.orientation = [None, None] if trans_orient.type == 'LOCAL': diff --git a/mesh_snap_utilities_line/common_utilities.py b/mesh_snap_utilities_line/common_utilities.py index 9c63c3f2..447265d8 100644 --- a/mesh_snap_utilities_line/common_utilities.py +++ b/mesh_snap_utilities_line/common_utilities.py @@ -1,19 +1,4 @@ -### 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 3 -# 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, see <http://www.gnu.org/licenses/>. -# -# ##### END GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later #python tip: from-imports don't save memory. #They execute and cache the entire module just like a regular import. diff --git a/mesh_snap_utilities_line/drawing_utilities.py b/mesh_snap_utilities_line/drawing_utilities.py index b4e53a00..e2141cbc 100644 --- a/mesh_snap_utilities_line/drawing_utilities.py +++ b/mesh_snap_utilities_line/drawing_utilities.py @@ -1,19 +1,4 @@ -### 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 3 -# 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, see <http://www.gnu.org/licenses/>. -# -# ##### END GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later import gpu from mathutils import Vector, Matrix diff --git a/mesh_snap_utilities_line/keys.py b/mesh_snap_utilities_line/keys.py index 29523966..6fcd2986 100644 --- a/mesh_snap_utilities_line/keys.py +++ b/mesh_snap_utilities_line/keys.py @@ -1,5 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0-or-later -#km_snap_utilities_modal_keymap = "Snap Utilities Modal Map" +# km_snap_utilities_modal_keymap = "Snap Utilities Modal Map" km_tool_snap_utilities_line = "3D View Tool: Edit Mesh, Make Line" diff --git a/mesh_snap_utilities_line/navigation_ops.py b/mesh_snap_utilities_line/navigation_ops.py index f08364d8..d92dcb58 100644 --- a/mesh_snap_utilities_line/navigation_ops.py +++ b/mesh_snap_utilities_line/navigation_ops.py @@ -1,19 +1,4 @@ -### 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 3 -# 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, see <http://www.gnu.org/licenses/>. -# -# ##### END GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy diff --git a/mesh_snap_utilities_line/op_line.py b/mesh_snap_utilities_line/op_line.py index f7687911..2a0d9953 100644 --- a/mesh_snap_utilities_line/op_line.py +++ b/mesh_snap_utilities_line/op_line.py @@ -1,19 +1,4 @@ -### 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 3 -# 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, see <http://www.gnu.org/licenses/>. -# -# ##### END GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy import bmesh diff --git a/mesh_snap_utilities_line/preferences.py b/mesh_snap_utilities_line/preferences.py index 98a213be..2336de90 100644 --- a/mesh_snap_utilities_line/preferences.py +++ b/mesh_snap_utilities_line/preferences.py @@ -1,19 +1,5 @@ -### 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 3 -# 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, see <http://www.gnu.org/licenses/>. -# -# ##### END GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy from bpy.props import ( diff --git a/mesh_snap_utilities_line/snap_context_l/__init__.py b/mesh_snap_utilities_line/snap_context_l/__init__.py index 5b4d14bb..2bb51ea3 100644 --- a/mesh_snap_utilities_line/snap_context_l/__init__.py +++ b/mesh_snap_utilities_line/snap_context_l/__init__.py @@ -1,19 +1,5 @@ -# ##### 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 3 -# 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, see <http://www.gnu.org/licenses/>. -# -# ##### END GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later + __all__ = ("SnapContext",) import gpu diff --git a/mesh_snap_utilities_line/snap_context_l/mesh_drawing.py b/mesh_snap_utilities_line/snap_context_l/mesh_drawing.py index 679ee932..e0f95bd1 100644 --- a/mesh_snap_utilities_line/snap_context_l/mesh_drawing.py +++ b/mesh_snap_utilities_line/snap_context_l/mesh_drawing.py @@ -1,19 +1,5 @@ -# ##### 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 3 -# 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, see <http://www.gnu.org/licenses/>. -# -# ##### END GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later + import gpu import bmesh from mathutils import Matrix diff --git a/mesh_snap_utilities_line/snap_context_l/utils_projection.py b/mesh_snap_utilities_line/snap_context_l/utils_projection.py index b941f7db..b495b057 100644 --- a/mesh_snap_utilities_line/snap_context_l/utils_projection.py +++ b/mesh_snap_utilities_line/snap_context_l/utils_projection.py @@ -1,20 +1,4 @@ -# ##### 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 3 -# 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, see <http://www.gnu.org/licenses/>. -# -# ##### END GPL LICENSE BLOCK ##### - +# SPDX-License-Identifier: GPL-2.0-or-later from mathutils import Vector from mathutils.geometry import intersect_point_line diff --git a/mesh_snap_utilities_line/widgets.py b/mesh_snap_utilities_line/widgets.py index 98edf5f3..36be306b 100644 --- a/mesh_snap_utilities_line/widgets.py +++ b/mesh_snap_utilities_line/widgets.py @@ -1,19 +1,4 @@ -### 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 3 -# 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, see <http://www.gnu.org/licenses/>. -# -# ##### END GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy diff --git a/mesh_tiny_cad/BIX.py b/mesh_tiny_cad/BIX.py index 89908f60..b8848446 100644 --- a/mesh_tiny_cad/BIX.py +++ b/mesh_tiny_cad/BIX.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/mesh_tiny_cad/CCEN.py b/mesh_tiny_cad/CCEN.py index f97ca84b..d0b247bb 100644 --- a/mesh_tiny_cad/CCEN.py +++ b/mesh_tiny_cad/CCEN.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/mesh_tiny_cad/CFG.py b/mesh_tiny_cad/CFG.py index 9eb02a29..5d5077bf 100644 --- a/mesh_tiny_cad/CFG.py +++ b/mesh_tiny_cad/CFG.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/mesh_tiny_cad/E2F.py b/mesh_tiny_cad/E2F.py index 33ac79f3..a5152e8a 100644 --- a/mesh_tiny_cad/E2F.py +++ b/mesh_tiny_cad/E2F.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/mesh_tiny_cad/V2X.py b/mesh_tiny_cad/V2X.py index c8683297..4d2bc9ea 100644 --- a/mesh_tiny_cad/V2X.py +++ b/mesh_tiny_cad/V2X.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/mesh_tiny_cad/VTX.py b/mesh_tiny_cad/VTX.py index fbd0bc28..4aa0cefc 100644 --- a/mesh_tiny_cad/VTX.py +++ b/mesh_tiny_cad/VTX.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/mesh_tiny_cad/XALL.py b/mesh_tiny_cad/XALL.py index a240c56f..c369d49c 100644 --- a/mesh_tiny_cad/XALL.py +++ b/mesh_tiny_cad/XALL.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/mesh_tiny_cad/__init__.py b/mesh_tiny_cad/__init__.py index c4626e6d..75374925 100644 --- a/mesh_tiny_cad/__init__.py +++ b/mesh_tiny_cad/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/mesh_tiny_cad/cad_module.py b/mesh_tiny_cad/cad_module.py index 575a6896..330cd978 100644 --- a/mesh_tiny_cad/cad_module.py +++ b/mesh_tiny_cad/cad_module.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/mesh_tissue/__init__.py b/mesh_tissue/__init__.py index cfbfacf1..03fa4b61 100644 --- a/mesh_tissue/__init__.py +++ b/mesh_tissue/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # --------------------------------- TISSUE ----------------------------------- # # ------------------------------- version 0.3 -------------------------------- # diff --git a/mesh_tissue/config.py b/mesh_tissue/config.py index 380cb281..0351ebc9 100644 --- a/mesh_tissue/config.py +++ b/mesh_tissue/config.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy from bpy.props import ( IntProperty, diff --git a/mesh_tissue/curves_tools.py b/mesh_tissue/curves_tools.py index 5f6e07a4..11a4ced7 100644 --- a/mesh_tissue/curves_tools.py +++ b/mesh_tissue/curves_tools.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # # # (c) Alessandro Zomparelli # diff --git a/mesh_tissue/dual_mesh.py b/mesh_tissue/dual_mesh.py index c464bb6d..5b32d46b 100644 --- a/mesh_tissue/dual_mesh.py +++ b/mesh_tissue/dual_mesh.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # --------------------------------- DUAL MESH -------------------------------- # # -------------------------------- version 0.3 ------------------------------- # diff --git a/mesh_tissue/lattice.py b/mesh_tissue/lattice.py index 10cec92c..5d9c66f0 100644 --- a/mesh_tissue/lattice.py +++ b/mesh_tissue/lattice.py @@ -1,20 +1,5 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later + # --------------------------- LATTICE ALONG SURFACE -------------------------- # # -------------------------------- version 0.3 ------------------------------- # # # diff --git a/mesh_tissue/material_tools.py b/mesh_tissue/material_tools.py index a734abeb..b41568c4 100644 --- a/mesh_tissue/material_tools.py +++ b/mesh_tissue/material_tools.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # # # (c) Alessandro Zomparelli # diff --git a/mesh_tissue/numba_functions.py b/mesh_tissue/numba_functions.py index b3355017..86e83e54 100644 --- a/mesh_tissue/numba_functions.py +++ b/mesh_tissue/numba_functions.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import numpy as np import time diff --git a/mesh_tissue/polyhedra.py b/mesh_tissue/polyhedra.py index 394d605a..bd5fca78 100644 --- a/mesh_tissue/polyhedra.py +++ b/mesh_tissue/polyhedra.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # ---------------------------- ADAPTIVE DUPLIFACES --------------------------- # # ------------------------------- version 0.84 ------------------------------- # @@ -174,7 +158,7 @@ class polyhedra_wireframe(Operator): verts1 = [v.index for v in f1.verts] va1 = verts1.index(e.verts[0].index) vb1 = verts1.index(e.verts[1].index) - # chech if order of the edge matches the order of the face + # check if order of the edge matches the order of the face dir1 = va1 == (vb1+1)%len(verts1) edge_vec1 = edge_vec if dir1 else -edge_vec @@ -190,7 +174,7 @@ class polyhedra_wireframe(Operator): verts2 = [v.index for v in f2.verts] va2 = verts2.index(e.verts[0].index) vb2 = verts2.index(e.verts[1].index) - # chech if order of the edge matches the order of the face + # check if order of the edge matches the order of the face dir2 = va2 == (vb2+1)%len(verts2) # check for normal consistency if dir1 != dir2: diff --git a/mesh_tissue/tessellate_numpy.py b/mesh_tissue/tessellate_numpy.py index a20094af..50516b2a 100644 --- a/mesh_tissue/tessellate_numpy.py +++ b/mesh_tissue/tessellate_numpy.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # ---------------------------- ADAPTIVE DUPLIFACES --------------------------- # # ------------------------------- version 0.84 ------------------------------- # @@ -592,7 +576,7 @@ def tessellate_patch(props): for mat_id, _ob1 in enumerate(components): if _ob1 == None: continue - # Set original values (for next commponents) + # Set original values (for next components) com_modifiers = _com_modifiers bool_shapekeys = _bool_shapekeys @@ -1268,7 +1252,7 @@ class tissue_tessellate(Operator): min=1, soft_max=5, description="Automatically repeat the Tessellation using the " - + "generated geometry as new base object.\nUsefull for " + + "generated geometry as new base object.\nUseful for " + "for branching systems. Dangerous!" ) bool_combine : BoolProperty( @@ -1583,7 +1567,7 @@ class tissue_tessellate(Operator): if no_components: layout = self.layout layout.label(icon='OUTLINER_COLLECTION', text='Components from Active Collection') - layout.label(icon='INFO', text="The Active Collection does not containt any Mesh,") + layout.label(icon='INFO', text="The Active Collection does not contain any Mesh,") layout.label(text="Curve, Surface, Meta or Text object.") return elif self.component_mode == 'MATERIALS': @@ -3741,7 +3725,7 @@ def offset_boundary_materials(bm, boundary_mat_offset=0, boundary_variable_offse bound_verts_value = [0]*len(bm.faces) bound_edges_value = [0]*len(bm.faces) shift_faces = [0]*len(bm.faces) - # store boundaries informations + # store boundaries information for v in bm.verts: if v.is_boundary: for f in v.link_faces: diff --git a/mesh_tissue/tissue_properties.py b/mesh_tissue/tissue_properties.py index 433e60ea..bc06aefc 100644 --- a/mesh_tissue/tissue_properties.py +++ b/mesh_tissue/tissue_properties.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # ---------------------------- ADAPTIVE DUPLIFACES --------------------------- # # ------------------------------- version 0.84 ------------------------------- # diff --git a/mesh_tissue/utils.py b/mesh_tissue/utils.py index 834b5947..b617ac93 100644 --- a/mesh_tissue/utils.py +++ b/mesh_tissue/utils.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy, bmesh import threading @@ -1448,7 +1432,7 @@ def mod_preserve_shape(mod): def recurLayerCollection(layerColl, collName): ''' - Recursivly transverse layer_collection for a particular name. + Recursively transverse layer_collection for a particular name. ''' found = None if (layerColl.name == collName): diff --git a/mesh_tissue/utils_pip.py b/mesh_tissue/utils_pip.py index adfad77f..9e5e712d 100644 --- a/mesh_tissue/utils_pip.py +++ b/mesh_tissue/utils_pip.py @@ -1,22 +1,4 @@ -# -*- coding:utf-8 -*- - -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/mesh_tissue/uv_to_mesh.py b/mesh_tissue/uv_to_mesh.py index 0fa7fa8b..13cb09e7 100644 --- a/mesh_tissue/uv_to_mesh.py +++ b/mesh_tissue/uv_to_mesh.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # --------------------------------- UV to MESH ------------------------------- # # -------------------------------- version 0.1.1 ----------------------------- # diff --git a/mesh_tissue/weight_tools.py b/mesh_tissue/weight_tools.py index d58adc6f..2736945e 100644 --- a/mesh_tissue/weight_tools.py +++ b/mesh_tissue/weight_tools.py @@ -1,27 +1,11 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later #-------------------------- COLORS / GROUPS EXCHANGER -------------------------# # # -# Vertex Color to Vertex Group allow you to convert colors channles to weight # +# Vertex Color to Vertex Group allow you to convert colors channels to weight # # maps. # # The main purpose is to use vertex colors to store information when importing # -# files from other softwares. The script works with the active vertex color # +# files from other software. The script works with the active vertex color # # slot. # # For use the command "Vertex Clors to Vertex Groups" use the search bar # # (space bar). # @@ -229,27 +213,27 @@ class reaction_diffusion_prop(PropertyGroup): update_weight_a : BoolProperty( name="Update Vertex Group A", default=True, - description="Tranfer Cache to the Vertex Groups named A") + description="Transfer Cache to the Vertex Groups named A") update_weight_b : BoolProperty( name="Update Vertex Group B", default=True, - description="Tranfer Cache to the Vertex Groups named B") + description="Transfer Cache to the Vertex Groups named B") update_colors_a : BoolProperty( name="Update Vertex Color A", default=False, - description="Tranfer Cache to the Vertex Color named A") + description="Transfer Cache to the Vertex Color named A") update_colors_b : BoolProperty( name="Update Vertex Color B", default=False, - description="Tranfer Cache to the Vertex Color named B") + description="Transfer Cache to the Vertex Color named B") update_colors : BoolProperty( name="Update Vertex Color AB", default=False, - description="Tranfer Cache to the Vertex Color named AB") + description="Transfer Cache to the Vertex Color named AB") update_uv : BoolProperty( name="Update UV", default=False, - description="Tranfer Cache to the UV Map Layer named AB") + description="Transfer Cache to the UV Map Layer named AB") normalize : BoolProperty( name="Normalize values", default=False, diff --git a/mesh_tools/__init__.py b/mesh_tools/__init__.py index ff9a60bd..e1af3c8a 100644 --- a/mesh_tools/__init__.py +++ b/mesh_tools/__init__.py @@ -1,25 +1,10 @@ -# ##### BEGIN GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later # -# 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 ##### # Contributed to by: # meta-androcto, Hidesato Ikeya, zmj100, Gert De Roost, TrumanBlending, PKHG, # # Oscurart, Greg, Stanislav Blinov, komi3D, BlenderLab, Paul Marshall (brikbot), # # metalliandy, macouno, CoDEmanX, dustractor, Liero, lijenstina, Germano Cavalcante # -# Pistiwique, Jimmy Hazevoet # +# Pistiwique, Jimmy Hazevoet bl_info = { "name": "Edit Mesh Tools", diff --git a/mesh_tools/face_inset_fillet.py b/mesh_tools/face_inset_fillet.py index 8af709c1..a236f268 100644 --- a/mesh_tools/face_inset_fillet.py +++ b/mesh_tools/face_inset_fillet.py @@ -1,22 +1,4 @@ -# -*- coding: utf-8 -*- - -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # based completely on addon by zmj100 # added some distance limits to prevent overlap - max12345 diff --git a/mesh_tools/mesh_cut_faces.py b/mesh_tools/mesh_cut_faces.py index 99f7c8ac..c3e999c3 100644 --- a/mesh_tools/mesh_cut_faces.py +++ b/mesh_tools/mesh_cut_faces.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + bl_info = { "name" : "Cut Faces", "author" : "Stanislav Blinov", diff --git a/mesh_tools/mesh_edge_roundifier.py b/mesh_tools/mesh_edge_roundifier.py index 994d2b6f..7e1874e2 100644 --- a/mesh_tools/mesh_edge_roundifier.py +++ b/mesh_tools/mesh_edge_roundifier.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Edge Roundifier", diff --git a/mesh_tools/mesh_edges_floor_plan.py b/mesh_tools/mesh_edges_floor_plan.py index a23cf73d..bff943d2 100644 --- a/mesh_tools/mesh_edges_floor_plan.py +++ b/mesh_tools/mesh_edges_floor_plan.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # based upon the functionality of Mesh to wall by luxuy_BlenderCN # thanks to meta-androcto diff --git a/mesh_tools/mesh_edges_length.py b/mesh_tools/mesh_edges_length.py index ee9ae15b..b4e91be0 100644 --- a/mesh_tools/mesh_edges_length.py +++ b/mesh_tools/mesh_edges_length.py @@ -1,4 +1,6 @@ -# gpl author: Giuseppe De Marco [BlenderLab] inspired by NirenYang +# SPDX-License-Identifier: GPL-2.0-or-later + +# Author: Giuseppe De Marco [BlenderLab] inspired by NirenYang bl_info = { "name": "Set edges length", diff --git a/mesh_tools/mesh_edgetools.py b/mesh_tools/mesh_edgetools.py index b9b61958..90c46fef 100644 --- a/mesh_tools/mesh_edgetools.py +++ b/mesh_tools/mesh_edgetools.py @@ -1,22 +1,7 @@ -# The Blender Edgetools is to bring CAD tools to Blender. -# Copyright (C) 2012 Paul Marshall +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright 2012 Paul Marshall. -# ##### 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 3 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, see <http://www.gnu.org/licenses/>. -# -# ##### END GPL LICENSE BLOCK ##### +# The Blender Edgetools is to bring CAD tools to Blender. # <pep8 compliant> diff --git a/mesh_tools/mesh_extrude_and_reshape.py b/mesh_tools/mesh_extrude_and_reshape.py index ee26cdcd..3776f79c 100644 --- a/mesh_tools/mesh_extrude_and_reshape.py +++ b/mesh_tools/mesh_extrude_and_reshape.py @@ -1,19 +1,4 @@ -# ##### 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 3 -# 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, see <http://www.gnu.org/licenses/>. -# -# ##### END GPL LICENSE BLOCK ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Contact for more information about the Addon: # Email: germano.costa@ig.com.br diff --git a/mesh_tools/mesh_filletplus.py b/mesh_tools/mesh_filletplus.py index 73e62198..c2ee13d5 100644 --- a/mesh_tools/mesh_filletplus.py +++ b/mesh_tools/mesh_filletplus.py @@ -1,22 +1,4 @@ -# -*- coding: utf-8 -*- - -# ##### END 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "FilletPlus", diff --git a/mesh_tools/mesh_mextrude_plus.py b/mesh_tools/mesh_mextrude_plus.py index eea04a51..c811db51 100644 --- a/mesh_tools/mesh_mextrude_plus.py +++ b/mesh_tools/mesh_mextrude_plus.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Repeats extrusion + rotation + scale for one or more faces # Original code by liero diff --git a/mesh_tools/mesh_offset_edges.py b/mesh_tools/mesh_offset_edges.py index d2c88867..b2559baf 100644 --- a/mesh_tools/mesh_offset_edges.py +++ b/mesh_tools/mesh_offset_edges.py @@ -1,21 +1,4 @@ -# ***** 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 LICENCE BLOCK ***** +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Offset Edges", diff --git a/mesh_tools/mesh_relax.py b/mesh_tools/mesh_relax.py index 03547769..119cc368 100644 --- a/mesh_tools/mesh_relax.py +++ b/mesh_tools/mesh_relax.py @@ -1,25 +1,7 @@ -# mesh_relax.py Copyright (C) 2010, Fabian Fricke -# +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright 2010 Fabian Fricke. + # Relaxes selected vertices while retaining the shape as much as possible -# -# ***** 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 LICENCE BLOCK ***** bl_info = { "name": "Relax", diff --git a/mesh_tools/mesh_vertex_chamfer.py b/mesh_tools/mesh_vertex_chamfer.py index e43d0729..860d54a4 100644 --- a/mesh_tools/mesh_vertex_chamfer.py +++ b/mesh_tools/mesh_vertex_chamfer.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/mesh_tools/pkhg_faces.py b/mesh_tools/pkhg_faces.py index 93a05209..1e9ee349 100644 --- a/mesh_tools/pkhg_faces.py +++ b/mesh_tools/pkhg_faces.py @@ -1,4 +1,4 @@ -# gpl author: PHKG +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "PKHG faces", diff --git a/mesh_tools/random_vertices.py b/mesh_tools/random_vertices.py index 8025b577..ad6d8b41 100644 --- a/mesh_tools/random_vertices.py +++ b/mesh_tools/random_vertices.py @@ -1,4 +1,4 @@ -# gpl authors: Oscurart, Greg +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Random Vertices", diff --git a/mesh_tools/split_solidify.py b/mesh_tools/split_solidify.py index 1ac952bc..116c7acf 100644 --- a/mesh_tools/split_solidify.py +++ b/mesh_tools/split_solidify.py @@ -1,22 +1,4 @@ -# -*- coding: utf-8 -*- - -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Split Solidify", diff --git a/mesh_tools/vertex_align.py b/mesh_tools/vertex_align.py index 41d09a71..ec1c812b 100644 --- a/mesh_tools/vertex_align.py +++ b/mesh_tools/vertex_align.py @@ -1,22 +1,4 @@ -# -*- coding: utf-8 -*- - -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Note: Property group was moved to __init__ diff --git a/node_arrange.py b/node_arrange.py index bab8b333..fda2b43a 100644 --- a/node_arrange.py +++ b/node_arrange.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Node Arrange", diff --git a/node_presets.py b/node_presets.py index dd159814..ae43a2eb 100644 --- a/node_presets.py +++ b/node_presets.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Node Presets", @@ -85,6 +69,7 @@ def node_template_add(context, filepath, node_group, ungroup, report): "ShaderNodeTree": "ShaderNodeGroup", "CompositorNodeTree": "CompositorNodeGroup", "TextureNodeTree": "TextureNodeGroup", + "GeometryNodeTree": "GeometryNodeGroup", }[type(node_tree).__name__] node = node_tree.nodes.new(type=node_type_string) diff --git a/node_wrangler.py b/node_wrangler.py index c9a31e1f..19ccf0c5 100644 --- a/node_wrangler.py +++ b/node_wrangler.py @@ -1,25 +1,9 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Node Wrangler", "author": "Bartek Skorupa, Greg Zaal, Sebastian Koenig, Christian Brinkmann, Florian Meyer", - "version": (3, 38), + "version": (3, 39), "blender": (2, 93, 0), "location": "Node Editor Toolbar or Shift-W", "description": "Various tools to enhance and speed up node-based workflow", @@ -732,6 +716,11 @@ def autolink(node1, node2, links): print("Could not make a link from " + node1.name + " to " + node2.name) return link_made +def abs_node_location(node): + abs_location = node.location + if node.parent is None: + return abs_location + return abs_location + abs_node_location(node.parent) def node_at_pos(nodes, context, event): nodes_under_mouse = [] @@ -746,23 +735,10 @@ def node_at_pos(nodes, context, event): for node in nodes: skipnode = False if node.type != 'FRAME': # no point trying to link to a frame node - locx = node.location.x - locy = node.location.y dimx = node.dimensions.x/dpifac() dimy = node.dimensions.y/dpifac() - if node.parent: - locx += node.parent.location.x - locy += node.parent.location.y - if node.parent.parent: - locx += node.parent.parent.location.x - locy += node.parent.parent.location.y - if node.parent.parent.parent: - locx += node.parent.parent.parent.location.x - locy += node.parent.parent.parent.location.y - if node.parent.parent.parent.parent: - # Support three levels or parenting - # There's got to be a better way to do this... - skipnode = True + locx, locy = abs_node_location(node) + if not skipnode: node_points_with_dist.append([node, hypot(x - locx, y - locy)]) # Top Left node_points_with_dist.append([node, hypot(x - (locx + dimx), y - locy)]) # Top Right @@ -778,13 +754,9 @@ def node_at_pos(nodes, context, event): for node in nodes: if node.type != 'FRAME' and skipnode == False: - locx = node.location.x - locy = node.location.y + locx, locy = abs_node_location(node) dimx = node.dimensions.x/dpifac() dimy = node.dimensions.y/dpifac() - if node.parent: - locx += node.parent.location.x - locy += node.parent.location.y if (locx <= x <= locx + dimx) and \ (locy - dimy <= y <= locy): nodes_under_mouse.append(node) @@ -839,26 +811,19 @@ def draw_circle_2d_filled(shader, mx, my, radius, colour=(1.0, 1.0, 1.0, 0.7)): shader.uniform_float("color", colour) batch.draw(shader) + def draw_rounded_node_border(shader, node, radius=8, colour=(1.0, 1.0, 1.0, 0.7)): area_width = bpy.context.area.width - (16*dpifac()) - 1 bottom_bar = (16*dpifac()) + 1 sides = 16 radius = radius*dpifac() - nlocx = (node.location.x+1)*dpifac() - nlocy = (node.location.y+1)*dpifac() + nlocx, nlocy = abs_node_location(node) + + nlocx = (nlocx+1)*dpifac() + nlocy = (nlocy+1)*dpifac() ndimx = node.dimensions.x ndimy = node.dimensions.y - # This is a stupid way to do this... TODO use while loop - if node.parent: - nlocx += node.parent.location.x - nlocy += node.parent.location.y - if node.parent.parent: - nlocx += node.parent.parent.location.x - nlocy += node.parent.parent.location.y - if node.parent.parent.parent: - nlocx += node.parent.parent.parent.location.x - nlocy += node.parent.parent.parent.location.y if node.hide: nlocx += -1 @@ -1153,6 +1118,22 @@ class NWPrincipledPreferences(bpy.types.PropertyGroup): name='Displacement', default='displacement displace disp dsp height heightmap', description='Naming Components for displacement maps') + transmission: StringProperty( + name='Transmission', + default='transmission transparency', + description='Naming Components for transmission maps') + emission: StringProperty( + name='Emission', + default='emission emissive emit', + description='Naming Components for emission maps') + alpha: StringProperty( + name='Alpha', + default='alpha opacity', + description='Naming Components for alpha maps') + ambient_occlusion: StringProperty( + name='Ambient Occlusion', + default='ao ambient occlusion', + description='Naming Components for AO maps') # Addon prefs class NWNodeWrangler(bpy.types.AddonPreferences): @@ -1214,6 +1195,10 @@ class NWNodeWrangler(bpy.types.AddonPreferences): col.prop(tags, "normal") col.prop(tags, "bump") col.prop(tags, "displacement") + col.prop(tags, "transmission") + col.prop(tags, "emission") + col.prop(tags, "alpha") + col.prop(tags, "ambient_occlusion") box = layout.box() col = box.column(align=True) @@ -3246,6 +3231,10 @@ class NWAddPrincipledSetup(Operator, NWBase, ImportHelper): ['Specular', tags.specular.split(' '), None], ['Roughness', rough_abbr + gloss_abbr, None], ['Normal', normal_abbr + bump_abbr, None], + ['Transmission', tags.transmission.split(' '), None], + ['Emission', tags.emission.split(' '), None], + ['Alpha', tags.alpha.split(' '), None], + ['Ambient Occlusion', tags.ambient_occlusion.split(' '), None], ] # Look through texture_types and set value as filename of first matched file @@ -3282,6 +3271,7 @@ class NWAddPrincipledSetup(Operator, NWBase, ImportHelper): print('\nMatched Textures:') texture_nodes = [] disp_texture = None + ao_texture = None normal_node = None roughness_node = None for i, sname in enumerate(socketnames): @@ -3298,7 +3288,8 @@ class NWAddPrincipledSetup(Operator, NWBase, ImportHelper): # Add displacement offset nodes disp_node = nodes.new(type='ShaderNodeDisplacement') - disp_node.location = active_node.location + Vector((0, -560)) + # Align the Displacement node under the active Principled BSDF node + disp_node.location = active_node.location + Vector((100, -700)) link = links.new(disp_node.inputs[0], disp_texture.outputs[0]) # TODO Turn on true displacement in the material @@ -3312,6 +3303,17 @@ class NWAddPrincipledSetup(Operator, NWBase, ImportHelper): continue + # AMBIENT OCCLUSION TEXTURE + if sname[0] == 'Ambient Occlusion': + ao_texture = nodes.new(type='ShaderNodeTexImage') + img = bpy.data.images.load(path.join(import_path, sname[2])) + ao_texture.image = img + ao_texture.label = sname[0] + if ao_texture.image: + ao_texture.image.colorspace_settings.is_data = True + + continue + if not active_node.inputs[sname[0]].is_linked: # No texture node connected -> add texture node with new image texture_node = nodes.new(type='ShaderNodeTexImage') @@ -3359,7 +3361,7 @@ class NWAddPrincipledSetup(Operator, NWBase, ImportHelper): link = links.new(active_node.inputs[sname[0]], texture_node.outputs[0]) # Use non-color for all but 'Base Color' Textures - if not sname[0] in ['Base Color'] and texture_node.image: + if not sname[0] in ['Base Color', 'Emission'] and texture_node.image: texture_node.image.colorspace_settings.is_data = True else: @@ -3373,6 +3375,10 @@ class NWAddPrincipledSetup(Operator, NWBase, ImportHelper): if disp_texture: texture_nodes.append(disp_texture) + if ao_texture: + # We want the ambient occlusion texture to be the top most texture node + texture_nodes.insert(0, ao_texture) + # Alignment for i, texture_node in enumerate(texture_nodes): offset = Vector((-550, (i * -280) + 200)) diff --git a/object_boolean_tools.py b/object_boolean_tools.py index 05a9cf23..faa93b12 100644 --- a/object_boolean_tools.py +++ b/object_boolean_tools.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/object_carver/__init__.py b/object_carver/__init__.py index 2ccda3e7..7c86c2fe 100644 --- a/object_carver/__init__.py +++ b/object_carver/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Carver", diff --git a/object_carver/carver_draw.py b/object_carver/carver_draw.py index f2a3aadc..c7000787 100644 --- a/object_carver/carver_draw.py +++ b/object_carver/carver_draw.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy import bgl import blf diff --git a/object_carver/carver_operator.py b/object_carver/carver_operator.py index 880f6491..4c64fdf0 100644 --- a/object_carver/carver_operator.py +++ b/object_carver/carver_operator.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy import bpy_extras import sys diff --git a/object_carver/carver_preferences.py b/object_carver/carver_preferences.py index 1e6bc7ab..873a814d 100644 --- a/object_carver/carver_preferences.py +++ b/object_carver/carver_preferences.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy from bpy.props import ( BoolProperty, diff --git a/object_carver/carver_profils.py b/object_carver/carver_profils.py index 9c99bf97..d786c280 100644 --- a/object_carver/carver_profils.py +++ b/object_carver/carver_profils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + from mathutils import ( Vector, ) diff --git a/object_carver/carver_utils.py b/object_carver/carver_utils.py index b026c1d1..0ac4c991 100644 --- a/object_carver/carver_utils.py +++ b/object_carver/carver_utils.py @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-or-later import bpy import bgl diff --git a/object_collection_manager/__init__.py b/object_collection_manager/__init__.py index 53004bac..2359b8df 100644 --- a/object_collection_manager/__init__.py +++ b/object_collection_manager/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Copyright 2011, Ryan Inch diff --git a/object_collection_manager/cm_init.py b/object_collection_manager/cm_init.py index a60747a8..39c7ede8 100644 --- a/object_collection_manager/cm_init.py +++ b/object_collection_manager/cm_init.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Copyright 2011, Ryan Inch diff --git a/object_collection_manager/internals.py b/object_collection_manager/internals.py index 1d159eca..c616645f 100644 --- a/object_collection_manager/internals.py +++ b/object_collection_manager/internals.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Copyright 2011, Ryan Inch diff --git a/object_collection_manager/operator_utils.py b/object_collection_manager/operator_utils.py index ec72fdb4..51b4385d 100644 --- a/object_collection_manager/operator_utils.py +++ b/object_collection_manager/operator_utils.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Copyright 2011, Ryan Inch import bpy diff --git a/object_collection_manager/operators.py b/object_collection_manager/operators.py index 55ca3a62..0b2b9cbf 100644 --- a/object_collection_manager/operators.py +++ b/object_collection_manager/operators.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Copyright 2011, Ryan Inch diff --git a/object_collection_manager/persistent_data.py b/object_collection_manager/persistent_data.py index 80399db5..5a7c2828 100644 --- a/object_collection_manager/persistent_data.py +++ b/object_collection_manager/persistent_data.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Copyright 2011, Ryan Inch diff --git a/object_collection_manager/preferences.py b/object_collection_manager/preferences.py index 53f4bacc..0b8a71c5 100644 --- a/object_collection_manager/preferences.py +++ b/object_collection_manager/preferences.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Copyright 2011, Ryan Inch diff --git a/object_collection_manager/qcd_init.py b/object_collection_manager/qcd_init.py index ed235a63..a9e392cc 100644 --- a/object_collection_manager/qcd_init.py +++ b/object_collection_manager/qcd_init.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Copyright 2011, Ryan Inch diff --git a/object_collection_manager/qcd_move_widget.py b/object_collection_manager/qcd_move_widget.py index 17add907..55da1453 100644 --- a/object_collection_manager/qcd_move_widget.py +++ b/object_collection_manager/qcd_move_widget.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Copyright 2011, Ryan Inch diff --git a/object_collection_manager/qcd_operators.py b/object_collection_manager/qcd_operators.py index 0fdf1045..be517fe1 100644 --- a/object_collection_manager/qcd_operators.py +++ b/object_collection_manager/qcd_operators.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Copyright 2011, Ryan Inch diff --git a/object_collection_manager/ui.py b/object_collection_manager/ui.py index ec2c7354..25987b25 100644 --- a/object_collection_manager/ui.py +++ b/object_collection_manager/ui.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # Copyright 2011, Ryan Inch diff --git a/object_color_rules.py b/object_color_rules.py index 1d60e295..52011366 100644 --- a/object_color_rules.py +++ b/object_color_rules.py @@ -1,20 +1,4 @@ -# ***** 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 LICENCE BLOCK ***** +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Object Color Rules", diff --git a/object_edit_linked.py b/object_edit_linked.py index 9299a575..f7177766 100644 --- a/object_edit_linked.py +++ b/object_edit_linked.py @@ -1,21 +1,4 @@ -# ***** 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 LICENCE BLOCK ***** +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Edit Linked Library", @@ -81,8 +64,6 @@ class OBJECT_OT_EditLinked(bpy.types.Operator): return settings["original_file"] == "" and context.active_object is not None and ( (context.active_object.instance_collection and context.active_object.instance_collection.library is not None) or - (context.active_object.proxy and - context.active_object.proxy.library is not None) or context.active_object.library is not None or (context.active_object.override_library and context.active_object.override_library.reference.library is not None)) @@ -96,10 +77,6 @@ class OBJECT_OT_EditLinked(bpy.types.Operator): elif target.library: targetpath = target.library.filepath settings["linked_objects"].append(target.name) - elif target.proxy: - target = target.proxy - targetpath = target.library.filepath - settings["linked_objects"].append(target.name) elif target.override_library: target = target.override_library.reference targetpath = target.library.filepath @@ -259,10 +236,7 @@ class VIEW3D_PT_PanelLinkedEdit(bpy.types.Panel): target = None - if context.active_object.proxy: - target = context.active_object.proxy - else: - target = context.active_object.instance_collection + target = context.active_object.instance_collection if settings["original_file"] == "" and ( (target and diff --git a/object_fracture_cell/__init__.py b/object_fracture_cell/__init__.py index ea4f0d2b..68d887a5 100644 --- a/object_fracture_cell/__init__.py +++ b/object_fracture_cell/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Cell Fracture", diff --git a/object_fracture_cell/fracture_cell_calc.py b/object_fracture_cell/fracture_cell_calc.py index 9e6f0de5..98bba36d 100644 --- a/object_fracture_cell/fracture_cell_calc.py +++ b/object_fracture_cell/fracture_cell_calc.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/object_fracture_cell/fracture_cell_setup.py b/object_fracture_cell/fracture_cell_setup.py index f083af2f..3720a171 100644 --- a/object_fracture_cell/fracture_cell_setup.py +++ b/object_fracture_cell/fracture_cell_setup.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/object_print3d_utils/__init__.py b/object_print3d_utils/__init__.py index 80ddb64e..3c5d4cf9 100644 --- a/object_print3d_utils/__init__.py +++ b/object_print3d_utils/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -58,6 +42,12 @@ else: class SceneProperties(PropertyGroup): + use_alignxy_face_area: BoolProperty( + name="Face Areas", + description="Normalize normals proportional to face areas", + default=False, + ) + export_format: EnumProperty( name="Format", description="Format type to export to", @@ -157,6 +147,7 @@ classes = ( operators.MESH_OT_print3d_select_report, operators.MESH_OT_print3d_scale_to_volume, operators.MESH_OT_print3d_scale_to_bounds, + operators.MESH_OT_print3d_align_to_xy, operators.MESH_OT_print3d_export, ) diff --git a/object_print3d_utils/export.py b/object_print3d_utils/export.py index 2f846aaf..a73b2fde 100644 --- a/object_print3d_utils/export.py +++ b/object_print3d_utils/export.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> diff --git a/object_print3d_utils/mesh_helpers.py b/object_print3d_utils/mesh_helpers.py index 948a3bc7..6ce5da50 100644 --- a/object_print3d_utils/mesh_helpers.py +++ b/object_print3d_utils/mesh_helpers.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> diff --git a/object_print3d_utils/operators.py b/object_print3d_utils/operators.py index afc7b83d..39142dde 100644 --- a/object_print3d_utils/operators.py +++ b/object_print3d_utils/operators.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> @@ -740,6 +724,74 @@ class MESH_OT_print3d_scale_to_bounds(Operator): return wm.invoke_props_dialog(self) +class MESH_OT_print3d_align_to_xy(Operator): + bl_idname = "mesh.print3d_align_to_xy" + bl_label = "Align (rotate) object to XY plane" + bl_description = ( + "Rotates entire object (not mesh) so the selected faces/vertices lie, on average, parallel to the XY plane " + "(it does not adjust Z location)" + ) + bl_options = {'REGISTER', 'UNDO'} + + def execute(self, context): + # FIXME: Undo is inconsistent. + # FIXME: Would be nicer if rotate could pick some object-local axis. + + from mathutils import Vector + + print_3d = context.scene.print_3d + face_areas = print_3d.use_alignxy_face_area + + self.context = context + mode_orig = context.mode + skip_invalid = [] + + for obj in context.selected_objects: + orig_loc = obj.location.copy() + orig_scale = obj.scale.copy() + + # When in edit mode, do as the edit mode does. + if mode_orig == 'EDIT_MESH': + bm = bmesh.from_edit_mesh(obj.data) + faces = [f for f in bm.faces if f.select] + else: + faces = [p for p in obj.data.polygons if p.select] + + if not faces: + skip_invalid.append(obj.name) + continue + + # Rotate object so average normal of selected faces points down. + normal = Vector((0.0, 0.0, 0.0)) + if face_areas: + for face in faces: + normal += (face.normal * face.calc_area()) + else: + for face in faces: + normal += face.normal + normal = normal.normalized() + normal.rotate(obj.matrix_world) # local -> world. + offset = normal.rotation_difference(Vector((0.0, 0.0, -1.0))) + offset = offset.to_matrix().to_4x4() + obj.matrix_world = offset @ obj.matrix_world + obj.scale = orig_scale + obj.location = orig_loc + + if len(skip_invalid) > 0: + for name in skip_invalid: + print(f"Align to XY: Skipping object {name}. No faces selected.") + if len(skip_invalid) == 1: + self.report({'WARNING'}, "Skipping object. No faces selected" % skip_invalid[0]) + else: + self.report({'WARNING'}, "Skipping some objects. No faces selected. See terminal") + return {'FINISHED'} + + def invoke(self, context, event): + if context.mode not in {'EDIT_MESH', 'OBJECT'}: + return {'CANCELLED'} + return self.execute(context) + + # ------ # Export diff --git a/object_print3d_utils/report.py b/object_print3d_utils/report.py index 511c5e42..633b65c7 100644 --- a/object_print3d_utils/report.py +++ b/object_print3d_utils/report.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> diff --git a/object_print3d_utils/ui.py b/object_print3d_utils/ui.py index 6a0f6d6f..e000544c 100644 --- a/object_print3d_utils/ui.py +++ b/object_print3d_utils/ui.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8-80 compliant> @@ -125,10 +109,15 @@ class VIEW3D_PT_print3d_transform(View3DPrintPanel, Panel): def draw(self, context): layout = self.layout + print_3d = context.scene.print_3d + layout.label(text="Scale To") row = layout.row(align=True) row.operator("mesh.print3d_scale_to_volume", text="Volume") row.operator("mesh.print3d_scale_to_bounds", text="Bounds") + row = layout.row(align=True) + row.operator("mesh.print3d_align_to_xy", text="Align XY") + row.prop(print_3d, "use_alignxy_face_area") class VIEW3D_PT_print3d_export(View3DPrintPanel, Panel): diff --git a/object_scatter/__init__.py b/object_scatter/__init__.py index ecf634d4..12bc8ca0 100644 --- a/object_scatter/__init__.py +++ b/object_scatter/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Scatter Objects", diff --git a/object_scatter/operator.py b/object_scatter/operator.py index c1cf0e13..07bf3884 100644 --- a/object_scatter/operator.py +++ b/object_scatter/operator.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy import gpu diff --git a/object_scatter/ui.py b/object_scatter/ui.py index 1bf1acd9..52752607 100644 --- a/object_scatter/ui.py +++ b/object_scatter/ui.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy import math diff --git a/object_skinify.py b/object_skinify.py index f102d8cf..e8f57b41 100644 --- a/object_skinify.py +++ b/object_skinify.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Skinify Rig", diff --git a/paint_palette.py b/paint_palette.py index 10b8fe31..789ab562 100644 --- a/paint_palette.py +++ b/paint_palette.py @@ -1,23 +1,5 @@ -# paint_palette.py (c) 2011 Dany Lebel (Axon_D) - -# ##### 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 ##### - +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright 2011 Dany Lebel (Axon_D) bl_info = { "name": "Paint Palettes", diff --git a/pose_library/__init__.py b/pose_library/__init__.py index a1820cf0..33ca777f 100644 --- a/pose_library/__init__.py +++ b/pose_library/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later """ Pose Library based on the Asset Browser. diff --git a/pose_library/asset_browser.py b/pose_library/asset_browser.py index a95e48fe..d4662284 100644 --- a/pose_library/asset_browser.py +++ b/pose_library/asset_browser.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + """Functions for finding and working with Asset Browsers.""" from typing import Iterable, Optional, Tuple diff --git a/pose_library/conversion.py b/pose_library/conversion.py index 43a5d3a4..8955eb6d 100644 --- a/pose_library/conversion.py +++ b/pose_library/conversion.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later """ Pose Library - Conversion of old pose libraries. diff --git a/pose_library/functions.py b/pose_library/functions.py index d2e210a7..d9a85fd7 100644 --- a/pose_library/functions.py +++ b/pose_library/functions.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later """ Pose Library - functions. diff --git a/pose_library/gui.py b/pose_library/gui.py index c31d8ca1..364ec07e 100644 --- a/pose_library/gui.py +++ b/pose_library/gui.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later """ Pose Library - GUI definition. diff --git a/pose_library/keymaps.py b/pose_library/keymaps.py index 87ccf572..72fb3ce6 100644 --- a/pose_library/keymaps.py +++ b/pose_library/keymaps.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later from typing import List, Tuple diff --git a/pose_library/operators.py b/pose_library/operators.py index 49e3b50b..1e8a1b5c 100644 --- a/pose_library/operators.py +++ b/pose_library/operators.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later """ Pose Library - operators. diff --git a/pose_library/pose_creation.py b/pose_library/pose_creation.py index b2fbb4dd..0b1d086f 100644 --- a/pose_library/pose_creation.py +++ b/pose_library/pose_creation.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later """ Pose Library - creation functions. diff --git a/pose_library/pose_usage.py b/pose_library/pose_usage.py index dc496d9c..45a39e4d 100644 --- a/pose_library/pose_usage.py +++ b/pose_library/pose_usage.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later """ Pose Library - usage functions. @@ -22,6 +6,7 @@ Pose Library - usage functions. from typing import Set import re +import bpy from bpy.types import ( Action, @@ -48,7 +33,7 @@ def select_bones(arm_object: Object, action: Action, *, select: bool, flipped: b seen_bone_names.add(bone_name) if flipped: - bone_name = flip_side_name(bone_name) + bone_name = bpy.utils.flip_name(bone_name) try: pose_bone = pose.bones[bone_name] @@ -58,127 +43,6 @@ def select_bones(arm_object: Object, action: Action, *, select: bool, flipped: b pose_bone.bone.select = select -_FLIP_SEPARATORS = set(". -_") - -# These are single-character replacements, others are handled differently. -_FLIP_REPLACEMENTS = { - "l": "r", - "L": "R", - "r": "l", - "R": "L", -} - - -def flip_side_name(to_flip: str) -> str: - """Flip left and right indicators in the name. - - Basically a Python implementation of BLI_string_flip_side_name. - - >>> flip_side_name('bone_L.004') - 'bone_R.004' - >>> flip_side_name('left_bone') - 'right_bone' - >>> flip_side_name('Left_bone') - 'Right_bone' - >>> flip_side_name('LEFT_bone') - 'RIGHT_bone' - >>> flip_side_name('some.bone-RIGHT.004') - 'some.bone-LEFT.004' - >>> flip_side_name('some.bone-right.004') - 'some.bone-left.004' - >>> flip_side_name('some.bone-Right.004') - 'some.bone-Left.004' - >>> flip_side_name('some.bone-LEFT.004') - 'some.bone-RIGHT.004' - >>> flip_side_name('some.bone-left.004') - 'some.bone-right.004' - >>> flip_side_name('some.bone-Left.004') - 'some.bone-Right.004' - >>> flip_side_name('.004') - '.004' - >>> flip_side_name('L.004') - 'R.004' - """ - import string - - if len(to_flip) < 3: - # we don't flip names like .R or .L - return to_flip - - # We first check the case with a .### extension, let's find the last period. - number = "" - replace = to_flip - if to_flip[-1] in string.digits: - try: - index = to_flip.rindex(".") - except ValueError: - pass - else: - if to_flip[index + 1] in string.digits: - # TODO(Sybren): this doesn't handle "bone.1abc2" correctly. - number = to_flip[index:] - replace = to_flip[:index] - - if not replace: - # Nothing left after the number, so no flips necessary. - return replace + number - - if len(replace) == 1: - replace = _FLIP_REPLACEMENTS.get(replace, replace) - return replace + number - - # First case; separator . - _ with extensions r R l L. - if replace[-2] in _FLIP_SEPARATORS and replace[-1] in _FLIP_REPLACEMENTS: - replace = replace[:-1] + _FLIP_REPLACEMENTS[replace[-1]] - return replace + number - - # Second case; beginning with r R l L, with separator after it. - if replace[1] in _FLIP_SEPARATORS and replace[0] in _FLIP_REPLACEMENTS: - replace = _FLIP_REPLACEMENTS[replace[0]] + replace[1:] - return replace + number - - lower = replace.lower() - prefix = suffix = "" - if lower.startswith("right"): - bit = replace[0:2] - if bit == "Ri": - prefix = "Left" - elif bit == "RI": - prefix = "LEFT" - else: - prefix = "left" - replace = replace[5:] - elif lower.startswith("left"): - bit = replace[0:2] - if bit == "Le": - prefix = "Right" - elif bit == "LE": - prefix = "RIGHT" - else: - prefix = "right" - replace = replace[4:] - elif lower.endswith("right"): - bit = replace[-5:-3] - if bit == "Ri": - suffix = "Left" - elif bit == "RI": - suffix = "LEFT" - else: - suffix = "left" - replace = replace[:-5] - elif lower.endswith("left"): - bit = replace[-4:-2] - if bit == "Le": - suffix = "Right" - elif bit == "LE": - suffix = "RIGHT" - else: - suffix = "right" - replace = replace[:-4] - - return prefix + replace + suffix + number - - if __name__ == '__main__': import doctest diff --git a/power_sequencer/__init__.py b/power_sequencer/__init__.py index 8d2c84db..c646da7c 100755 --- a/power_sequencer/__init__.py +++ b/power_sequencer/__init__.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + from typing import List, Tuple, Type import bpy diff --git a/power_sequencer/addon_preferences.py b/power_sequencer/addon_preferences.py index 014f63dd..4220e89c 100644 --- a/power_sequencer/addon_preferences.py +++ b/power_sequencer/addon_preferences.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + """ Add-on preferences and interface in the Blender preferences window. """ diff --git a/power_sequencer/addon_properties.py b/power_sequencer/addon_properties.py index 45c5bc20..575a3954 100644 --- a/power_sequencer/addon_properties.py +++ b/power_sequencer/addon_properties.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy diff --git a/power_sequencer/handlers.py b/power_sequencer/handlers.py index b960662f..d9c107da 100644 --- a/power_sequencer/handlers.py +++ b/power_sequencer/handlers.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from bpy.app.handlers import persistent diff --git a/power_sequencer/operators/__init__.py b/power_sequencer/operators/__init__.py index 406c8635..b1222a18 100755 --- a/power_sequencer/operators/__init__.py +++ b/power_sequencer/operators/__init__.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import importlib import os diff --git a/power_sequencer/operators/channel_offset.py b/power_sequencer/operators/channel_offset.py index 48305c4b..b7569afa 100644 --- a/power_sequencer/operators/channel_offset.py +++ b/power_sequencer/operators/channel_offset.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + from operator import attrgetter import bpy diff --git a/power_sequencer/operators/concatenate_strips.py b/power_sequencer/operators/concatenate_strips.py index d9119124..32f5f59b 100644 --- a/power_sequencer/operators/concatenate_strips.py +++ b/power_sequencer/operators/concatenate_strips.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from operator import attrgetter diff --git a/power_sequencer/operators/copy_selected_sequences.py b/power_sequencer/operators/copy_selected_sequences.py index e7bc7384..643ecb33 100644 --- a/power_sequencer/operators/copy_selected_sequences.py +++ b/power_sequencer/operators/copy_selected_sequences.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from operator import attrgetter diff --git a/power_sequencer/operators/crossfade_add.py b/power_sequencer/operators/crossfade_add.py index d4ffbe02..73644c80 100644 --- a/power_sequencer/operators/crossfade_add.py +++ b/power_sequencer/operators/crossfade_add.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.functions import find_sequences_after diff --git a/power_sequencer/operators/crossfade_edit.py b/power_sequencer/operators/crossfade_edit.py index dd5ff822..0e330e10 100644 --- a/power_sequencer/operators/crossfade_edit.py +++ b/power_sequencer/operators/crossfade_edit.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.global_settings import SequenceTypes diff --git a/power_sequencer/operators/cut_strips_under_cursor.py b/power_sequencer/operators/cut_strips_under_cursor.py index 3b54a17b..4a66a782 100644 --- a/power_sequencer/operators/cut_strips_under_cursor.py +++ b/power_sequencer/operators/cut_strips_under_cursor.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/delete_direct.py b/power_sequencer/operators/delete_direct.py index 4c6e4d2d..bda5face 100644 --- a/power_sequencer/operators/delete_direct.py +++ b/power_sequencer/operators/delete_direct.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.functions import get_mouse_frame_and_channel diff --git a/power_sequencer/operators/deselect_all_left_or_right.py b/power_sequencer/operators/deselect_all_left_or_right.py index e3c5b888..6769d173 100644 --- a/power_sequencer/operators/deselect_all_left_or_right.py +++ b/power_sequencer/operators/deselect_all_left_or_right.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/deselect_handles_and_grab.py b/power_sequencer/operators/deselect_handles_and_grab.py index 20bfd426..468baf8b 100644 --- a/power_sequencer/operators/deselect_handles_and_grab.py +++ b/power_sequencer/operators/deselect_handles_and_grab.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/duplicate_move.py b/power_sequencer/operators/duplicate_move.py index 6d13b1d0..32c62a56 100644 --- a/power_sequencer/operators/duplicate_move.py +++ b/power_sequencer/operators/duplicate_move.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.functions import get_mouse_frame_and_channel diff --git a/power_sequencer/operators/expand_to_surrounding_cuts.py b/power_sequencer/operators/expand_to_surrounding_cuts.py index 53de8bf7..7129e42d 100644 --- a/power_sequencer/operators/expand_to_surrounding_cuts.py +++ b/power_sequencer/operators/expand_to_surrounding_cuts.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.functions import slice_selection diff --git a/power_sequencer/operators/fade_add.py b/power_sequencer/operators/fade_add.py index 11ef5b3c..39fe18a9 100644 --- a/power_sequencer/operators/fade_add.py +++ b/power_sequencer/operators/fade_add.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from mathutils import Vector from math import floor diff --git a/power_sequencer/operators/fade_clear.py b/power_sequencer/operators/fade_clear.py index 02516633..c74b27cf 100644 --- a/power_sequencer/operators/fade_clear.py +++ b/power_sequencer/operators/fade_clear.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/gap_remove.py b/power_sequencer/operators/gap_remove.py index 825bfc0d..7f2ec5ae 100644 --- a/power_sequencer/operators/gap_remove.py +++ b/power_sequencer/operators/gap_remove.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from operator import attrgetter diff --git a/power_sequencer/operators/grab.py b/power_sequencer/operators/grab.py index 036a1493..de53d2a4 100644 --- a/power_sequencer/operators/grab.py +++ b/power_sequencer/operators/grab.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.functions import get_mouse_frame_and_channel diff --git a/power_sequencer/operators/grab_closest_handle_or_cut.py b/power_sequencer/operators/grab_closest_handle_or_cut.py index d9cc3681..55440b95 100644 --- a/power_sequencer/operators/grab_closest_handle_or_cut.py +++ b/power_sequencer/operators/grab_closest_handle_or_cut.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + """ Selects and grabs the strip handle or cut closest to the mouse cursor. Hover near a cut and use this operator to slide it. diff --git a/power_sequencer/operators/grab_sequence_handles.py b/power_sequencer/operators/grab_sequence_handles.py index 7780b4d2..ecbe8c4b 100644 --- a/power_sequencer/operators/grab_sequence_handles.py +++ b/power_sequencer/operators/grab_sequence_handles.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.global_settings import SequenceTypes diff --git a/power_sequencer/operators/import_local_footage.py b/power_sequencer/operators/import_local_footage.py index 1b3a7ea6..8612210a 100644 --- a/power_sequencer/operators/import_local_footage.py +++ b/power_sequencer/operators/import_local_footage.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import json import os import re diff --git a/power_sequencer/operators/jump_time_offset.py b/power_sequencer/operators/jump_time_offset.py index 1249c7c8..ee9b1f9b 100644 --- a/power_sequencer/operators/jump_time_offset.py +++ b/power_sequencer/operators/jump_time_offset.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.functions import convert_duration_to_frames diff --git a/power_sequencer/operators/jump_to_cut.py b/power_sequencer/operators/jump_to_cut.py index aff4a01c..add0dab9 100644 --- a/power_sequencer/operators/jump_to_cut.py +++ b/power_sequencer/operators/jump_to_cut.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from operator import attrgetter diff --git a/power_sequencer/operators/make_hold_frame.py b/power_sequencer/operators/make_hold_frame.py index 22c2eecf..4c1f110d 100644 --- a/power_sequencer/operators/make_hold_frame.py +++ b/power_sequencer/operators/make_hold_frame.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy import operator diff --git a/power_sequencer/operators/marker_delete_closest.py b/power_sequencer/operators/marker_delete_closest.py index 6c71759f..a4756958 100644 --- a/power_sequencer/operators/marker_delete_closest.py +++ b/power_sequencer/operators/marker_delete_closest.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/marker_delete_direct.py b/power_sequencer/operators/marker_delete_direct.py index 5ebbbd74..efc8ba66 100644 --- a/power_sequencer/operators/marker_delete_direct.py +++ b/power_sequencer/operators/marker_delete_direct.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/marker_snap_to_cursor.py b/power_sequencer/operators/marker_snap_to_cursor.py index 0320454a..dbb3a6c7 100644 --- a/power_sequencer/operators/marker_snap_to_cursor.py +++ b/power_sequencer/operators/marker_snap_to_cursor.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/markers_as_timecodes.py b/power_sequencer/operators/markers_as_timecodes.py index 020bdfdd..52658838 100644 --- a/power_sequencer/operators/markers_as_timecodes.py +++ b/power_sequencer/operators/markers_as_timecodes.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy import datetime as dt diff --git a/power_sequencer/operators/markers_create_from_selected.py b/power_sequencer/operators/markers_create_from_selected.py index b826a8c1..bd346d84 100644 --- a/power_sequencer/operators/markers_create_from_selected.py +++ b/power_sequencer/operators/markers_create_from_selected.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/markers_set_preview_in_between.py b/power_sequencer/operators/markers_set_preview_in_between.py index 3d4ee5a2..60724312 100644 --- a/power_sequencer/operators/markers_set_preview_in_between.py +++ b/power_sequencer/operators/markers_set_preview_in_between.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.functions import find_neighboring_markers diff --git a/power_sequencer/operators/markers_snap_matching_strips.py b/power_sequencer/operators/markers_snap_matching_strips.py index 0487880e..da475eeb 100644 --- a/power_sequencer/operators/markers_snap_matching_strips.py +++ b/power_sequencer/operators/markers_snap_matching_strips.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/meta_resize_to_content.py b/power_sequencer/operators/meta_resize_to_content.py index b75c20cb..ed54ebca 100644 --- a/power_sequencer/operators/meta_resize_to_content.py +++ b/power_sequencer/operators/meta_resize_to_content.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.functions import get_frame_range diff --git a/power_sequencer/operators/meta_trim_content_to_bounds.py b/power_sequencer/operators/meta_trim_content_to_bounds.py index af101235..11b48369 100644 --- a/power_sequencer/operators/meta_trim_content_to_bounds.py +++ b/power_sequencer/operators/meta_trim_content_to_bounds.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.global_settings import SequenceTypes diff --git a/power_sequencer/operators/meta_ungroup_and_trim.py b/power_sequencer/operators/meta_ungroup_and_trim.py index ffcd2711..00c79cf4 100644 --- a/power_sequencer/operators/meta_ungroup_and_trim.py +++ b/power_sequencer/operators/meta_ungroup_and_trim.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/mouse_toggle_mute.py b/power_sequencer/operators/mouse_toggle_mute.py index 3b0ab96b..362b2e9d 100644 --- a/power_sequencer/operators/mouse_toggle_mute.py +++ b/power_sequencer/operators/mouse_toggle_mute.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + """Toggle mute a sequence as you click on it""" import bpy from math import floor diff --git a/power_sequencer/operators/mouse_trim_instantly.py b/power_sequencer/operators/mouse_trim_instantly.py index 849b23e5..332053fc 100644 --- a/power_sequencer/operators/mouse_trim_instantly.py +++ b/power_sequencer/operators/mouse_trim_instantly.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from math import floor diff --git a/power_sequencer/operators/mouse_trim_modal.py b/power_sequencer/operators/mouse_trim_modal.py index a6b69812..a138933b 100644 --- a/power_sequencer/operators/mouse_trim_modal.py +++ b/power_sequencer/operators/mouse_trim_modal.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy import bgl import gpu diff --git a/power_sequencer/operators/open_project_directory.py b/power_sequencer/operators/open_project_directory.py index 8c721051..f32f2ac2 100644 --- a/power_sequencer/operators/open_project_directory.py +++ b/power_sequencer/operators/open_project_directory.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy import os from platform import system diff --git a/power_sequencer/operators/playback_speed_decrease.py b/power_sequencer/operators/playback_speed_decrease.py index a6799927..a856ac4b 100644 --- a/power_sequencer/operators/playback_speed_decrease.py +++ b/power_sequencer/operators/playback_speed_decrease.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/playback_speed_increase.py b/power_sequencer/operators/playback_speed_increase.py index f03d9cea..7c2f2ad2 100644 --- a/power_sequencer/operators/playback_speed_increase.py +++ b/power_sequencer/operators/playback_speed_increase.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/playback_speed_set.py b/power_sequencer/operators/playback_speed_set.py index af1737c6..9f576247 100644 --- a/power_sequencer/operators/playback_speed_set.py +++ b/power_sequencer/operators/playback_speed_set.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/preview_closest_cut.py b/power_sequencer/operators/preview_closest_cut.py index ec1af0d2..312be788 100644 --- a/power_sequencer/operators/preview_closest_cut.py +++ b/power_sequencer/operators/preview_closest_cut.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.functions import get_frame_range diff --git a/power_sequencer/operators/preview_to_selection.py b/power_sequencer/operators/preview_to_selection.py index 956da506..ea6c0ed7 100644 --- a/power_sequencer/operators/preview_to_selection.py +++ b/power_sequencer/operators/preview_to_selection.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.functions import get_frame_range diff --git a/power_sequencer/operators/render_apply_preset.py b/power_sequencer/operators/render_apply_preset.py index 670d637a..dc3b0ed1 100644 --- a/power_sequencer/operators/render_apply_preset.py +++ b/power_sequencer/operators/render_apply_preset.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy import os diff --git a/power_sequencer/operators/render_presets/twitter_720p.py b/power_sequencer/operators/render_presets/twitter_720p.py index 47f235c4..109090cc 100644 --- a/power_sequencer/operators/render_presets/twitter_720p.py +++ b/power_sequencer/operators/render_presets/twitter_720p.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + if __name__ == "__main__": import bpy diff --git a/power_sequencer/operators/render_presets/youtube_1080.py b/power_sequencer/operators/render_presets/youtube_1080.py index 343e7081..5bf6e826 100644 --- a/power_sequencer/operators/render_presets/youtube_1080.py +++ b/power_sequencer/operators/render_presets/youtube_1080.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + if __name__ == "__main__": import bpy diff --git a/power_sequencer/operators/ripple_delete.py b/power_sequencer/operators/ripple_delete.py index 929e468f..939da4e0 100644 --- a/power_sequencer/operators/ripple_delete.py +++ b/power_sequencer/operators/ripple_delete.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_brief, doc_description, doc_idname, doc_name diff --git a/power_sequencer/operators/save_direct.py b/power_sequencer/operators/save_direct.py index cd181f2d..f41c3d4f 100644 --- a/power_sequencer/operators/save_direct.py +++ b/power_sequencer/operators/save_direct.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/scene_create_from_selection.py b/power_sequencer/operators/scene_create_from_selection.py index cd774d0d..206e385a 100644 --- a/power_sequencer/operators/scene_create_from_selection.py +++ b/power_sequencer/operators/scene_create_from_selection.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from operator import attrgetter diff --git a/power_sequencer/operators/scene_cycle.py b/power_sequencer/operators/scene_cycle.py index cedbd4d6..1be39ab9 100644 --- a/power_sequencer/operators/scene_cycle.py +++ b/power_sequencer/operators/scene_cycle.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/scene_merge_from.py b/power_sequencer/operators/scene_merge_from.py index 5c3f40b0..b411e039 100644 --- a/power_sequencer/operators/scene_merge_from.py +++ b/power_sequencer/operators/scene_merge_from.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/scene_open_from_strip.py b/power_sequencer/operators/scene_open_from_strip.py index db512a9d..0b992356 100644 --- a/power_sequencer/operators/scene_open_from_strip.py +++ b/power_sequencer/operators/scene_open_from_strip.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/scene_rename_with_strip.py b/power_sequencer/operators/scene_rename_with_strip.py index 91ca8204..8bc6432f 100644 --- a/power_sequencer/operators/scene_rename_with_strip.py +++ b/power_sequencer/operators/scene_rename_with_strip.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/select_all_left_or_right.py b/power_sequencer/operators/select_all_left_or_right.py index 01e35306..7d9087ee 100644 --- a/power_sequencer/operators/select_all_left_or_right.py +++ b/power_sequencer/operators/select_all_left_or_right.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/select_closest_to_mouse.py b/power_sequencer/operators/select_closest_to_mouse.py index 8a8b8bc6..f14bc309 100644 --- a/power_sequencer/operators/select_closest_to_mouse.py +++ b/power_sequencer/operators/select_closest_to_mouse.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.functions import find_strips_mouse diff --git a/power_sequencer/operators/select_linked_effect.py b/power_sequencer/operators/select_linked_effect.py index 8a863062..a63096f1 100644 --- a/power_sequencer/operators/select_linked_effect.py +++ b/power_sequencer/operators/select_linked_effect.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.functions import find_linked diff --git a/power_sequencer/operators/select_linked_strips.py b/power_sequencer/operators/select_linked_strips.py index f6d77bbb..5716d13d 100644 --- a/power_sequencer/operators/select_linked_strips.py +++ b/power_sequencer/operators/select_linked_strips.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/select_related_strips.py b/power_sequencer/operators/select_related_strips.py index 3accb616..0e442ebd 100644 --- a/power_sequencer/operators/select_related_strips.py +++ b/power_sequencer/operators/select_related_strips.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.global_settings import SequenceTypes diff --git a/power_sequencer/operators/select_strips_under_cursor.py b/power_sequencer/operators/select_strips_under_cursor.py index 0cc13c32..a47d6e80 100644 --- a/power_sequencer/operators/select_strips_under_cursor.py +++ b/power_sequencer/operators/select_strips_under_cursor.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.functions import get_sequences_under_cursor diff --git a/power_sequencer/operators/set_timeline_range.py b/power_sequencer/operators/set_timeline_range.py index 4b652bb1..65a90f4d 100644 --- a/power_sequencer/operators/set_timeline_range.py +++ b/power_sequencer/operators/set_timeline_range.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/snap.py b/power_sequencer/operators/snap.py index 13d5e66e..793f5bd9 100644 --- a/power_sequencer/operators/snap.py +++ b/power_sequencer/operators/snap.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.functions import get_sequences_under_cursor diff --git a/power_sequencer/operators/snap_selection.py b/power_sequencer/operators/snap_selection.py index eb2851b5..38da4c17 100644 --- a/power_sequencer/operators/snap_selection.py +++ b/power_sequencer/operators/snap_selection.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.functions import get_sequences_under_cursor, move_selection from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/space_sequences.py b/power_sequencer/operators/space_sequences.py index 519c2218..ddb28dfe 100644 --- a/power_sequencer/operators/space_sequences.py +++ b/power_sequencer/operators/space_sequences.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.functions import convert_duration_to_frames diff --git a/power_sequencer/operators/speed_remove_effect.py b/power_sequencer/operators/speed_remove_effect.py index 2d835fb2..ae2a4d35 100644 --- a/power_sequencer/operators/speed_remove_effect.py +++ b/power_sequencer/operators/speed_remove_effect.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/speed_up_movie_strip.py b/power_sequencer/operators/speed_up_movie_strip.py index daa68b2b..c004e2fc 100644 --- a/power_sequencer/operators/speed_up_movie_strip.py +++ b/power_sequencer/operators/speed_up_movie_strip.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from math import ceil diff --git a/power_sequencer/operators/swap_strips.py b/power_sequencer/operators/swap_strips.py index 00c45107..44537c43 100644 --- a/power_sequencer/operators/swap_strips.py +++ b/power_sequencer/operators/swap_strips.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from operator import attrgetter diff --git a/power_sequencer/operators/toggle_selected_mute.py b/power_sequencer/operators/toggle_selected_mute.py index 362a9bd4..3ee1a022 100644 --- a/power_sequencer/operators/toggle_selected_mute.py +++ b/power_sequencer/operators/toggle_selected_mute.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_name, doc_idname, doc_brief, doc_description diff --git a/power_sequencer/operators/toggle_waveforms.py b/power_sequencer/operators/toggle_waveforms.py index 9dac9179..3e064182 100644 --- a/power_sequencer/operators/toggle_waveforms.py +++ b/power_sequencer/operators/toggle_waveforms.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.global_settings import SequenceTypes diff --git a/power_sequencer/operators/transitions_remove.py b/power_sequencer/operators/transitions_remove.py index 8aa9f55f..d1db0d74 100644 --- a/power_sequencer/operators/transitions_remove.py +++ b/power_sequencer/operators/transitions_remove.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from operator import attrgetter diff --git a/power_sequencer/operators/trim_left_or_right_handles.py b/power_sequencer/operators/trim_left_or_right_handles.py index bbbb8bd5..aea81610 100644 --- a/power_sequencer/operators/trim_left_or_right_handles.py +++ b/power_sequencer/operators/trim_left_or_right_handles.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + from operator import attrgetter import bpy diff --git a/power_sequencer/operators/trim_three_point_edit.py b/power_sequencer/operators/trim_three_point_edit.py index c10ffc42..f174589e 100644 --- a/power_sequencer/operators/trim_three_point_edit.py +++ b/power_sequencer/operators/trim_three_point_edit.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.functions import get_mouse_frame_and_channel diff --git a/power_sequencer/operators/trim_to_surrounding_cuts.py b/power_sequencer/operators/trim_to_surrounding_cuts.py index 15982393..ab5df939 100644 --- a/power_sequencer/operators/trim_to_surrounding_cuts.py +++ b/power_sequencer/operators/trim_to_surrounding_cuts.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + """ Find the two closest cuts, trims and deletes all strips above in the range but leaves some margin. Removes the newly formed gap. diff --git a/power_sequencer/operators/utils/__init__.py b/power_sequencer/operators/utils/__init__.py index 34d53626..71fca8c4 100644 --- a/power_sequencer/operators/utils/__init__.py +++ b/power_sequencer/operators/utils/__init__.py @@ -1,16 +1,4 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# diff --git a/power_sequencer/operators/utils/doc.py b/power_sequencer/operators/utils/doc.py index 84ec923c..8bdae410 100644 --- a/power_sequencer/operators/utils/doc.py +++ b/power_sequencer/operators/utils/doc.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + """ Utilities to convert operator names and docstrings to human-readable text. Used to generate names for Blender's operator search, and to generate Power Sequencer's documentation. diff --git a/power_sequencer/operators/utils/draw.py b/power_sequencer/operators/utils/draw.py index 6c13e27f..5a156bea 100644 --- a/power_sequencer/operators/utils/draw.py +++ b/power_sequencer/operators/utils/draw.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + """Drawing utilities. A list of functions to draw common elements""" # import bgl import blf diff --git a/power_sequencer/operators/utils/functions.py b/power_sequencer/operators/utils/functions.py index 021dfd54..0d5c9fcf 100644 --- a/power_sequencer/operators/utils/functions.py +++ b/power_sequencer/operators/utils/functions.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + from math import floor, sqrt from operator import attrgetter diff --git a/power_sequencer/operators/utils/global_settings.py b/power_sequencer/operators/utils/global_settings.py index 34ffd369..a5c9756b 100644 --- a/power_sequencer/operators/utils/global_settings.py +++ b/power_sequencer/operators/utils/global_settings.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + class ProjectSettings: RESOLUTION_X = 1920 RESOLUTION_Y = 1080 diff --git a/power_sequencer/operators/utils/info_progress_bar.py b/power_sequencer/operators/utils/info_progress_bar.py index 8e679d72..e645c762 100644 --- a/power_sequencer/operators/utils/info_progress_bar.py +++ b/power_sequencer/operators/utils/info_progress_bar.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy diff --git a/power_sequencer/operators/value_offset.py b/power_sequencer/operators/value_offset.py index e876a1bd..919e8a43 100644 --- a/power_sequencer/operators/value_offset.py +++ b/power_sequencer/operators/value_offset.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .utils.doc import doc_brief, doc_description, doc_idname, doc_name diff --git a/power_sequencer/tools/__init__.py b/power_sequencer/tools/__init__.py index 463c3762..e7ac0ddc 100644 --- a/power_sequencer/tools/__init__.py +++ b/power_sequencer/tools/__init__.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import importlib import os diff --git a/power_sequencer/tools/trim.py b/power_sequencer/tools/trim.py index e6a54437..9c60b2d0 100644 --- a/power_sequencer/tools/trim.py +++ b/power_sequencer/tools/trim.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from bpy.types import WorkSpaceTool diff --git a/power_sequencer/ui/__init__.py b/power_sequencer/ui/__init__.py index 7cabf4fa..9b5b5c6b 100644 --- a/power_sequencer/ui/__init__.py +++ b/power_sequencer/ui/__init__.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from .menu_contextual import POWER_SEQUENCER_MT_contextual from .menu_toolbar import ( diff --git a/power_sequencer/ui/menu_contextual.py b/power_sequencer/ui/menu_contextual.py index 632821c2..41628448 100644 --- a/power_sequencer/ui/menu_contextual.py +++ b/power_sequencer/ui/menu_contextual.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy from ..operators.utils.global_settings import SequenceTypes diff --git a/power_sequencer/ui/menu_toolbar.py b/power_sequencer/ui/menu_toolbar.py index a00e26ec..4feb1ea7 100755 --- a/power_sequencer/ui/menu_toolbar.py +++ b/power_sequencer/ui/menu_toolbar.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy diff --git a/power_sequencer/utils/addon_auto_imports.py b/power_sequencer/utils/addon_auto_imports.py index a1dea3a8..47f430b9 100644 --- a/power_sequencer/utils/addon_auto_imports.py +++ b/power_sequencer/utils/addon_auto_imports.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import pkgutil import importlib diff --git a/power_sequencer/utils/register_shortcuts.py b/power_sequencer/utils/register_shortcuts.py index beb75778..f928f7ff 100644 --- a/power_sequencer/utils/register_shortcuts.py +++ b/power_sequencer/utils/register_shortcuts.py @@ -1,19 +1,8 @@ -# -# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors -# +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors + # This file is part of Power Sequencer. -# -# Power Sequencer 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 3 of the -# License, or (at your option) any later version. -# -# Power Sequencer 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 Power Sequencer. If -# not, see <https://www.gnu.org/licenses/>. -# + import bpy import operator as op from .. import operators diff --git a/precision_drawing_tools/pdt_command_functions.py b/precision_drawing_tools/pdt_command_functions.py index 6ae88baf..5224bbca 100644 --- a/precision_drawing_tools/pdt_command_functions.py +++ b/precision_drawing_tools/pdt_command_functions.py @@ -522,7 +522,7 @@ def set_angle_distance_two(context): Note: Uses 2 Selected Vertices to set pg.angle and pg.distance scene variables also sets delta offset from these 2 points using standard Numpy Routines - Works in Edit and Oject Modes. + Works in Edit and Object Modes. Args: context: Blender bpy.context instance. @@ -603,7 +603,7 @@ def set_angle_distance_three(context): Note: Uses 3 Selected Vertices to set pg.angle and pg.distance scene variables also sets delta offset from these 3 points using standard Numpy Routines - Works in Edit and Oject Modes. + Works in Edit and Object Modes. Args: context: Blender bpy.context instance. diff --git a/precision_drawing_tools/pdt_design.py b/precision_drawing_tools/pdt_design.py index ddb7fb38..7b6b65ad 100644 --- a/precision_drawing_tools/pdt_design.py +++ b/precision_drawing_tools/pdt_design.py @@ -658,7 +658,7 @@ class PDT_OT_Angle2(Operator): Note: Uses 2 Selected Vertices to set pg.angle and pg.distance scene variables also sets delta offset from these 2 points using standard Numpy Routines - Works in Edit and Oject Modes. + Works in Edit and Object Modes. Args: context: Blender bpy.context instance. @@ -685,7 +685,7 @@ class PDT_OT_Angle3(Operator): Note: Uses 3 Selected Vertices to set pg.angle and pg.distance scene variables also sets delta offset from these 3 points using standard Numpy Routines - Works in Edit and Oject Modes. + Works in Edit and Object Modes. Args: context: Blender bpy.context instance. diff --git a/presets/interface_theme/Deep_Grey.xml b/presets/interface_theme/Deep_Grey.xml index dc89b2ce..85be3a98 100644 --- a/presets/interface_theme/Deep_Grey.xml +++ b/presets/interface_theme/Deep_Grey.xml @@ -9,6 +9,7 @@ widget_emboss="#ffffff00" editor_outline="#303030" widget_text_cursor="#d9d9d9" + panel_roundness="0.4" transparent_checker_primary="#333333" transparent_checker_secondary="#262626" transparent_checker_size="8" @@ -305,7 +306,7 @@ outline="#202020" inner="#3f3f3f00" inner_sel="#c85130ff" - item="#ffffffff" + item="#333333ff" text="#b8b8b8" text_sel="#d9d9d9" show_shaded="FALSE" @@ -463,7 +464,7 @@ </view_3d> <graph_editor> <ThemeGraphEditor - grid="#303030" + grid="#383838" frame_current="#4c9933" time_scrub_background="#333333e6" time_marker_line="#b8b8b880" @@ -943,18 +944,19 @@ node_active="#ffaa18" wire="#808080" wire_inner="#808080" - wire_select="#ffffff" + wire_select="#ffffffb3" selected_text="#909090" - node_backdrop="#585858ff" + node_backdrop="#474747ff" converter_node="#7f8080" color_node="#4c5975" - group_node="#3a582cb9" + group_node="#3a582c" group_socket_node="#353b47" frame_node="#50505080" matte_node="#0076b6" distor_node="#292929" noodle_curving="2" - grid_levels="2" + grid_levels="3" + dash_alpha="0.5" input_node="#3471ae" output_node="#cc6666" filter_node="#0076b6" @@ -964,7 +966,7 @@ script_node="#141414" pattern_node="#008db6" layout_node="#3c3c3c" - geometry_node="#00d7a4" + geometry_node="#009975" attribute_node="#3f5980" > <space> @@ -1324,14 +1326,14 @@ <ThemeSpaceGeneric back="#474747" title="#ffffff" - text="#c3c3c3" + text="#b8b8b8" text_hi="#ffffff" header="#454545ff" - header_text="#eeeeee" + header_text="#b8b8b8" header_text_hi="#ffffff" button="#424242ff" button_title="#ffffff" - button_text="#e5e5e5" + button_text="#b8b8b8" button_text_hi="#ffffff" navigation_bar="#00000000" execution_buts="#00000000" @@ -1350,6 +1352,15 @@ </panelcolors> </ThemeSpaceGeneric> </space> + <space_list> + <ThemeSpaceListGeneric + list="#303030" + list_title="#c3c3c3" + list_text="#b8b8b8" + list_text_hi="#ffaf23" + > + </ThemeSpaceListGeneric> + </space_list> </ThemeSpreadsheet> </spreadsheet> <bone_color_sets> @@ -1528,6 +1539,44 @@ > </ThemeCollectionColor> </collection_color> + <strip_color> + <ThemeStripColor + color="#e2605b" + > + </ThemeStripColor> + <ThemeStripColor + color="#f1a355" + > + </ThemeStripColor> + <ThemeStripColor + color="#f1dc55" + > + </ThemeStripColor> + <ThemeStripColor + color="#7bcc7b" + > + </ThemeStripColor> + <ThemeStripColor + color="#5db6ea" + > + </ThemeStripColor> + <ThemeStripColor + color="#8d59da" + > + </ThemeStripColor> + <ThemeStripColor + color="#c673b8" + > + </ThemeStripColor> + <ThemeStripColor + color="#7a5441" + > + </ThemeStripColor> + <ThemeStripColor + color="#5f5f5f" + > + </ThemeStripColor> + </strip_color> </Theme> <ThemeStyle> <panel_title> diff --git a/presets/interface_theme/Maya.xml b/presets/interface_theme/Maya.xml index 35470fa1..ddfef7b0 100644 --- a/presets/interface_theme/Maya.xml +++ b/presets/interface_theme/Maya.xml @@ -947,7 +947,7 @@ matte_node="#975b5b" distor_node="#749797" noodle_curving="6" - grid_levels="2" + grid_levels="3" input_node="#e64555" output_node="#b33641" filter_node="#584d80" diff --git a/presets/interface_theme/Minimal_Dark.xml b/presets/interface_theme/Minimal_Dark.xml index 6f4b5fa9..269a016e 100644 --- a/presets/interface_theme/Minimal_Dark.xml +++ b/presets/interface_theme/Minimal_Dark.xml @@ -955,7 +955,7 @@ matte_node="#404040" distor_node="#404040" noodle_curving="5" - grid_levels="7" + grid_levels="3" dash_alpha="0.5" input_node="#404040" output_node="#404040" diff --git a/presets/interface_theme/Print_Friendly.xml b/presets/interface_theme/Print_Friendly.xml index 3d71d8b6..66e3c70b 100755 --- a/presets/interface_theme/Print_Friendly.xml +++ b/presets/interface_theme/Print_Friendly.xml @@ -955,7 +955,7 @@ matte_node="#977474"
distor_node="#749797"
noodle_curving="0"
- grid_levels="2"
+ grid_levels="3"
input_node="#ff6675"
output_node="#ff6675"
filter_node="#6c696f"
diff --git a/presets/interface_theme/White.xml b/presets/interface_theme/White.xml index 24cf9bc6..5d84f109 100755 --- a/presets/interface_theme/White.xml +++ b/presets/interface_theme/White.xml @@ -948,7 +948,7 @@ matte_node="#975b5b"
distor_node="#c5ffff"
noodle_curving="3"
- grid_levels="2"
+ grid_levels="3"
input_node="#ff4e5d"
output_node="#0081ff"
filter_node="#b09bff"
diff --git a/presets/interface_theme/XSI.xml b/presets/interface_theme/XSI.xml index 69cb2f6a..a1bd9d13 100644 --- a/presets/interface_theme/XSI.xml +++ b/presets/interface_theme/XSI.xml @@ -948,7 +948,7 @@ matte_node="#79f2a0" distor_node="#eef279" noodle_curving="0" - grid_levels="2" + grid_levels="3" input_node="#ee8513" output_node="#ff8b00" filter_node="#ff0000" diff --git a/presets/operator/mesh.bolt_add/default.py b/presets/operator/mesh.bolt_add/_default.py index 4bd250aa..4bd250aa 100644 --- a/presets/operator/mesh.bolt_add/default.py +++ b/presets/operator/mesh.bolt_add/_default.py diff --git a/presets/operator/mesh.bolt_add/m3.py b/presets/operator/mesh.bolt_add/_m3.py index 4bd250aa..4bd250aa 100644 --- a/presets/operator/mesh.bolt_add/m3.py +++ b/presets/operator/mesh.bolt_add/_m3.py diff --git a/presets/operator/mesh.bolt_add/m4.py b/presets/operator/mesh.bolt_add/_m4.py index b5595d00..b5595d00 100644 --- a/presets/operator/mesh.bolt_add/m4.py +++ b/presets/operator/mesh.bolt_add/_m4.py diff --git a/presets/operator/mesh.bolt_add/m5.py b/presets/operator/mesh.bolt_add/_m5.py index d4485119..d4485119 100644 --- a/presets/operator/mesh.bolt_add/m5.py +++ b/presets/operator/mesh.bolt_add/_m5.py diff --git a/presets/operator/mesh.bolt_add/m6.py b/presets/operator/mesh.bolt_add/_m6.py index 01a8408d..01a8408d 100644 --- a/presets/operator/mesh.bolt_add/m6.py +++ b/presets/operator/mesh.bolt_add/_m6.py diff --git a/presets/operator/mesh.bolt_add/m8.py b/presets/operator/mesh.bolt_add/_m8.py index a7493131..a7493131 100644 --- a/presets/operator/mesh.bolt_add/m8.py +++ b/presets/operator/mesh.bolt_add/_m8.py diff --git a/real_snow.py b/real_snow.py index ba4f3c7d..a61268db 100644 --- a/real_snow.py +++ b/real_snow.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Real Snow", diff --git a/render_copy_settings/__init__.py b/render_copy_settings/__init__.py index ee445e71..8ef62d3f 100644 --- a/render_copy_settings/__init__.py +++ b/render_copy_settings/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/render_copy_settings/data.py b/render_copy_settings/data.py index 59b91fcc..f517a20d 100644 --- a/render_copy_settings/data.py +++ b/render_copy_settings/data.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/render_copy_settings/operator.py b/render_copy_settings/operator.py index 5de9bc3d..d097a35b 100644 --- a/render_copy_settings/operator.py +++ b/render_copy_settings/operator.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/render_copy_settings/panel.py b/render_copy_settings/panel.py index 1e79bef7..e5dcd4b6 100644 --- a/render_copy_settings/panel.py +++ b/render_copy_settings/panel.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/render_copy_settings/presets.py b/render_copy_settings/presets.py index 0fc53e39..e94cf880 100644 --- a/render_copy_settings/presets.py +++ b/render_copy_settings/presets.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/render_copy_settings/translations.py b/render_copy_settings/translations.py index f3b94a81..f7126694 100644 --- a/render_copy_settings/translations.py +++ b/render_copy_settings/translations.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/render_freestyle_svg.py b/render_freestyle_svg.py index cb27ae64..4d49a125 100644 --- a/render_freestyle_svg.py +++ b/render_freestyle_svg.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/render_povray/__init__.py b/render_povray/__init__.py index 47291895..3d5e5315 100755 --- a/render_povray/__init__.py +++ b/render_povray/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/render_povray/base_ui.py b/render_povray/base_ui.py index e0bbd929..5ecf53b6 100755 --- a/render_povray/base_ui.py +++ b/render_povray/base_ui.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -71,9 +55,9 @@ def pov_centric_moray_like_workspace(dummy): # we put all within a Try... Except AttributeErrors ? Any better solution ? # Should it simply not run when opening existing file? be a preferences operator to create # Moray like workspace - + available_workspaces = bpy.data.workspaces - + if all(tabs in available_workspaces for tabs in ['POV-Mo', 'POV-Ed']): print("\nPOV-Mo and POV-Ed tabs respectively provide GUI and TEXT\n" "oriented POV workspaces akin to Moray and POVWIN") diff --git a/render_povray/df3_library.py b/render_povray/df3_library.py index b5525741..02497595 100755 --- a/render_povray/df3_library.py +++ b/render_povray/df3_library.py @@ -1,24 +1,10 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright 2005 Mike Kost <contact@povray.tashcorp.net> + ################################################################################ # # df3.py # -# Copyright (C) 2005 Mike Kost <contact@povray.tashcorp.net> -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library 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 -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# -# # ----------------------------------------------------------------------------- # # Creation functions diff --git a/render_povray/object_curve_topology.py b/render_povray/object_curve_topology.py index 1b30c618..2be6c3de 100755 --- a/render_povray/object_curve_topology.py +++ b/render_povray/object_curve_topology.py @@ -1,20 +1,4 @@ -# ***** 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 #**** +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/render_povray/object_gui.py b/render_povray/object_gui.py index ffedb650..2033a0d4 100755 --- a/render_povray/object_gui.py +++ b/render_povray/object_gui.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> """User interface for the POV tools""" diff --git a/render_povray/object_mesh_topology.py b/render_povray/object_mesh_topology.py index e991070c..cad028a1 100755 --- a/render_povray/object_mesh_topology.py +++ b/render_povray/object_mesh_topology.py @@ -1,20 +1,4 @@ -# ***** 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 #**** +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/render_povray/object_particles.py b/render_povray/object_particles.py index 215a6f15..66477485 100755 --- a/render_povray/object_particles.py +++ b/render_povray/object_particles.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> """Get some Blender particle objects translated to POV.""" diff --git a/render_povray/object_primitives.py b/render_povray/object_primitives.py index d906f665..d017c4d0 100755 --- a/render_povray/object_primitives.py +++ b/render_povray/object_primitives.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -872,7 +856,7 @@ def pov_sphere_define(context, op, ob, loc): """create the representation of POV sphere using a Blender icosphere. Its nice platonic solid curvature better represents pov rendertime - tesselation than a UV sphere""" + tessellation than a UV sphere""" if op: R = op.R diff --git a/render_povray/object_properties.py b/render_povray/object_properties.py index 752df203..ed02f1d2 100755 --- a/render_povray/object_properties.py +++ b/render_povray/object_properties.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> """Declare object level properties controllable in UI and translated to POV""" diff --git a/render_povray/render.py b/render_povray/render.py index 929e6e01..0f7da3c6 100755 --- a/render_povray/render.py +++ b/render_povray/render.py @@ -1,20 +1,4 @@ -# ***** 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 #**** +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -511,36 +495,36 @@ def write_pov(filename, scene=None, info_callback=None): ''' meta = ob.data - + # important because no elements will break parsing. elements = [elem for elem in meta.elements if elem.type in {'BALL', 'ELLIPSOID'}] - + if elements: tab_write("blob {\n") tab_write("threshold %.4g\n" % meta.threshold) importance = ob.pov.importance_value - + try: material = meta.materials[0] # lame! - blender cant do enything else. except: material = None - + for elem in elements: loc = elem.co - + stiffness = elem.stiffness if elem.use_negative: stiffness = - stiffness - + if elem.type == 'BALL': - + tab_write("sphere { <%.6g, %.6g, %.6g>, %.4g, %.4g }\n" % (loc.x, loc.y, loc.z, elem.radius, stiffness)) - + # After this wecould do something simple like... # "pigment {Blue} }" # except we'll write the color - + elif elem.type == 'ELLIPSOID': # location is modified by scale tab_write("sphere { <%.6g, %.6g, %.6g>, %.4g, %.4g }\n" % @@ -550,7 +534,7 @@ def write_pov(filename, scene=None, info_callback=None): elem.radius, stiffness)) tab_write("scale <%.6g, %.6g, %.6g> \n" % (elem.size_x, elem.size_y, elem.size_z)) - + if material: diffuse_color = material.diffuse_color trans = 1.0 - material.pov.alpha @@ -559,30 +543,30 @@ def write_pov(filename, scene=None, info_callback=None): trans = (1.0 - material.pov.alpha) - pov_filter else: pov_filter = 0.0 - + material_finish = material_names_dictionary[material.name] - + tab_write("pigment {srgbft<%.3g, %.3g, %.3g, %.3g, %.3g>} \n" % (diffuse_color[0], diffuse_color[1], diffuse_color[2], pov_filter, trans)) tab_write("finish {%s}\n" % safety(material_finish, ref_level_bound=2)) - + else: tab_write("pigment {srgb 1} \n") # Write the finish last. tab_write("finish {%s}\n" % (safety(DEF_MAT_NAME, ref_level_bound=2))) - + write_object_material_interior(material, elems[1]) - + write_matrix(global_matrix @ ob.matrix_world) # Importance for radiosity sampling added here tab_write("radiosity { \n") # importance > ob.pov.importance_value tab_write("importance %3g \n" % importance) tab_write("}\n") - + tab_write("}\n") # End of Metaball block - + if comments and len(metas) >= 1: file.write("\n") ''' diff --git a/render_povray/render_gui.py b/render_povray/render_gui.py index ce842f04..cc3dcf23 100755 --- a/render_povray/render_gui.py +++ b/render_povray/render_gui.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/render_povray/render_properties.py b/render_povray/render_properties.py index 3b9c81ef..339d1301 100755 --- a/render_povray/render_properties.py +++ b/render_povray/render_properties.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> """Declare rendering properties controllable in UI""" diff --git a/render_povray/scenography.py b/render_povray/scenography.py index ff08b017..e744b266 100755 --- a/render_povray/scenography.py +++ b/render_povray/scenography.py @@ -1,20 +1,4 @@ -# ***** 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 #**** +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/render_povray/scenography_gui.py b/render_povray/scenography_gui.py index e66931b2..4adc4ade 100755 --- a/render_povray/scenography_gui.py +++ b/render_povray/scenography_gui.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/render_povray/scenography_properties.py b/render_povray/scenography_properties.py index bdad0890..7b75bbbb 100755 --- a/render_povray/scenography_properties.py +++ b/render_povray/scenography_properties.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> """Declare stage set and surrounding (camera, lights, environment) properties controllable in UI""" diff --git a/render_povray/scripting.py b/render_povray/scripting.py index 5f7a2b6e..698dbb5f 100755 --- a/render_povray/scripting.py +++ b/render_povray/scripting.py @@ -1,20 +1,4 @@ -# ***** 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 #**** +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -153,7 +137,8 @@ class ImportPOV(bpy.types.Operator, ImportHelper): for file in self.files: print("Importing file: " + file.name) file_pov = self.directory + file.name - for line in open(file_pov): + # Ignore any non unicode character + for line in open(file_pov, encoding='utf-8', errors='ignore'): string = line.replace("{", " ") string = string.replace("}", " ") string = string.replace("<", " ") @@ -184,7 +169,7 @@ class ImportPOV(bpy.types.Operator, ImportHelper): ] matrixes[index] = value write_matrix = False - for line in open(file_pov): + for line in open(file_pov, encoding='utf-8', errors='ignore'): S = line.replace("{", " { ") S = S.replace("}", " } ") S = S.replace(",", " ") @@ -194,7 +179,7 @@ class ImportPOV(bpy.types.Operator, ImportHelper): S = S.replace(";", " ; ") S = S.split() # lenS = len(S) # Not used... why written? - for word in enumerate(S): + for word in S: # -------- Primitives Import -------- # if word == 'cone': cone_search = True diff --git a/render_povray/scripting_gui.py b/render_povray/scripting_gui.py index 60774f29..0ca2d949 100755 --- a/render_povray/scripting_gui.py +++ b/render_povray/scripting_gui.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> """User interface to POV Scene Description Language snippets or full includes: @@ -138,7 +122,7 @@ class TEXT_MT_POV_insert(Menu): prop = self.layout.operator("wm.path_open", text="Open folder", icon='FILE_FOLDER') prop.filepath = pov_documents self.layout.separator() - + # todo: structure submenus by dir pov_insert_items_list = [root for root, dirs, files in os.walk(pov_documents)] print(pov_insert_items_list) diff --git a/render_povray/scripting_properties.py b/render_povray/scripting_properties.py index f0e61244..59c37381 100755 --- a/render_povray/scripting_properties.py +++ b/render_povray/scripting_properties.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/render_povray/shading.py b/render_povray/shading.py index c0eb3925..67ee8e51 100755 --- a/render_povray/shading.py +++ b/render_povray/shading.py @@ -1,20 +1,4 @@ -# ***** 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 #**** +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/render_povray/shading_gui.py b/render_povray/shading_gui.py index 3bb0782c..0eb9e5f0 100755 --- a/render_povray/shading_gui.py +++ b/render_povray/shading_gui.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> """"User interface for shaders exported to POV textures.""" diff --git a/render_povray/shading_nodes.py b/render_povray/shading_nodes.py index 55d323e3..fef5d381 100755 --- a/render_povray/shading_nodes.py +++ b/render_povray/shading_nodes.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> """"Nodes based User interface for shaders exported to POV textures.""" diff --git a/render_povray/shading_properties.py b/render_povray/shading_properties.py index 9add125e..bcc8944d 100755 --- a/render_povray/shading_properties.py +++ b/render_povray/shading_properties.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> """Declare shading properties exported to POV textures.""" diff --git a/render_povray/texturing.py b/render_povray/texturing.py index 060316be..dadc5e5c 100755 --- a/render_povray/texturing.py +++ b/render_povray/texturing.py @@ -1,20 +1,4 @@ -# ***** 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 #**** +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/render_povray/texturing_gui.py b/render_povray/texturing_gui.py index 2e317a6c..007eda24 100755 --- a/render_povray/texturing_gui.py +++ b/render_povray/texturing_gui.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/render_povray/texturing_properties.py b/render_povray/texturing_properties.py index c085cedf..fbfb8125 100755 --- a/render_povray/texturing_properties.py +++ b/render_povray/texturing_properties.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/render_povray/update_files.py b/render_povray/update_files.py index 0082ff83..cc736a98 100755 --- a/render_povray/update_files.py +++ b/render_povray/update_files.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/render_ui_animation_render.py b/render_ui_animation_render.py index 27d84a4a..e8a6d39f 100644 --- a/render_ui_animation_render.py +++ b/render_ui_animation_render.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy diff --git a/rigify/__init__.py b/rigify/__init__.py index 50922528..4f31459b 100644 --- a/rigify/__init__.py +++ b/rigify/__init__.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -154,7 +138,7 @@ class RigifyFeatureSets(bpy.types.PropertyGroup): context.preferences.addons[__package__].preferences.update_external_rigs() enabled: bpy.props.BoolProperty( - name = "Enabled", + name = "Enabled", description = "Whether this feature-set is registered or not", update = toggle_featureset, default = True @@ -193,7 +177,7 @@ class RigifyPreferences(AddonPreferences): module_names = feature_set_list.get_installed_modules_names() - # If there is a feature set preferences entry with no corresponding + # If there is a feature set preferences entry with no corresponding # installed module, user must've manually removed it from the filesystem, # so let's remove such entries. to_delete = [ i for i, fs in enumerate(feature_set_prefs) if fs.module_name not in module_names ] diff --git a/rigify/base_generate.py b/rigify/base_generate.py index 7bdb8b0e..81de462a 100644 --- a/rigify/base_generate.py +++ b/rigify/base_generate.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/base_rig.py b/rigify/base_rig.py index 87c89c17..b1c911cb 100644 --- a/rigify/base_rig.py +++ b/rigify/base_rig.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/feature_set_list.py b/rigify/feature_set_list.py index cb46f5c6..819b2c0e 100644 --- a/rigify/feature_set_list.py +++ b/rigify/feature_set_list.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later from typing import List diff --git a/rigify/feature_sets/__init__.py b/rigify/feature_sets/__init__.py index e9981d52..91f1cdf7 100644 --- a/rigify/feature_sets/__init__.py +++ b/rigify/feature_sets/__init__.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # Redirect the module loader to the user scripts directory. diff --git a/rigify/generate.py b/rigify/generate.py index a674ade4..0d99b708 100644 --- a/rigify/generate.py +++ b/rigify/generate.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -146,7 +130,7 @@ class Generator(base_generate.BaseGenerator): if old_collection: # Rename the collection old_collection.name = wgts_group_name - + return old_collection def ensure_widget_collection(self): diff --git a/rigify/metarig_menu.py b/rigify/metarig_menu.py index 7a48df44..f6dda026 100644 --- a/rigify/metarig_menu.py +++ b/rigify/metarig_menu.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/metarigs/Animals/bird.py b/rigify/metarigs/Animals/bird.py index eee6b38b..e1897202 100644 --- a/rigify/metarigs/Animals/bird.py +++ b/rigify/metarigs/Animals/bird.py @@ -1,5 +1,6 @@ -import bpy +# SPDX-License-Identifier: GPL-2.0-or-later +import bpy from mathutils import Color @@ -788,7 +789,7 @@ def create(obj): except AttributeError: pass pbone = obj.pose.bones[bones['thigh.L']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -800,6 +801,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -808,7 +813,7 @@ def create(obj): except AttributeError: pass pbone = obj.pose.bones[bones['thigh.R']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -820,6 +825,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass diff --git a/rigify/metarigs/Animals/cat.py b/rigify/metarigs/Animals/cat.py index 66321116..a6fd40ab 100644 --- a/rigify/metarigs/Animals/cat.py +++ b/rigify/metarigs/Animals/cat.py @@ -1,5 +1,6 @@ -import bpy +# SPDX-License-Identifier: GPL-2.0-or-later +import bpy from mathutils import Color @@ -1485,7 +1486,7 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] pbone = obj.pose.bones[bones['thigh.L']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.rear_paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -1497,6 +1498,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -1509,7 +1514,7 @@ def create(obj): except AttributeError: pass pbone = obj.pose.bones[bones['thigh.R']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.rear_paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -1521,6 +1526,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -1653,7 +1662,7 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] pbone = obj.pose.bones[bones['upper_arm.L']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.front_paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -1665,6 +1674,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -1673,7 +1686,7 @@ def create(obj): except AttributeError: pass pbone = obj.pose.bones[bones['upper_arm.R']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.front_paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -1689,6 +1702,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.limb_type = "paw" except AttributeError: pass diff --git a/rigify/metarigs/Animals/horse.py b/rigify/metarigs/Animals/horse.py index 1cdd4feb..cd393c5c 100644 --- a/rigify/metarigs/Animals/horse.py +++ b/rigify/metarigs/Animals/horse.py @@ -1,5 +1,6 @@ -import bpy +# SPDX-License-Identifier: GPL-2.0-or-later +import bpy from mathutils import Color @@ -805,6 +806,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.bbones = 10 except AttributeError: pass @@ -837,6 +842,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.bbones = 10 except AttributeError: pass @@ -1005,6 +1014,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -1029,6 +1042,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass diff --git a/rigify/metarigs/Animals/shark.py b/rigify/metarigs/Animals/shark.py index 8b72a965..6559fb4a 100644 --- a/rigify/metarigs/Animals/shark.py +++ b/rigify/metarigs/Animals/shark.py @@ -1,5 +1,6 @@ -import bpy +# SPDX-License-Identifier: GPL-2.0-or-later +import bpy from mathutils import Color diff --git a/rigify/metarigs/Animals/wolf.py b/rigify/metarigs/Animals/wolf.py index 775f2973..a2ade910 100644 --- a/rigify/metarigs/Animals/wolf.py +++ b/rigify/metarigs/Animals/wolf.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy @@ -1609,6 +1611,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -1636,6 +1642,10 @@ def create(obj): pbone.rigify_parameters.limb_type = "paw" except AttributeError: pass + try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass pbone = obj.pose.bones[bones['spine.001']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) @@ -1801,6 +1811,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -1821,6 +1835,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass diff --git a/rigify/metarigs/Basic/basic_human.py b/rigify/metarigs/Basic/basic_human.py index 1c584325..57b2d236 100644 --- a/rigify/metarigs/Basic/basic_human.py +++ b/rigify/metarigs/Basic/basic_human.py @@ -1,5 +1,6 @@ -import bpy +# SPDX-License-Identifier: GPL-2.0-or-later +import bpy from mathutils import Color @@ -434,6 +435,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -465,6 +470,10 @@ def create(obj): pbone.rigify_parameters.extra_ik_toe = True except AttributeError: pass + try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass pbone = obj.pose.bones[bones['spine.002']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) @@ -626,6 +635,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_layers = [False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -642,6 +655,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_layers = [False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass diff --git a/rigify/metarigs/Basic/basic_quadruped.py b/rigify/metarigs/Basic/basic_quadruped.py index 5282df25..5575e8c4 100644 --- a/rigify/metarigs/Basic/basic_quadruped.py +++ b/rigify/metarigs/Basic/basic_quadruped.py @@ -1,5 +1,6 @@ -import bpy +# SPDX-License-Identifier: GPL-2.0-or-later +import bpy from mathutils import Color @@ -505,7 +506,7 @@ def create(obj): except AttributeError: pass pbone = obj.pose.bones[bones['thigh.L']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.rear_paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -517,6 +518,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -525,7 +530,7 @@ def create(obj): except AttributeError: pass pbone = obj.pose.bones[bones['thigh.R']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.rear_paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -544,6 +549,10 @@ def create(obj): pbone.rigify_parameters.limb_type = "paw" except AttributeError: pass + try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass pbone = obj.pose.bones[bones['spine.007']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) @@ -681,7 +690,7 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] pbone = obj.pose.bones[bones['front_thigh.L']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.front_paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -693,6 +702,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -701,7 +714,7 @@ def create(obj): except AttributeError: pass pbone = obj.pose.bones[bones['front_thigh.R']] - pbone.rigify_type = 'limbs.super_limb' + pbone.rigify_type = 'limbs.front_paw' pbone.lock_location = (False, False, False) pbone.lock_rotation = (False, False, False) pbone.lock_rotation_w = False @@ -713,6 +726,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass diff --git a/rigify/metarigs/human.py b/rigify/metarigs/human.py index 5ff61677..75a089ab 100644 --- a/rigify/metarigs/human.py +++ b/rigify/metarigs/human.py @@ -1,5 +1,6 @@ -import bpy +# SPDX-License-Identifier: GPL-2.0-or-later +import bpy from mathutils import Color @@ -1344,6 +1345,10 @@ def create(obj): except AttributeError: pass try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -1375,6 +1380,10 @@ def create(obj): pbone.rigify_parameters.extra_ik_toe = True except AttributeError: pass + try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass pbone = obj.pose.bones[bones['spine.002']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) @@ -1536,6 +1545,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_layers = [False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -1552,6 +1565,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_layers = [False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass @@ -1988,6 +2005,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass @@ -2004,6 +2025,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass @@ -2020,6 +2045,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass @@ -2036,6 +2065,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass @@ -2052,6 +2085,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass @@ -2068,6 +2105,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass @@ -2084,6 +2125,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass @@ -2100,6 +2145,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass @@ -2116,6 +2165,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass @@ -2132,6 +2185,10 @@ def create(obj): pbone.rotation_mode = 'QUATERNION' pbone.bone.layers = [False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass + try: pbone.rigify_parameters.tweak_extra_layers = True except AttributeError: pass diff --git a/rigify/operators/__init__.py b/rigify/operators/__init__.py index 6c96f908..bda38619 100644 --- a/rigify/operators/__init__.py +++ b/rigify/operators/__init__.py @@ -1,20 +1,4 @@ -# ====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/operators/copy_mirror_parameters.py b/rigify/operators/copy_mirror_parameters.py index a844f8da..982887b2 100644 --- a/rigify/operators/copy_mirror_parameters.py +++ b/rigify/operators/copy_mirror_parameters.py @@ -1,20 +1,4 @@ -# ====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/operators/upgrade_face.py b/rigify/operators/upgrade_face.py index 1dc3cf2c..17953802 100644 --- a/rigify/operators/upgrade_face.py +++ b/rigify/operators/upgrade_face.py @@ -1,20 +1,4 @@ -# ====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -435,7 +419,7 @@ class POSE_OT_rigify_upgrade_face(bpy.types.Operator): @classmethod def poll(cls, context): obj = context.object - return obj and obj.type == 'ARMATURE' and obj.mode in {'POSE', 'OBJECT'} and find_face_bone(obj) + return obj and obj.type == 'ARMATURE' and find_face_bone(obj) def invoke(self, context, event): return context.window_manager.invoke_confirm(self, event) diff --git a/rigify/rig_lists.py b/rigify/rig_lists.py index ae7d9d00..1526d488 100644 --- a/rigify/rig_lists.py +++ b/rigify/rig_lists.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later import os import traceback diff --git a/rigify/rig_ui_template.py b/rigify/rig_ui_template.py index 528a732c..f3bc5374 100644 --- a/rigify/rig_ui_template.py +++ b/rigify/rig_ui_template.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/basic/copy_chain.py b/rigify/rigs/basic/copy_chain.py index 54f09ad7..cd2de206 100644 --- a/rigify/rigs/basic/copy_chain.py +++ b/rigify/rigs/basic/copy_chain.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/basic/pivot.py b/rigify/rigs/basic/pivot.py index 0301790f..e10bf4e2 100644 --- a/rigify/rigs/basic/pivot.py +++ b/rigify/rigs/basic/pivot.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/basic/raw_copy.py b/rigify/rigs/basic/raw_copy.py index e562038c..8aa593aa 100644 --- a/rigify/rigs/basic/raw_copy.py +++ b/rigify/rigs/basic/raw_copy.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/basic/super_copy.py b/rigify/rigs/basic/super_copy.py index e2f70842..e43993b4 100644 --- a/rigify/rigs/basic/super_copy.py +++ b/rigify/rigs/basic/super_copy.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/chain_rigs.py b/rigify/rigs/chain_rigs.py index 96bf8abd..9a96faa0 100644 --- a/rigify/rigs/chain_rigs.py +++ b/rigify/rigs/chain_rigs.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/experimental/super_chain.py b/rigify/rigs/experimental/super_chain.py index c0a0f09e..8a51a938 100644 --- a/rigify/rigs/experimental/super_chain.py +++ b/rigify/rigs/experimental/super_chain.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy from mathutils import Vector from ...utils import copy_bone, put_bone, org, align_bone_y_axis, align_bone_x_axis, align_bone_z_axis diff --git a/rigify/rigs/face/basic_tongue.py b/rigify/rigs/face/basic_tongue.py index 380e14df..005fe551 100644 --- a/rigify/rigs/face/basic_tongue.py +++ b/rigify/rigs/face/basic_tongue.py @@ -1,20 +1,4 @@ -# ====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/face/skin_eye.py b/rigify/rigs/face/skin_eye.py index 16b05b4b..4955df6b 100644 --- a/rigify/rigs/face/skin_eye.py +++ b/rigify/rigs/face/skin_eye.py @@ -1,20 +1,4 @@ -# ====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -609,6 +593,8 @@ class EyeClusterControl(RigComponent): def parent_bones(self): if self.rig_count > 1: + self.get_bone(self.master_bone).use_local_location = False + for child in self.child_bones: self.set_bone_parent(child, self.master_bone) diff --git a/rigify/rigs/face/skin_jaw.py b/rigify/rigs/face/skin_jaw.py index 6829818c..fdcd904f 100644 --- a/rigify/rigs/face/skin_jaw.py +++ b/rigify/rigs/face/skin_jaw.py @@ -1,20 +1,4 @@ -# ====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/faces/super_face.py b/rigify/rigs/faces/super_face.py index 32d013a7..4d062aaf 100644 --- a/rigify/rigs/faces/super_face.py +++ b/rigify/rigs/faces/super_face.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy, re from mathutils import Vector from ...utils import copy_bone, flip_bone diff --git a/rigify/rigs/limbs/arm.py b/rigify/rigs/limbs/arm.py index e276407e..e2563faf 100644 --- a/rigify/rigs/limbs/arm.py +++ b/rigify/rigs/limbs/arm.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -180,6 +164,10 @@ def create_sample(obj, limb=False): pbone.rigify_parameters.fk_layers = [False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False] except AttributeError: pass + try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass pbone = obj.pose.bones[bones['forearm.L']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) diff --git a/rigify/rigs/limbs/front_paw.py b/rigify/rigs/limbs/front_paw.py index 30582d60..3c192a75 100644 --- a/rigify/rigs/limbs/front_paw.py +++ b/rigify/rigs/limbs/front_paw.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/limbs/leg.py b/rigify/rigs/limbs/leg.py index 59d48993..05c606ef 100644 --- a/rigify/rigs/limbs/leg.py +++ b/rigify/rigs/limbs/leg.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -477,6 +461,10 @@ def create_sample(obj): pbone.rigify_parameters.extra_ik_toe = True except AttributeError: pass + try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass pbone = obj.pose.bones[bones['shin.L']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) diff --git a/rigify/rigs/limbs/limb_rigs.py b/rigify/rigs/limbs/limb_rigs.py index 7ecc508f..b72e9d40 100644 --- a/rigify/rigs/limbs/limb_rigs.py +++ b/rigify/rigs/limbs/limb_rigs.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -448,6 +432,12 @@ class BaseLimbRig(BaseRig): else: self.set_bone_parent(self.bones.ctrl.ik_base, self.bones.mch.ik_swing) + self.set_ik_local_location(self.bones.ctrl.ik) + self.set_ik_local_location(self.bones.ctrl.ik_pole) + + def set_ik_local_location(self, ctrl): + self.get_bone(ctrl).use_local_location = self.params.ik_local_location + @stage.configure_bones def configure_ik_controls(self): base = self.get_bone(self.bones.ctrl.ik_base) @@ -943,6 +933,12 @@ class BaseLimbRig(BaseRig): description = "Create a rotation pivot control that can be repositioned arbitrarily" ) + params.ik_local_location = bpy.props.BoolProperty( + name = "IK Local Location", + default = True, + description = "Specifies the value of the Local Location option for IK controls, which decides if the location channels are aligned to the local control orientation or world", + ) + # Setting up extra layers for the FK and tweak ControlLayersOption.FK.add_parameters(params) ControlLayersOption.TWEAK.add_parameters(params) @@ -965,6 +961,7 @@ class BaseLimbRig(BaseRig): r.prop(params, "bbones") layout.prop(params, 'make_custom_pivot', text="Custom IK Pivot") + layout.prop(params, 'ik_local_location') ControlLayersOption.FK.parameters_ui(layout, params) ControlLayersOption.TWEAK.parameters_ui(layout, params) diff --git a/rigify/rigs/limbs/limb_utils.py b/rigify/rigs/limbs/limb_utils.py index 609da256..b60e865a 100644 --- a/rigify/rigs/limbs/limb_utils.py +++ b/rigify/rigs/limbs/limb_utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy, re from mathutils import Vector from ...utils import org, strip_org, make_mechanism_name, make_deformer_name diff --git a/rigify/rigs/limbs/paw.py b/rigify/rigs/limbs/paw.py index 3aa336ac..30d81d4f 100644 --- a/rigify/rigs/limbs/paw.py +++ b/rigify/rigs/limbs/paw.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -342,6 +326,10 @@ def create_sample(obj): pbone.rigify_parameters.limb_type = "paw" except AttributeError: pass + try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass pbone = obj.pose.bones[bones['shin.L']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) diff --git a/rigify/rigs/limbs/rear_paw.py b/rigify/rigs/limbs/rear_paw.py index d0d349e8..967a666d 100644 --- a/rigify/rigs/limbs/rear_paw.py +++ b/rigify/rigs/limbs/rear_paw.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/limbs/simple_tentacle.py b/rigify/rigs/limbs/simple_tentacle.py index 50a5c6ca..21893c14 100644 --- a/rigify/rigs/limbs/simple_tentacle.py +++ b/rigify/rigs/limbs/simple_tentacle.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/limbs/super_finger.py b/rigify/rigs/limbs/super_finger.py index 664094d1..a1f49920 100644 --- a/rigify/rigs/limbs/super_finger.py +++ b/rigify/rigs/limbs/super_finger.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -168,6 +152,12 @@ class Rig(SimpleChainRig): no_fix_rotation=True, no_fix_scale=True, ) + @stage.parent_bones + def parent_ik_control(self): + if self.make_ik: + bone = self.get_bone(self.bones.ctrl.ik) + bone.use_local_location = self.params.ik_local_location + @stage.configure_bones def configure_ik_control(self): if self.make_ik: @@ -382,6 +372,12 @@ class Rig(SimpleChainRig): description = "Create an optional IK control" ) + params.ik_local_location = bpy.props.BoolProperty( + name = 'IK Local Location', + default = True, + description = "Specifies the value of the Local Location option for IK controls, which decides if the location channels are aligned to the local control orientation or world", + ) + ControlLayersOption.TWEAK.add_parameters(params) ControlLayersOption.EXTRA_IK.add_parameters(params) @@ -396,6 +392,9 @@ class Rig(SimpleChainRig): layout.prop(params, 'bbones') layout.prop(params, 'make_extra_ik_control', text='IK Control') + if params.make_extra_ik_control: + layout.prop(params, 'ik_local_location') + ControlLayersOption.TWEAK.parameters_ui(layout, params) if params.make_extra_ik_control: @@ -639,6 +638,10 @@ def create_sample(obj): pbone.rigify_parameters.tweak_extra_layers = False except AttributeError: pass + try: + pbone.rigify_parameters.ik_local_location = False + except AttributeError: + pass pbone = obj.pose.bones[bones['f_pinky.02.L']] pbone.rigify_type = '' pbone.lock_location = (False, False, False) diff --git a/rigify/rigs/limbs/super_limb.py b/rigify/rigs/limbs/super_limb.py index 5020f091..f5e4c7bd 100644 --- a/rigify/rigs/limbs/super_limb.py +++ b/rigify/rigs/limbs/super_limb.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/limbs/super_palm.py b/rigify/rigs/limbs/super_palm.py index 7573e4a7..62e39c49 100644 --- a/rigify/rigs/limbs/super_palm.py +++ b/rigify/rigs/limbs/super_palm.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/skin/anchor.py b/rigify/rigs/skin/anchor.py index 0392761f..0474a134 100644 --- a/rigify/rigs/skin/anchor.py +++ b/rigify/rigs/skin/anchor.py @@ -1,20 +1,4 @@ -# ====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/skin/basic_chain.py b/rigify/rigs/skin/basic_chain.py index b2cac8a6..8dfb6140 100644 --- a/rigify/rigs/skin/basic_chain.py +++ b/rigify/rigs/skin/basic_chain.py @@ -1,20 +1,4 @@ -# ====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/skin/glue.py b/rigify/rigs/skin/glue.py index 6f9400cd..cb8ddf48 100644 --- a/rigify/rigs/skin/glue.py +++ b/rigify/rigs/skin/glue.py @@ -1,20 +1,4 @@ -# ====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/skin/skin_nodes.py b/rigify/rigs/skin/skin_nodes.py index 6dec06e8..20a7df8c 100644 --- a/rigify/rigs/skin/skin_nodes.py +++ b/rigify/rigs/skin/skin_nodes.py @@ -1,20 +1,4 @@ -# ====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/skin/skin_parents.py b/rigify/rigs/skin/skin_parents.py index 956c5ca3..a60b85b9 100644 --- a/rigify/rigs/skin/skin_parents.py +++ b/rigify/rigs/skin/skin_parents.py @@ -1,20 +1,4 @@ -# ====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/skin/skin_rigs.py b/rigify/rigs/skin/skin_rigs.py index a4bc361e..bc6b6350 100644 --- a/rigify/rigs/skin/skin_rigs.py +++ b/rigify/rigs/skin/skin_rigs.py @@ -1,20 +1,4 @@ -# ====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/skin/stretchy_chain.py b/rigify/rigs/skin/stretchy_chain.py index c6fae592..18313757 100644 --- a/rigify/rigs/skin/stretchy_chain.py +++ b/rigify/rigs/skin/stretchy_chain.py @@ -1,20 +1,4 @@ -# ====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/skin/transform/basic.py b/rigify/rigs/skin/transform/basic.py index 2069615a..48a178e4 100644 --- a/rigify/rigs/skin/transform/basic.py +++ b/rigify/rigs/skin/transform/basic.py @@ -1,20 +1,4 @@ -# ====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/spines/basic_spine.py b/rigify/rigs/spines/basic_spine.py index 5c64e634..4499af69 100644 --- a/rigify/rigs/spines/basic_spine.py +++ b/rigify/rigs/spines/basic_spine.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/spines/basic_tail.py b/rigify/rigs/spines/basic_tail.py index b5bf1076..a69ac800 100644 --- a/rigify/rigs/spines/basic_tail.py +++ b/rigify/rigs/spines/basic_tail.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/spines/spine_rigs.py b/rigify/rigs/spines/spine_rigs.py index 3c8b8223..9e25018e 100644 --- a/rigify/rigs/spines/spine_rigs.py +++ b/rigify/rigs/spines/spine_rigs.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/spines/super_head.py b/rigify/rigs/spines/super_head.py index f71a95ff..149dd1d8 100644 --- a/rigify/rigs/spines/super_head.py +++ b/rigify/rigs/spines/super_head.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/spines/super_spine.py b/rigify/rigs/spines/super_spine.py index 86021c84..9d9e6d0f 100644 --- a/rigify/rigs/spines/super_spine.py +++ b/rigify/rigs/spines/super_spine.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/rigs/utils.py b/rigify/rigs/utils.py index 89873ca4..cbc53e3a 100644 --- a/rigify/rigs/utils.py +++ b/rigify/rigs/utils.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + from ..utils.rig import connected_children_names from ..utils.naming import strip_mch, strip_org, make_mechanism_name import re diff --git a/rigify/rigs/widgets.py b/rigify/rigs/widgets.py index 0c434593..acafe750 100644 --- a/rigify/rigs/widgets.py +++ b/rigify/rigs/widgets.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + from mathutils import Matrix from ..utils.widgets import create_widget, widget_generator diff --git a/rigify/rot_mode.py b/rigify/rot_mode.py index 59a233cb..a395ec6e 100644 --- a/rigify/rot_mode.py +++ b/rigify/rot_mode.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + ''' Quat/Euler Rotation Mode Converter v0.1 diff --git a/rigify/ui.py b/rigify/ui.py index eac8b673..54ae4a70 100644 --- a/rigify/ui.py +++ b/rigify/ui.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -60,8 +44,8 @@ def build_type_list(context, rigify_types): a.name = r -class DATA_PT_rigify_generate(bpy.types.Panel): - bl_label = "Rigify Generation" +class DATA_PT_rigify(bpy.types.Panel): + bl_label = "Rigify" bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "data" @@ -72,76 +56,79 @@ class DATA_PT_rigify_generate(bpy.types.Panel): if not context.object: return False return obj.type == 'ARMATURE' \ - and obj.data.get("rig_id") is None \ - and obj.mode in {'POSE', 'OBJECT'} + and obj.data.get("rig_id") is None def draw(self, context): C = context layout = self.layout obj = C.object - if obj.mode in {'POSE', 'OBJECT'}: - WARNING = "Warning: Some features may change after generation" - show_warning = False - show_update_metarig = False - show_not_updatable = False - show_upgrade_face = False + WARNING = "Warning: Some features may change after generation" + show_warning = False + show_update_metarig = False + show_not_updatable = False + show_upgrade_face = False - check_props = ['IK_follow', 'root/parent', 'FK_limb_follow', 'IK_Stretch'] + check_props = ['IK_follow', 'root/parent', 'FK_limb_follow', 'IK_Stretch'] - for bone in obj.pose.bones: - if bone.bone.layers[30] and (list(set(bone.keys()) & set(check_props))): - show_warning = True + for posebone in obj.pose.bones: + bone = posebone.bone + if not bone: + # If we are in edit mode and the bone was just created, + # a pose bone won't exist yet. + continue + if bone.layers[30] and (list(set(posebone.keys()) & set(check_props))): + show_warning = True + break + + for b in obj.pose.bones: + if b.rigify_type in outdated_types.keys(): + old_bone = b.name + old_rig = b.rigify_type + if outdated_types[b.rigify_type]: + show_update_metarig = True + else: + show_update_metarig = False + show_not_updatable = True break + elif b.rigify_type == 'faces.super_face': + show_upgrade_face = True - for b in obj.pose.bones: - if b.rigify_type in outdated_types.keys(): - old_bone = b.name - old_rig = b.rigify_type - if outdated_types[b.rigify_type]: - show_update_metarig = True - else: - show_update_metarig = False - show_not_updatable = True - break - elif b.rigify_type == 'faces.super_face': - show_upgrade_face = True - - if show_warning: - layout.label(text=WARNING, icon='ERROR') - - enable_generate = not (show_not_updatable or show_update_metarig) - - if show_not_updatable: - layout.label(text="WARNING: This metarig contains deprecated rigify rig-types and cannot be upgraded automatically.", icon='ERROR') - layout.label(text="("+old_rig+" on bone "+old_bone+")") - elif show_update_metarig: - layout.label(text="This metarig contains old rig-types that can be automatically upgraded to benefit of rigify's new features.", icon='ERROR') - layout.label(text="("+old_rig+" on bone "+old_bone+")") - layout.operator("pose.rigify_upgrade_types", text="Upgrade Metarig") - elif show_upgrade_face: - layout.label(text="This metarig uses the old face rig.", icon='INFO') - layout.operator("pose.rigify_upgrade_face") + if show_warning: + layout.label(text=WARNING, icon='ERROR') - row = layout.row() - # Rig type field + enable_generate = not (show_not_updatable or show_update_metarig) - col = layout.column(align=True) - col.active = (not 'rig_id' in C.object.data) + if show_not_updatable: + layout.label(text="WARNING: This metarig contains deprecated rigify rig-types and cannot be upgraded automatically.", icon='ERROR') + layout.label(text="("+old_rig+" on bone "+old_bone+")") + elif show_update_metarig: + layout.label(text="This metarig contains old rig-types that can be automatically upgraded to benefit of rigify's new features.", icon='ERROR') + layout.label(text="("+old_rig+" on bone "+old_bone+")") + layout.operator("pose.rigify_upgrade_types", text="Upgrade Metarig") + elif show_upgrade_face: + layout.label(text="This metarig uses the old face rig.", icon='INFO') + layout.operator("pose.rigify_upgrade_face") - col.separator() - row = col.row() - text = "Re-Generate Rig" if obj.data.rigify_target_rig else "Generate Rig" - row.operator("pose.rigify_generate", text=text, icon='POSE_HLT') - row.enabled = enable_generate + row = layout.row() + # Rig type field + col = layout.column(align=True) + col.active = (not 'rig_id' in C.object.data) -class DATA_PT_rigify_generate_advanced(bpy.types.Panel): + col.separator() + row = col.row() + text = "Re-Generate Rig" if obj.data.rigify_target_rig else "Generate Rig" + row.operator("pose.rigify_generate", text=text, icon='POSE_HLT') + row.enabled = enable_generate + + +class DATA_PT_rigify_advanced(bpy.types.Panel): bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "data" bl_label = "Advanced" - bl_parent_id = 'DATA_PT_rigify_generate' + bl_parent_id = 'DATA_PT_rigify' bl_options = {'DEFAULT_CLOSED'} def draw(self, context): @@ -163,10 +150,12 @@ class DATA_PT_rigify_generate_advanced(bpy.types.Panel): class DATA_PT_rigify_samples(bpy.types.Panel): - bl_label = "Rigify Samples" + bl_label = "Samples" bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "data" + bl_parent_id = "DATA_PT_rigify" + bl_options = {'DEFAULT_CLOSED'} @classmethod def poll(cls, context): @@ -202,11 +191,12 @@ class DATA_PT_rigify_samples(bpy.types.Panel): class DATA_PT_rigify_layer_names(bpy.types.Panel): - bl_label = "Rigify Layer Names" + bl_label = "Layer Names" bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "data" bl_options = {'DEFAULT_CLOSED'} + bl_parent_id = "DATA_PT_rigify" @classmethod def poll(cls, context): @@ -540,11 +530,12 @@ class DATA_MT_rigify_bone_groups_context_menu(bpy.types.Menu): class DATA_PT_rigify_bone_groups(bpy.types.Panel): - bl_label = "Rigify Bone Groups" + bl_label = "Bone Groups" bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "data" bl_options = {'DEFAULT_CLOSED'} + bl_parent_id = "DATA_PT_rigify" @classmethod def poll(cls, context): @@ -1387,10 +1378,10 @@ classes = ( DATA_OT_rigify_bone_group_remove_all, DATA_UL_rigify_bone_groups, DATA_MT_rigify_bone_groups_context_menu, + DATA_PT_rigify, + DATA_PT_rigify_advanced, DATA_PT_rigify_bone_groups, DATA_PT_rigify_layer_names, - DATA_PT_rigify_generate, - DATA_PT_rigify_generate_advanced, DATA_PT_rigify_samples, BONE_PT_rigify_buttons, VIEW3D_PT_rigify_animation_tools, diff --git a/rigify/utils/__init__.py b/rigify/utils/__init__.py index f2444d1c..8a2dee1d 100644 --- a/rigify/utils/__init__.py +++ b/rigify/utils/__init__.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + # These forwarding imports are for backwards compatibility with legacy code # that expects a single utils.py file. New code should import directly from # the modules that contain the utilities. Also, don't add more imports here. diff --git a/rigify/utils/animation.py b/rigify/utils/animation.py index 8710e74d..e9a56f4c 100644 --- a/rigify/utils/animation.py +++ b/rigify/utils/animation.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/bones.py b/rigify/utils/bones.py index 4416a1d6..10a8926d 100644 --- a/rigify/utils/bones.py +++ b/rigify/utils/bones.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -498,6 +482,20 @@ def align_bone_orientation(obj, bone_name, target_bone_name): bone1_e.roll = bone2_e.roll +def set_bone_orientation(obj, bone_name, orientation): + """ Aligns the orientation of bone to target bone or matrix. """ + if isinstance(orientation, str): + align_bone_orientation(obj, bone_name, orientation) + + else: + bone_e = obj.data.edit_bones[bone_name] + + matrix = Matrix(orientation).to_4x4() + matrix.translation = bone_e.head + + bone_e.matrix = matrix + + def align_bone_roll(obj, bone1, bone2): """ Aligns the roll of two bones. """ diff --git a/rigify/utils/collections.py b/rigify/utils/collections.py index a19b9da1..6b98b86b 100644 --- a/rigify/utils/collections.py +++ b/rigify/utils/collections.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/components.py b/rigify/utils/components.py index 5c1ebcb6..c1d01c90 100644 --- a/rigify/utils/components.py +++ b/rigify/utils/components.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy from .naming import make_derived_name diff --git a/rigify/utils/errors.py b/rigify/utils/errors.py index 0fc81ccb..1fa1f11b 100644 --- a/rigify/utils/errors.py +++ b/rigify/utils/errors.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/layers.py b/rigify/utils/layers.py index 27c67f0b..1b807cc7 100644 --- a/rigify/utils/layers.py +++ b/rigify/utils/layers.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/mechanism.py b/rigify/utils/mechanism.py index 930309b3..d8ac3a62 100644 --- a/rigify/utils/mechanism.py +++ b/rigify/utils/mechanism.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/metaclass.py b/rigify/utils/metaclass.py index c9d4ec1a..1c53a8ef 100644 --- a/rigify/utils/metaclass.py +++ b/rigify/utils/metaclass.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/misc.py b/rigify/utils/misc.py index 9d4307c0..99767e09 100644 --- a/rigify/utils/misc.py +++ b/rigify/utils/misc.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/naming.py b/rigify/utils/naming.py index a713e407..06d9e36e 100644 --- a/rigify/utils/naming.py +++ b/rigify/utils/naming.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/node_merger.py b/rigify/utils/node_merger.py index 49ebaf27..d627707f 100644 --- a/rigify/utils/node_merger.py +++ b/rigify/utils/node_merger.py @@ -1,20 +1,4 @@ -# ====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/rig.py b/rigify/utils/rig.py index 7969a34f..654f3580 100644 --- a/rigify/utils/rig.py +++ b/rigify/utils/rig.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/switch_parent.py b/rigify/utils/switch_parent.py index 405008b9..d4852c43 100644 --- a/rigify/utils/switch_parent.py +++ b/rigify/utils/switch_parent.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + import bpy import re @@ -7,6 +9,7 @@ import json from .errors import MetarigError from .naming import strip_prefix, make_derived_name +from .bones import set_bone_orientation from .mechanism import MechanismUtilityMixin from .rig import rig_is_child from .misc import map_list, map_apply, force_lazy @@ -16,6 +19,7 @@ from ..base_generate import GeneratorPlugin from collections import defaultdict from itertools import count, repeat, chain +from mathutils import Matrix class SwitchParentBuilder(GeneratorPlugin, MechanismUtilityMixin): @@ -80,7 +84,7 @@ class SwitchParentBuilder(GeneratorPlugin, MechanismUtilityMixin): self.local_parents[id(rig)].append(entry) - def build_child(self, rig, bone, *, use_parent_mch=True, **options): + def build_child(self, rig, bone, *, use_parent_mch=True, mch_orientation=None, **options): """ Build a switchable parent mechanism for the specified bone. @@ -89,6 +93,7 @@ class SwitchParentBuilder(GeneratorPlugin, MechanismUtilityMixin): bone Name of the child bone. extra_parents List of bone names or (name, user_name) pairs to use as additional parents. use_parent_mch Create an intermediate MCH bone for the constraints and parent the child to it. + mch_orientation Orientation matrix or bone name to align the MCH bone to; defaults to world. select_parent Select the specified bone instead of the last one. select_tags List of parent tags to try for default selection. ignore_global Ignore the is_global flag of potential parents. @@ -120,6 +125,9 @@ class SwitchParentBuilder(GeneratorPlugin, MechanismUtilityMixin): # Create MCH proxy if use_parent_mch: mch_bone = rig.copy_bone(bone, make_derived_name(bone, 'mch', '.parent'), scale=1/3) + + set_bone_orientation(rig.obj, mch_bone, mch_orientation or Matrix.Identity(4)) + else: mch_bone = bone diff --git a/rigify/utils/widgets.py b/rigify/utils/widgets.py index b3715f80..16f5faab 100644 --- a/rigify/utils/widgets.py +++ b/rigify/utils/widgets.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/widgets_basic.py b/rigify/utils/widgets_basic.py index 543457eb..854b4d7e 100644 --- a/rigify/utils/widgets_basic.py +++ b/rigify/utils/widgets_basic.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/rigify/utils/widgets_special.py b/rigify/utils/widgets_special.py index 8e2d7a27..276590a5 100644 --- a/rigify/utils/widgets_special.py +++ b/rigify/utils/widgets_special.py @@ -1,20 +1,4 @@ -#====================== 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 ======================== +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_clip_editor_refine_solution.py b/space_clip_editor_refine_solution.py index 457af286..638542cc 100644 --- a/space_clip_editor_refine_solution.py +++ b/space_clip_editor_refine_solution.py @@ -1,24 +1,4 @@ -# -*- coding:utf-8 -*- - -# ##### 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 3 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, see <http://www.gnu.org/licenses/>. -# All rights reserved. -# -# ##### END GPL LICENSE BLOCK ##### - -# <pep8 compliant> +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Refine tracking solution", diff --git a/space_view3d_3d_navigation.py b/space_view3d_3d_navigation.py index 937f546f..cc06f851 100644 --- a/space_view3d_3d_navigation.py +++ b/space_view3d_3d_navigation.py @@ -1,25 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + # 3D NAVIGATION TOOLBAR v1.2 - 3Dview Addon - Blender 2.5x -# -# THIS SCRIPT IS LICENSED UNDER GPL, -# please read the license block. - -# ##### 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 ##### # contributed to by: Demohero, uriel, jbelcik, meta-androcto bl_info = { diff --git a/space_view3d_align_tools.py b/space_view3d_align_tools.py index 8bfa1f6b..66000bd2 100644 --- a/space_view3d_align_tools.py +++ b/space_view3d_align_tools.py @@ -1,22 +1,5 @@ -# -*- coding: utf-8 -*- -# ##### 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 ##### -# Contributed to by gabhead, Lell, Anfeo, meta-androcto +# SPDX-License-Identifier: GPL-2.0-or-later +# Contributed to by gabhead, Lell, Anfeo, meta-androcto. bl_info = { "name": "Align Tools", diff --git a/space_view3d_brush_menus/__init__.py b/space_view3d_brush_menus/__init__.py index c040bd9d..e8b8c355 100644 --- a/space_view3d_brush_menus/__init__.py +++ b/space_view3d_brush_menus/__init__.py @@ -1,21 +1,4 @@ -# ##### 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 ##### -# Modified by Meta-Androcto +# SPDX-License-Identifier: GPL-2.0-or-later """ Copyright 2011 GPL licence applies""" diff --git a/space_view3d_brush_menus/brush_menu.py b/space_view3d_brush_menus/brush_menu.py index ee7eff25..6a89dbf6 100644 --- a/space_view3d_brush_menus/brush_menu.py +++ b/space_view3d_brush_menus/brush_menu.py @@ -1,4 +1,4 @@ -# gpl author: Ryan Inch (Imaginer) +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.types import ( diff --git a/space_view3d_brush_menus/brushes.py b/space_view3d_brush_menus/brushes.py index 0d70227d..dc9d5912 100644 --- a/space_view3d_brush_menus/brushes.py +++ b/space_view3d_brush_menus/brushes.py @@ -1,4 +1,4 @@ -# gpl author: Ryan Inch (Imaginer) +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.types import Menu diff --git a/space_view3d_brush_menus/curve_menu.py b/space_view3d_brush_menus/curve_menu.py index 5a836031..7ca509f3 100644 --- a/space_view3d_brush_menus/curve_menu.py +++ b/space_view3d_brush_menus/curve_menu.py @@ -1,4 +1,4 @@ -# gpl author: Ryan Inch (Imaginer) +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.types import ( diff --git a/space_view3d_brush_menus/dyntopo_menu.py b/space_view3d_brush_menus/dyntopo_menu.py index 1a569787..df86a365 100644 --- a/space_view3d_brush_menus/dyntopo_menu.py +++ b/space_view3d_brush_menus/dyntopo_menu.py @@ -1,4 +1,4 @@ -# gpl author: Ryan Inch (Imaginer) +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.types import Menu diff --git a/space_view3d_brush_menus/stroke_menu.py b/space_view3d_brush_menus/stroke_menu.py index 8c5b0407..48174de8 100644 --- a/space_view3d_brush_menus/stroke_menu.py +++ b/space_view3d_brush_menus/stroke_menu.py @@ -1,4 +1,4 @@ -# gpl author: Ryan Inch (Imaginer) +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.types import Menu diff --git a/space_view3d_brush_menus/symmetry_menu.py b/space_view3d_brush_menus/symmetry_menu.py index 21e566d4..727dadd0 100644 --- a/space_view3d_brush_menus/symmetry_menu.py +++ b/space_view3d_brush_menus/symmetry_menu.py @@ -1,4 +1,4 @@ -# gpl author: Ryan Inch (Imaginer) +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.types import Menu diff --git a/space_view3d_brush_menus/texture_menu.py b/space_view3d_brush_menus/texture_menu.py index f5e0e960..01aec61d 100644 --- a/space_view3d_brush_menus/texture_menu.py +++ b/space_view3d_brush_menus/texture_menu.py @@ -1,4 +1,4 @@ -# gpl author: Ryan Inch (Imaginer) +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.types import Menu diff --git a/space_view3d_brush_menus/utils_core.py b/space_view3d_brush_menus/utils_core.py index dc99ba0b..1bff1960 100644 --- a/space_view3d_brush_menus/utils_core.py +++ b/space_view3d_brush_menus/utils_core.py @@ -1,4 +1,4 @@ -# gpl author: Ryan Inch (Imaginer) +# SPDX-License-Identifier: GPL-2.0-or-later import bpy diff --git a/space_view3d_copy_attributes.py b/space_view3d_copy_attributes.py index 9496ed1d..0a8705e2 100644 --- a/space_view3d_copy_attributes.py +++ b/space_view3d_copy_attributes.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_math_vis/__init__.py b/space_view3d_math_vis/__init__.py index b99456f8..8b53c911 100644 --- a/space_view3d_math_vis/__init__.py +++ b/space_view3d_math_vis/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_math_vis/draw.py b/space_view3d_math_vis/draw.py index 33f6a965..ca798a90 100644 --- a/space_view3d_math_vis/draw.py +++ b/space_view3d_math_vis/draw.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_math_vis/utils.py b/space_view3d_math_vis/utils.py index a175dd5c..a4e27136 100644 --- a/space_view3d_math_vis/utils.py +++ b/space_view3d_math_vis/utils.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_modifier_tools.py b/space_view3d_modifier_tools.py index 1fb64635..71aa7cf3 100644 --- a/space_view3d_modifier_tools.py +++ b/space_view3d_modifier_tools.py @@ -1,21 +1,5 @@ -# ##### 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 ##### -# by meta-androcto, saidenka # +# SPDX-License-Identifier: GPL-2.0-or-later +# by meta-androcto, saidenka. bl_info = { "name": "Modifier Tools", diff --git a/space_view3d_pie_menus/__init__.py b/space_view3d_pie_menus/__init__.py index 783f061a..32925341 100644 --- a/space_view3d_pie_menus/__init__.py +++ b/space_view3d_pie_menus/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_pie_menus/pie_align_menu.py b/space_view3d_pie_menus/pie_align_menu.py index 2dcf9e20..88ed99fe 100644 --- a/space_view3d_pie_menus/pie_align_menu.py +++ b/space_view3d_pie_menus/pie_align_menu.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_pie_menus/pie_animation_menu.py b/space_view3d_pie_menus/pie_animation_menu.py index eda7ed4d..f99ff68b 100644 --- a/space_view3d_pie_menus/pie_animation_menu.py +++ b/space_view3d_pie_menus/pie_animation_menu.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_pie_menus/pie_apply_transform_menu.py b/space_view3d_pie_menus/pie_apply_transform_menu.py index 7646571d..2f4d6f8e 100644 --- a/space_view3d_pie_menus/pie_apply_transform_menu.py +++ b/space_view3d_pie_menus/pie_apply_transform_menu.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_pie_menus/pie_defaults_menu.py b/space_view3d_pie_menus/pie_defaults_menu.py index 8c068c47..0b49c411 100644 --- a/space_view3d_pie_menus/pie_defaults_menu.py +++ b/space_view3d_pie_menus/pie_defaults_menu.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_pie_menus/pie_delete_menu.py b/space_view3d_pie_menus/pie_delete_menu.py index 97e0c774..2826c955 100644 --- a/space_view3d_pie_menus/pie_delete_menu.py +++ b/space_view3d_pie_menus/pie_delete_menu.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_pie_menus/pie_editor_switch_menu.py b/space_view3d_pie_menus/pie_editor_switch_menu.py index 585a90f0..80f05835 100644 --- a/space_view3d_pie_menus/pie_editor_switch_menu.py +++ b/space_view3d_pie_menus/pie_editor_switch_menu.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_pie_menus/pie_manipulator_menu.py b/space_view3d_pie_menus/pie_manipulator_menu.py index 428254d4..1f7aaf94 100644 --- a/space_view3d_pie_menus/pie_manipulator_menu.py +++ b/space_view3d_pie_menus/pie_manipulator_menu.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_pie_menus/pie_modes_menu.py b/space_view3d_pie_menus/pie_modes_menu.py index c7ec302f..2bd714f6 100644 --- a/space_view3d_pie_menus/pie_modes_menu.py +++ b/space_view3d_pie_menus/pie_modes_menu.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_pie_menus/pie_origin.py b/space_view3d_pie_menus/pie_origin.py index bc74fd1b..74c3a3bf 100644 --- a/space_view3d_pie_menus/pie_origin.py +++ b/space_view3d_pie_menus/pie_origin.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_pie_menus/pie_proportional_menu.py b/space_view3d_pie_menus/pie_proportional_menu.py index 009bf8a8..96e8c3e1 100644 --- a/space_view3d_pie_menus/pie_proportional_menu.py +++ b/space_view3d_pie_menus/pie_proportional_menu.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_pie_menus/pie_save_open_menu.py b/space_view3d_pie_menus/pie_save_open_menu.py index f1bef21b..8479fa51 100644 --- a/space_view3d_pie_menus/pie_save_open_menu.py +++ b/space_view3d_pie_menus/pie_save_open_menu.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_pie_menus/pie_sculpt_menu.py b/space_view3d_pie_menus/pie_sculpt_menu.py index 9d343dc1..bb375692 100644 --- a/space_view3d_pie_menus/pie_sculpt_menu.py +++ b/space_view3d_pie_menus/pie_sculpt_menu.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_pie_menus/pie_select_menu.py b/space_view3d_pie_menus/pie_select_menu.py index 025cddaa..99972563 100644 --- a/space_view3d_pie_menus/pie_select_menu.py +++ b/space_view3d_pie_menus/pie_select_menu.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_pie_menus/pie_shading_menu.py b/space_view3d_pie_menus/pie_shading_menu.py index 28603d25..04f6d54a 100644 --- a/space_view3d_pie_menus/pie_shading_menu.py +++ b/space_view3d_pie_menus/pie_shading_menu.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_pie_menus/pie_views_numpad_menu.py b/space_view3d_pie_menus/pie_views_numpad_menu.py index 87984091..2fdfee34 100644 --- a/space_view3d_pie_menus/pie_views_numpad_menu.py +++ b/space_view3d_pie_menus/pie_views_numpad_menu.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/space_view3d_spacebar_menu/__init__.py b/space_view3d_spacebar_menu/__init__.py index bc39a2bb..b7a76708 100644 --- a/space_view3d_spacebar_menu/__init__.py +++ b/space_view3d_spacebar_menu/__init__.py @@ -1,21 +1,5 @@ -# ##### 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 ##### -# Contributed to by: meta-androcto, JayDez, sim88, sam, lijenstina, mkb, wisaac, CoDEmanX # +# SPDX-License-Identifier: GPL-2.0-or-later +# Contributed to by: meta-androcto, JayDez, sim88, sam, lijenstina, mkb, wisaac, CoDEmanX. bl_info = { "name": "Dynamic Context Menu", diff --git a/space_view3d_spacebar_menu/animation_menus.py b/space_view3d_spacebar_menu/animation_menus.py index 7dadffc6..5872b877 100644 --- a/space_view3d_spacebar_menu/animation_menus.py +++ b/space_view3d_spacebar_menu/animation_menus.py @@ -1,21 +1,5 @@ -# ##### 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 ##### -# Contributed to by: meta-androcto, JayDez, sim88, sam, lijenstina, mkb, wisaac, CoDEmanX # +# SPDX-License-Identifier: GPL-2.0-or-later +# Contributed to by: meta-androcto, JayDez, sim88, sam, lijenstina, mkb, wisaac, CoDEmanX. import bpy diff --git a/space_view3d_spacebar_menu/armature_menus.py b/space_view3d_spacebar_menu/armature_menus.py index 2196efa8..1eb26000 100644 --- a/space_view3d_spacebar_menu/armature_menus.py +++ b/space_view3d_spacebar_menu/armature_menus.py @@ -1,21 +1,5 @@ -# ##### 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 ##### -# Contributed to by: meta-androcto, JayDez, sim88, sam, lijenstina, mkb, wisaac, CoDEmanX # +# SPDX-License-Identifier: GPL-2.0-or-later +# Contributed to by: meta-androcto, JayDez, sim88, sam, lijenstina, mkb, wisaac, CoDEmanX. import bpy diff --git a/space_view3d_spacebar_menu/curve_menus.py b/space_view3d_spacebar_menu/curve_menus.py index c9e72ff0..7e5abbc3 100644 --- a/space_view3d_spacebar_menu/curve_menus.py +++ b/space_view3d_spacebar_menu/curve_menus.py @@ -1,21 +1,5 @@ -# ##### 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 ##### -# Contributed to by: meta-androcto, JayDez, sim88, sam, lijenstina, mkb, wisaac, CoDEmanX # +# SPDX-License-Identifier: GPL-2.0-or-later +# Contributed to by: meta-androcto, JayDez, sim88, sam, lijenstina, mkb, wisaac, CoDEmanX. import bpy diff --git a/space_view3d_spacebar_menu/edit_mesh.py b/space_view3d_spacebar_menu/edit_mesh.py index c7098c69..f40e8b9a 100644 --- a/space_view3d_spacebar_menu/edit_mesh.py +++ b/space_view3d_spacebar_menu/edit_mesh.py @@ -1,21 +1,5 @@ -# ##### 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 ##### -# Contributed to by: meta-androcto, JayDez, sim88, sam, lijenstina, mkb, wisaac, CoDEmanX # +# SPDX-License-Identifier: GPL-2.0-or-later +# Contributed to by: meta-androcto, JayDez, sim88, sam, lijenstina, mkb, wisaac, CoDEmanX. import bpy diff --git a/space_view3d_spacebar_menu/object_menus.py b/space_view3d_spacebar_menu/object_menus.py index f6b0ba29..0751933c 100644 --- a/space_view3d_spacebar_menu/object_menus.py +++ b/space_view3d_spacebar_menu/object_menus.py @@ -1,21 +1,5 @@ -# ##### 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 ##### -# Contributed to by: meta-androcto, JayDez, sim88, sam, lijenstina, mkb, wisaac, CoDEmanX # +# SPDX-License-Identifier: GPL-2.0-or-later +# Contributed to by: meta-androcto, JayDez, sim88, sam, lijenstina, mkb, wisaac, CoDEmanX. import bpy diff --git a/space_view3d_spacebar_menu/snap_origin_cursor.py b/space_view3d_spacebar_menu/snap_origin_cursor.py index b150a492..ffc163a3 100644 --- a/space_view3d_spacebar_menu/snap_origin_cursor.py +++ b/space_view3d_spacebar_menu/snap_origin_cursor.py @@ -1,21 +1,5 @@ -# ##### 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 ##### -# Contributed to by: meta-androcto, JayDez, sim88, sam, lijenstina, mkb, wisaac, CoDEmanX # +# SPDX-License-Identifier: GPL-2.0-or-later +# Contributed to by: meta-androcto, JayDez, sim88, sam, lijenstina, mkb, wisaac, CoDEmanX. import bpy diff --git a/space_view3d_spacebar_menu/transform_menus.py b/space_view3d_spacebar_menu/transform_menus.py index a6438bd9..e760fdca 100644 --- a/space_view3d_spacebar_menu/transform_menus.py +++ b/space_view3d_spacebar_menu/transform_menus.py @@ -1,21 +1,5 @@ -# ##### 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 ##### -# Contributed to by: meta-androcto, JayDez, sim88, sam, lijenstina, mkb, wisaac, CoDEmanX # +# SPDX-License-Identifier: GPL-2.0-or-later +# Contributed to by: meta-androcto, JayDez, sim88, sam, lijenstina, mkb, wisaac, CoDEmanX. import bpy diff --git a/space_view3d_spacebar_menu/view_menus.py b/space_view3d_spacebar_menu/view_menus.py index 84a69eb4..03f7318d 100644 --- a/space_view3d_spacebar_menu/view_menus.py +++ b/space_view3d_spacebar_menu/view_menus.py @@ -1,21 +1,5 @@ -# ##### 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 ##### -# Contributed to by: meta-androcto, JayDez, sim88, sam, lijenstina, mkb, wisaac, CoDEmanX # +# SPDX-License-Identifier: GPL-2.0-or-later +# Contributed to by: meta-androcto, JayDez, sim88, sam, lijenstina, mkb, wisaac, CoDEmanX. import bpy diff --git a/space_view3d_stored_views/__init__.py b/space_view3d_stored_views/__init__.py index d7fed107..645c568f 100644 --- a/space_view3d_stored_views/__init__.py +++ b/space_view3d_stored_views/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Stored Views", diff --git a/space_view3d_stored_views/core.py b/space_view3d_stored_views/core.py index 5360b4bb..48452fad 100644 --- a/space_view3d_stored_views/core.py +++ b/space_view3d_stored_views/core.py @@ -1,5 +1,6 @@ -# gpl authors: nfloyd, Francesco Siddi +# SPDX-License-Identifier: GPL-2.0-or-later +# Authors: nfloyd, Francesco Siddi import logging module_logger = logging.getLogger(__name__) diff --git a/space_view3d_stored_views/io.py b/space_view3d_stored_views/io.py index 83a5499d..c17d307e 100644 --- a/space_view3d_stored_views/io.py +++ b/space_view3d_stored_views/io.py @@ -1,4 +1,6 @@ -# gpl authors: nfloyd, Francesco Siddi +# SPDX-License-Identifier: GPL-2.0-or-later + +# Authors: nfloyd, Francesco Siddi import gzip import os diff --git a/space_view3d_stored_views/operators.py b/space_view3d_stored_views/operators.py index 284e785c..137a711d 100644 --- a/space_view3d_stored_views/operators.py +++ b/space_view3d_stored_views/operators.py @@ -1,4 +1,6 @@ -# gpl authors: nfloyd, Francesco Siddi +# SPDX-License-Identifier: GPL-2.0-or-later + +# Authors: nfloyd, Francesco Siddi import bpy from bpy.props import IntProperty diff --git a/space_view3d_stored_views/properties.py b/space_view3d_stored_views/properties.py index 51666ce2..a9fd6b2b 100644 --- a/space_view3d_stored_views/properties.py +++ b/space_view3d_stored_views/properties.py @@ -1,4 +1,6 @@ -# gpl authors: nfloyd, Francesco Siddi +# SPDX-License-Identifier: GPL-2.0-or-later + +# authors: nfloyd, Francesco Siddi import bpy from bpy.types import PropertyGroup from bpy.props import ( diff --git a/space_view3d_stored_views/stored_views_test.py b/space_view3d_stored_views/stored_views_test.py index 58a4552f..845dbe1b 100644 --- a/space_view3d_stored_views/stored_views_test.py +++ b/space_view3d_stored_views/stored_views_test.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later bl_info = { "name": "Stored Views", diff --git a/space_view3d_stored_views/ui.py b/space_view3d_stored_views/ui.py index 207f18c9..6d9e8d8a 100644 --- a/space_view3d_stored_views/ui.py +++ b/space_view3d_stored_views/ui.py @@ -1,4 +1,6 @@ -# gpl authors: nfloyd, Francesco Siddi +# SPDX-License-Identifier: GPL-2.0-or-later + +# Authors: nfloyd, Francesco Siddi import logging module_logger = logging.getLogger(__name__) diff --git a/sun_position/__init__.py b/sun_position/__init__.py index e59a0932..34808dd4 100644 --- a/sun_position/__init__.py +++ b/sun_position/__init__.py @@ -1,20 +1,4 @@ -### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # -------------------------------------------------------------------------- # The sun positioning algorithms are based on the National Oceanic diff --git a/sun_position/geo.py b/sun_position/geo.py index 72404195..d2844a7f 100644 --- a/sun_position/geo.py +++ b/sun_position/geo.py @@ -1,24 +1,10 @@ #!/usr/bin/env python -# +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright 2010 Maximilian Hoegner <hp.maxi@hoegners.de>. + # geo.py is a python module with no dependencies on extra packages, # providing some convenience functions for working with geographic # coordinates -# -# Copyright (C) 2010 Maximilian Hoegner <hp.maxi@hoegners.de> -# -# 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 3 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, see <http://www.gnu.org/licenses/>. -# ### Part one - Functions for dealing with points on a sphere ### diff --git a/sun_position/hdr.py b/sun_position/hdr.py index e117e3b3..a80b0e76 100644 --- a/sun_position/hdr.py +++ b/sun_position/hdr.py @@ -1,20 +1,4 @@ -### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # -*- coding: utf-8 -*- diff --git a/sun_position/north.py b/sun_position/north.py index 0c0a41af..c343df05 100644 --- a/sun_position/north.py +++ b/sun_position/north.py @@ -1,20 +1,4 @@ -### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy import math diff --git a/sun_position/properties.py b/sun_position/properties.py index 8d505414..ef3a21e3 100644 --- a/sun_position/properties.py +++ b/sun_position/properties.py @@ -1,20 +1,4 @@ -### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.types import AddonPreferences, PropertyGroup diff --git a/sun_position/sun_calc.py b/sun_position/sun_calc.py index 26161888..39c8444e 100644 --- a/sun_position/sun_calc.py +++ b/sun_position/sun_calc.py @@ -1,20 +1,4 @@ -### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.app.handlers import persistent diff --git a/sun_position/ui_sun.py b/sun_position/ui_sun.py index 49f04e33..1f4f8f34 100644 --- a/sun_position/ui_sun.py +++ b/sun_position/ui_sun.py @@ -1,20 +1,4 @@ -### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later import bpy from bpy.types import Operator, Menu diff --git a/system_blend_info.py b/system_blend_info.py index 03522d2b..b8e79a6f 100644 --- a/system_blend_info.py +++ b/system_blend_info.py @@ -1,24 +1,7 @@ -# scene_blend_info.py Copyright (C) 2010, Mariano Hidalgo -# +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright 2010 Mariano Hidalgo + # Show Information About the Blend. -# ***** 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 LICENCE BLOCK ***** bl_info = { "name": "Scene Information", diff --git a/system_demo_mode/__init__.py b/system_demo_mode/__init__.py index 88a052f1..819b0ba3 100644 --- a/system_demo_mode/__init__.py +++ b/system_demo_mode/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/system_demo_mode/config.py b/system_demo_mode/config.py index b3a7aad4..8b2d6e13 100644 --- a/system_demo_mode/config.py +++ b/system_demo_mode/config.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/system_demo_mode/demo_mode.py b/system_demo_mode/demo_mode.py index d03dc493..6060bf00 100644 --- a/system_demo_mode/demo_mode.py +++ b/system_demo_mode/demo_mode.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/system_property_chart.py b/system_property_chart.py index 4eeeb48e..9284874a 100644 --- a/system_property_chart.py +++ b/system_property_chart.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/ui_translate/__init__.py b/ui_translate/__init__.py index a03fb56b..06c91430 100644 --- a/ui_translate/__init__.py +++ b/ui_translate/__init__.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/ui_translate/edit_translation.py b/ui_translate/edit_translation.py index b42560d4..5f9301ef 100644 --- a/ui_translate/edit_translation.py +++ b/ui_translate/edit_translation.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/ui_translate/settings.py b/ui_translate/settings.py index 97bddbc3..e9de6537 100644 --- a/ui_translate/settings.py +++ b/ui_translate/settings.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/ui_translate/update_addon.py b/ui_translate/update_addon.py index 2eedc897..2beed9d3 100644 --- a/ui_translate/update_addon.py +++ b/ui_translate/update_addon.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/ui_translate/update_svn.py b/ui_translate/update_svn.py index 0c362d1e..38778909 100644 --- a/ui_translate/update_svn.py +++ b/ui_translate/update_svn.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/ui_translate/update_ui.py b/ui_translate/update_ui.py index cab6ef6b..80a4d3f5 100644 --- a/ui_translate/update_ui.py +++ b/ui_translate/update_ui.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/viewport_vr_preview/__init__.py b/viewport_vr_preview/__init__.py index 352470ca..d5736fed 100644 --- a/viewport_vr_preview/__init__.py +++ b/viewport_vr_preview/__init__.py @@ -1,28 +1,12 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> bl_info = { "name": "VR Scene Inspection", "author": "Julian Eisel (Severin), Sebastian Koenig, Peter Kim (muxed-reality)", - "version": (0, 10, 0), - "blender": (3, 0, 0), + "version": (0, 11, 0), + "blender": (3, 2, 0), "location": "3D View > Sidebar > VR", "description": ("View the viewport with virtual reality glasses " "(head-mounted displays)"), diff --git a/viewport_vr_preview/action_map.py b/viewport_vr_preview/action_map.py index f0ffc046..6c62c05d 100644 --- a/viewport_vr_preview/action_map.py +++ b/viewport_vr_preview/action_map.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -95,8 +79,11 @@ def vr_create_actions(context: bpy.context): if amb.name == defaults.VRDefaultActionbindings.REVERB_G2.value: if not scene.vr_actions_enable_reverb_g2: continue - elif amb.name == defaults.VRDefaultActionbindings.COSMOS.value: - if not scene.vr_actions_enable_cosmos: + elif amb.name == defaults.VRDefaultActionbindings.VIVE_COSMOS.value: + if not scene.vr_actions_enable_vive_cosmos: + continue + elif amb.name == defaults.VRDefaultActionbindings.VIVE_FOCUS.value: + if not scene.vr_actions_enable_vive_focus: continue elif amb.name == defaults.VRDefaultActionbindings.HUAWEI.value: if not scene.vr_actions_enable_huawei: @@ -146,10 +133,6 @@ def register(): default=False, update=vr_actions_use_gamepad_update, ) - bpy.types.Scene.vr_actions_enable_cosmos = bpy.props.BoolProperty( - description="Enable bindings for the HTC Vive Cosmos controllers. Note that this may not be supported by all OpenXR runtimes", - default=False, - ) bpy.types.Scene.vr_actions_enable_huawei = bpy.props.BoolProperty( description="Enable bindings for the Huawei controllers. Note that this may not be supported by all OpenXR runtimes", default=False, @@ -158,6 +141,14 @@ def register(): description="Enable bindings for the HP Reverb G2 controllers. Note that this may not be supported by all OpenXR runtimes", default=False, ) + bpy.types.Scene.vr_actions_enable_vive_cosmos = bpy.props.BoolProperty( + description="Enable bindings for the HTC Vive Cosmos controllers. Note that this may not be supported by all OpenXR runtimes", + default=False, + ) + bpy.types.Scene.vr_actions_enable_vive_focus = bpy.props.BoolProperty( + description="Enable bindings for the HTC Vive Focus 3 controllers. Note that this may not be supported by all OpenXR runtimes", + default=False, + ) bpy.app.handlers.xr_session_start_pre.append(vr_create_actions) @@ -165,8 +156,9 @@ def register(): def unregister(): del bpy.types.Scene.vr_actions_enable del bpy.types.Scene.vr_actions_use_gamepad - del bpy.types.Scene.vr_actions_enable_cosmos del bpy.types.Scene.vr_actions_enable_huawei del bpy.types.Scene.vr_actions_enable_reverb_g2 + del bpy.types.Scene.vr_actions_enable_vive_cosmos + del bpy.types.Scene.vr_actions_enable_vive_focus bpy.app.handlers.xr_session_start_pre.remove(vr_create_actions) diff --git a/viewport_vr_preview/action_map_io.py b/viewport_vr_preview/action_map_io.py index fedea82e..072947b8 100644 --- a/viewport_vr_preview/action_map_io.py +++ b/viewport_vr_preview/action_map_io.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -52,13 +36,20 @@ def repr_f32(f): return "%.*f" % (i, f_test) return f_str + def ami_args_as_data(ami): s = [ f"\"type\": '{ami.type}'", - f"\"user_path0\": '{ami.user_path0}'", - f"\"user_path1\": '{ami.user_path1}'", ] + sup = f"\"user_paths\": [" + for user_path in ami.user_paths: + sup += f"'{user_path.path}', " + if len(ami.user_paths) > 0: + sup = sup[:-2] + sup += "]" + s.append(sup) + if ami.type == 'FLOAT' or ami.type == 'VECTOR2D': s.append(f"\"op\": '{ami.op}'") s.append(f"\"op_mode\": '{ami.op_mode}'") @@ -73,14 +64,14 @@ def ami_args_as_data(ami): s.append(f"\"pose_is_controller_grip\": '{ami.pose_is_controller_grip}'") s.append(f"\"pose_is_controller_aim\": '{ami.pose_is_controller_aim}'") - return "{" + ", ".join(s) + "}" def ami_data_from_args(ami, args): ami.type = args["type"] - ami.user_path0 = args["user_path0"] - ami.user_path1 = args["user_path1"] + + for path in args["user_paths"]: + ami.user_paths.new(path) if ami.type == 'FLOAT' or ami.type == 'VECTOR2D': ami.op = args["op"] @@ -150,10 +141,16 @@ def _ami_attrs_or_none(level, ami): def amb_args_as_data(amb, type): s = [ f"\"profile\": '{amb.profile}'", - f"\"component_path0\": '{amb.component_path0}'", - f"\"component_path1\": '{amb.component_path1}'", ] + scp = f"\"component_paths\": [" + for component_path in amb.component_paths: + scp += f"'{component_path.path}', " + if len(amb.component_paths) > 0: + scp = scp[:-2] + scp += "]" + s.append(scp) + if type == 'FLOAT' or type == 'VECTOR2D': s.append(f"\"threshold\": '{amb.threshold}'") if type == 'FLOAT': @@ -170,8 +167,9 @@ def amb_args_as_data(amb, type): def amb_data_from_args(amb, args, type): amb.profile = args["profile"] - amb.component_path0 = args["component_path0"] - amb.component_path1 = args["component_path1"] + + for path in args["component_paths"]: + amb.component_paths.new(path) if type == 'FLOAT' or type == 'VECTOR2D': amb.threshold = float(args["threshold"]) diff --git a/viewport_vr_preview/configs/default.py b/viewport_vr_preview/configs/default.py index a20c5c6d..f63d661c 100644 --- a/viewport_vr_preview/configs/default.py +++ b/viewport_vr_preview/configs/default.py @@ -1,137 +1,147 @@ -actionconfig_version = (3, 0, 39) +# SPDX-License-Identifier: GPL-2.0-or-later + +actionconfig_version = (3, 2, 3) actionconfig_data = \ [("blender_default", {"items": - [("controller_grip", {"type": 'POSE', "user_path0": '/user/hand/left', "user_path1": '/user/hand/right', "pose_is_controller_grip": 'True', "pose_is_controller_aim": 'False'}, None, + [("controller_grip", {"type": 'POSE', "user_paths": ['/user/hand/left', '/user/hand/right'], "pose_is_controller_grip": 'True', "pose_is_controller_aim": 'False'}, None, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/grip/pose', "component_path1": '/input/grip/pose', "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/grip/pose', "component_path1": '/input/grip/pose', "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), - ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/grip/pose', "component_path1": '/input/grip/pose', "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), - ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/input/grip/pose', "component_path1": '/input/grip/pose', "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), - ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/input/grip/pose', "component_path1": '/input/grip/pose', "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), - ("simple", {"profile": '/interaction_profiles/khr/simple_controller', "component_path0": '/input/grip/pose', "component_path1": '/input/grip/pose', "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), - ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_path0": '/input/grip/pose', "component_path1": '/input/grip/pose', "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), - ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_path0": '/input/grip/pose', "component_path1": '/input/grip/pose', "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("simple", {"profile": '/interaction_profiles/khr/simple_controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/grip/pose', '/input/grip/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), ], }, ), - ("controller_aim", {"type": 'POSE', "user_path0": '/user/hand/left', "user_path1": '/user/hand/right', "pose_is_controller_grip": 'False', "pose_is_controller_aim": 'True'}, None, + ("controller_aim", {"type": 'POSE', "user_paths": ['/user/hand/left', '/user/hand/right'], "pose_is_controller_grip": 'False', "pose_is_controller_aim": 'True'}, None, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/aim/pose', "component_path1": '/input/aim/pose', "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/aim/pose', "component_path1": '/input/aim/pose', "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), - ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/aim/pose', "component_path1": '/input/aim/pose', "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), - ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/input/aim/pose', "component_path1": '/input/aim/pose', "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), - ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/input/aim/pose', "component_path1": '/input/aim/pose', "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), - ("simple", {"profile": '/interaction_profiles/khr/simple_controller', "component_path0": '/input/aim/pose', "component_path1": '/input/aim/pose', "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), - ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_path0": '/input/aim/pose', "component_path1": '/input/aim/pose', "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), - ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_path0": '/input/aim/pose', "component_path1": '/input/aim/pose', "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("simple", {"profile": '/interaction_profiles/khr/simple_controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), + ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/aim/pose', '/input/aim/pose'], "pose_location": '(0.0, 0.0, 0.0)', "pose_rotation": '(0.0, 0.0, 0.0)'}), ], }, ), - ("teleport", {"type": 'FLOAT', "user_path0": '/user/hand/left', "user_path1": '/user/hand/right', "op": 'wm.xr_navigation_teleport', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, + ("teleport", {"type": 'FLOAT', "user_paths": ['/user/hand/left', '/user/hand/right'], "op": 'wm.xr_navigation_teleport', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, {"op_properties": [("interpolation", 0.9), ("color", (0.0, 1.0, 1.0, 1.0)), ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/trigger/value', "component_path1": '/input/trigger/value', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trigger/value', "component_path1": '/input/trigger/value', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/trigger/value', "component_path1": '/input/trigger/value', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/input/trigger/value', "component_path1": '/input/trigger/value', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/input/trigger/value', "component_path1": '/input/trigger/value', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("simple", {"profile": '/interaction_profiles/khr/simple_controller', "component_path0": '/input/select/click', "component_path1": '/input/select/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_path0": '/input/trigger/value', "component_path1": '/input/trigger/value', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_path0": '/input/trigger/value', "component_path1": '/input/trigger/value', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trigger/value', '/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/trigger/value', '/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/trigger/value', '/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/trigger/value', '/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("simple", {"profile": '/interaction_profiles/khr/simple_controller', "component_paths": ['/input/select/click', '/input/select/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/trigger/value', '/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/trigger/value', '/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/trigger/value', '/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/trigger/value', '/input/trigger/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ], }, ), - ("nav_grab", {"type": 'FLOAT', "user_path0": '/user/hand/left', "user_path1": '/user/hand/right', "op": 'wm.xr_navigation_grab', "op_mode": 'MODAL', "bimanual": 'True', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, + ("nav_grab", {"type": 'FLOAT', "user_paths": ['/user/hand/left', '/user/hand/right'], "op": 'wm.xr_navigation_grab', "op_mode": 'MODAL', "bimanual": 'True', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, {"op_properties": [("lock_rotation", True), ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/squeeze/click', "component_path1": '/input/squeeze/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/click', "component_path1": '/input/trackpad/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/squeeze/force', "component_path1": '/input/squeeze/force', "threshold": '0.5', "axis_region": 'ANY'}), - ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/input/squeeze/value', "component_path1": '/input/squeeze/value', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/input/squeeze/value', "component_path1": '/input/squeeze/value', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("simple", {"profile": '/interaction_profiles/khr/simple_controller', "component_path0": '/input/menu/click', "component_path1": '/input/menu/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_path0": '/input/squeeze/click', "component_path1": '/input/squeeze/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_path0": '/input/squeeze/click', "component_path1": '/input/squeeze/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/click', '/input/trackpad/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/squeeze/force', '/input/squeeze/force'], "threshold": '0.5', "axis_region": 'ANY'}), + ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/squeeze/value', '/input/squeeze/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/squeeze/value', '/input/squeeze/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("simple", {"profile": '/interaction_profiles/khr/simple_controller', "component_paths": ['/input/menu/click', '/input/menu/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/squeeze/click', '/input/squeeze/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/squeeze/click', '/input/squeeze/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/squeeze/click', '/input/squeeze/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/squeeze/click', '/input/squeeze/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ], }, ), - ("fly_forward", {"type": 'FLOAT', "user_path0": '/user/hand/left', "user_path1": '', "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, + ("fly_forward", {"type": 'FLOAT', "user_paths": ['/user/hand/left'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, {"op_properties": [("mode", 'VIEWER_FORWARD'), ("lock_location_z", True), ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_path0": '/input/trackpad/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ], }, ), - ("fly_back", {"type": 'FLOAT', "user_path0": '/user/hand/left', "user_path1": '', "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, + ("fly_back", {"type": 'FLOAT', "user_paths": ['/user/hand/left'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, {"op_properties": [("mode", 'VIEWER_BACK'), ("lock_location_z", True), ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_path0": '/input/trackpad/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ], }, ), - ("fly_left", {"type": 'FLOAT', "user_path0": '/user/hand/left', "user_path1": '', "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, + ("fly_left", {"type": 'FLOAT', "user_paths": ['/user/hand/left'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, {"op_properties": [("mode", 'VIEWER_LEFT'), ("lock_location_z", True), ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_path0": '/input/trackpad/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ], }, ), - ("fly_right", {"type": 'FLOAT', "user_path0": '/user/hand/left', "user_path1": '', "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, + ("fly_right", {"type": 'FLOAT', "user_paths": ['/user/hand/left'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, {"op_properties": [("mode", 'VIEWER_RIGHT'), ("lock_location_z", True), ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_path0": '/input/trackpad/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ], }, ), - ("fly_up", {"type": 'FLOAT', "user_path0": '/user/hand/right', "user_path1": '', "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, + ("fly_up", {"type": 'FLOAT', "user_paths": ['/user/hand/right'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, {"op_properties": [("mode", 'UP'), ("speed_min", 0.014), @@ -139,17 +149,18 @@ actionconfig_data = \ ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_path0": '/input/trackpad/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ], }, ), - ("fly_down", {"type": 'FLOAT', "user_path0": '/user/hand/right', "user_path1": '', "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, + ("fly_down", {"type": 'FLOAT', "user_paths": ['/user/hand/right'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, {"op_properties": [("mode", 'DOWN'), ("speed_min", 0.014), @@ -157,17 +168,18 @@ actionconfig_data = \ ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_path0": '/input/trackpad/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_path0": '/input/thumbstick/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/trackpad/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/thumbstick/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ], }, ), - ("fly_turnleft", {"type": 'FLOAT', "user_path0": '/user/hand/right', "user_path1": '', "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, + ("fly_turnleft", {"type": 'FLOAT', "user_paths": ['/user/hand/right'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, {"op_properties": [("mode", 'TURNLEFT'), ("speed_min", 0.01), @@ -175,17 +187,18 @@ actionconfig_data = \ ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_path0": '/input/trackpad/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), - ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ], }, ), - ("fly_turnright", {"type": 'FLOAT', "user_path0": '/user/hand/right', "user_path1": '', "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, + ("fly_turnright", {"type": 'FLOAT', "user_paths": ['/user/hand/right'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, {"op_properties": [("mode", 'TURNRIGHT'), ("speed_min", 0.01), @@ -193,17 +206,18 @@ actionconfig_data = \ ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_path0": '/input/trackpad/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), - ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_path0": '/input/thumbstick/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/trackpad/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/thumbstick/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ], }, ), - ("nav_reset", {"type": 'FLOAT', "user_path0": '/user/hand/left', "user_path1": '/user/hand/right', "op": 'wm.xr_navigation_reset', "op_mode": 'PRESS', "bimanual": 'False', "haptic_name": 'haptic', "haptic_match_user_paths": 'True', "haptic_duration": '0.30000001192092896', "haptic_frequency": '3000.0', "haptic_amplitude": '0.5', "haptic_mode": 'PRESS'}, + ("nav_reset", {"type": 'FLOAT', "user_paths": ['/user/hand/left', '/user/hand/right'], "op": 'wm.xr_navigation_reset', "op_mode": 'PRESS', "bimanual": 'False', "haptic_name": 'haptic', "haptic_match_user_paths": 'True', "haptic_duration": '0.30000001192092896', "haptic_frequency": '3000.0', "haptic_amplitude": '0.5', "haptic_mode": 'PRESS'}, {"op_properties": [("location", False), ("rotation", False), @@ -211,26 +225,28 @@ actionconfig_data = \ ], }, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/x/click', "component_path1": '/input/a/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/back/click', "component_path1": '/input/back/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/a/click', "component_path1": '/input/a/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/input/x/click', "component_path1": '/input/a/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/input/x/click', "component_path1": '/input/a/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_path0": '/input/menu/click', "component_path1": '/input/menu/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_path0": '/input/menu/click', "component_path1": '/input/menu/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/input/back/click', '/input/back/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/input/a/click', '/input/a/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/input/x/click', '/input/a/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/input/x/click', '/input/a/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/input/menu/click', '/input/menu/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/input/x/click', '/input/a/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/input/x/click', '/input/a/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/input/menu/click', '/input/menu/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ], }, ), - ("haptic", {"type": 'VIBRATION', "user_path0": '/user/hand/left', "user_path1": '/user/hand/right'}, None, + ("haptic", {"type": 'VIBRATION', "user_paths": ['/user/hand/left', '/user/hand/right']}, None, {"bindings": - [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/output/haptic', "component_path1": '/output/haptic'}), - ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/output/haptic', "component_path1": '/output/haptic'}), - ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/output/haptic', "component_path1": '/output/haptic'}), - ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/output/haptic', "component_path1": '/output/haptic'}), - ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/output/haptic', "component_path1": '/output/haptic'}), - ("simple", {"profile": '/interaction_profiles/khr/simple_controller', "component_path0": '/output/haptic', "component_path1": '/output/haptic'}), - ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_path0": '/output/haptic', "component_path1": '/output/haptic'}), - ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_path0": '/output/haptic', "component_path1": '/output/haptic'}), + [("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_paths": ['/output/haptic', '/output/haptic']}), + ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_paths": ['/output/haptic', '/output/haptic']}), + ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_paths": ['/output/haptic', '/output/haptic']}), + ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_paths": ['/output/haptic', '/output/haptic']}), + ("simple", {"profile": '/interaction_profiles/khr/simple_controller', "component_paths": ['/output/haptic', '/output/haptic']}), + ("vive", {"profile": '/interaction_profiles/htc/vive_controller', "component_paths": ['/output/haptic', '/output/haptic']}), + ("vive_cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_paths": ['/output/haptic', '/output/haptic']}), + ("vive_focus", {"profile": '/interaction_profiles/htc/vive_focus3_controller', "component_paths": ['/output/haptic', '/output/haptic']}), + ("wmr", {"profile": '/interaction_profiles/microsoft/motion_controller', "component_paths": ['/output/haptic', '/output/haptic']}), ], }, ), @@ -239,7 +255,7 @@ actionconfig_data = \ ), ("blender_default_gamepad", {"items": - [("teleport", {"type": 'FLOAT', "user_path0": '/user/gamepad', "user_path1": '', "op": 'wm.xr_navigation_teleport', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, + [("teleport", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_teleport', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, {"op_properties": [("interpolation", 0.9), ("from_viewer", True), @@ -247,61 +263,61 @@ actionconfig_data = \ ], }, {"bindings": - [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/trigger_right/value', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_paths": ['/input/trigger_right/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ], }, ), - ("fly", {"type": 'FLOAT', "user_path0": '/user/gamepad', "user_path1": '', "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, None, + ("fly", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, None, {"bindings": - [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/trigger_left/value', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_paths": ['/input/trigger_left/value'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ], }, ), - ("fly_forward", {"type": 'FLOAT', "user_path0": '/user/gamepad', "user_path1": '', "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, + ("fly_forward", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, {"op_properties": [("mode", 'VIEWER_FORWARD'), ("lock_location_z", True), ], }, {"bindings": - [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/thumbstick_left/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_paths": ['/input/thumbstick_left/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ], }, ), - ("fly_back", {"type": 'FLOAT', "user_path0": '/user/gamepad', "user_path1": '', "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, + ("fly_back", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, {"op_properties": [("mode", 'VIEWER_BACK'), ("lock_location_z", True), ], }, {"bindings": - [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/thumbstick_left/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_paths": ['/input/thumbstick_left/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ], }, ), - ("fly_left", {"type": 'FLOAT', "user_path0": '/user/gamepad', "user_path1": '', "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, + ("fly_left", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, {"op_properties": [("mode", 'VIEWER_LEFT'), ("lock_location_z", True), ], }, {"bindings": - [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/thumbstick_left/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_paths": ['/input/thumbstick_left/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ], }, ), - ("fly_right", {"type": 'FLOAT', "user_path0": '/user/gamepad', "user_path1": '', "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, + ("fly_right", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, {"op_properties": [("mode", 'VIEWER_RIGHT'), ("lock_location_z", True), ], }, {"bindings": - [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/thumbstick_left/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_paths": ['/input/thumbstick_left/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ], }, ), - ("fly_up", {"type": 'FLOAT', "user_path0": '/user/gamepad', "user_path1": '', "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, + ("fly_up", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, {"op_properties": [("mode", 'UP'), ("speed_min", 0.014), @@ -309,11 +325,11 @@ actionconfig_data = \ ], }, {"bindings": - [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/thumbstick_right/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_paths": ['/input/thumbstick_right/y'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ], }, ), - ("fly_down", {"type": 'FLOAT', "user_path0": '/user/gamepad', "user_path1": '', "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, + ("fly_down", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, {"op_properties": [("mode", 'DOWN'), ("speed_min", 0.014), @@ -321,11 +337,11 @@ actionconfig_data = \ ], }, {"bindings": - [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/thumbstick_right/y', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_paths": ['/input/thumbstick_right/y'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ], }, ), - ("fly_turnleft", {"type": 'FLOAT', "user_path0": '/user/gamepad', "user_path1": '', "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, + ("fly_turnleft", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, {"op_properties": [("mode", 'TURNLEFT'), ("speed_min", 0.01), @@ -333,11 +349,11 @@ actionconfig_data = \ ], }, {"bindings": - [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/thumbstick_right/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), + [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_paths": ['/input/thumbstick_right/x'], "threshold": '0.30000001192092896', "axis_region": 'NEGATIVE'}), ], }, ), - ("fly_turnright", {"type": 'FLOAT', "user_path0": '/user/gamepad', "user_path1": '', "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, + ("fly_turnright", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_fly', "op_mode": 'MODAL', "bimanual": 'False', "haptic_name": '', "haptic_match_user_paths": 'False', "haptic_duration": '0.0', "haptic_frequency": '0.0', "haptic_amplitude": '0.0', "haptic_mode": 'PRESS'}, {"op_properties": [("mode", 'TURNRIGHT'), ("speed_min", 0.01), @@ -345,11 +361,11 @@ actionconfig_data = \ ], }, {"bindings": - [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/thumbstick_right/x', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), + [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_paths": ['/input/thumbstick_right/x'], "threshold": '0.30000001192092896', "axis_region": 'POSITIVE'}), ], }, ), - ("nav_reset", {"type": 'FLOAT', "user_path0": '/user/gamepad', "user_path1": '', "op": 'wm.xr_navigation_reset', "op_mode": 'PRESS', "bimanual": 'False', "haptic_name": 'haptic_right', "haptic_match_user_paths": 'True', "haptic_duration": '0.30000001192092896', "haptic_frequency": '3000.0', "haptic_amplitude": '0.5', "haptic_mode": 'PRESS'}, + ("nav_reset", {"type": 'FLOAT', "user_paths": ['/user/gamepad'], "op": 'wm.xr_navigation_reset', "op_mode": 'PRESS', "bimanual": 'False', "haptic_name": 'haptic_right', "haptic_match_user_paths": 'True', "haptic_duration": '0.30000001192092896', "haptic_frequency": '3000.0', "haptic_amplitude": '0.5', "haptic_mode": 'PRESS'}, {"op_properties": [("location", False), ("rotation", False), @@ -357,31 +373,31 @@ actionconfig_data = \ ], }, {"bindings": - [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/input/a/click', "component_path1": '', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_paths": ['/input/a/click'], "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ], }, ), - ("haptic_left", {"type": 'VIBRATION', "user_path0": '/user/gamepad', "user_path1": ''}, None, + ("haptic_left", {"type": 'VIBRATION', "user_paths": ['/user/gamepad']}, None, {"bindings": - [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/output/haptic_left', "component_path1": ''}), + [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_paths": ['/output/haptic_left']}), ], }, ), - ("haptic_right", {"type": 'VIBRATION', "user_path0": '/user/gamepad', "user_path1": ''}, None, + ("haptic_right", {"type": 'VIBRATION', "user_paths": ['/user/gamepad']}, None, {"bindings": - [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/output/haptic_right', "component_path1": ''}), + [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_paths": ['/output/haptic_right']}), ], }, ), - ("haptic_lefttrigger", {"type": 'VIBRATION', "user_path0": '/user/gamepad', "user_path1": ''}, None, + ("haptic_lefttrigger", {"type": 'VIBRATION', "user_paths": ['/user/gamepad']}, None, {"bindings": - [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/output/haptic_left_trigger', "component_path1": ''}), + [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_paths": ['/output/haptic_left_trigger']}), ], }, ), - ("haptic_righttrigger", {"type": 'VIBRATION', "user_path0": '/user/gamepad', "user_path1": ''}, None, + ("haptic_righttrigger", {"type": 'VIBRATION', "user_paths": ['/user/gamepad']}, None, {"bindings": - [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_path0": '/output/haptic_right_trigger', "component_path1": ''}), + [("gamepad", {"profile": '/interaction_profiles/microsoft/xbox_controller', "component_paths": ['/output/haptic_right_trigger']}), ], }, ), diff --git a/viewport_vr_preview/defaults.py b/viewport_vr_preview/defaults.py index 2543cd03..b8e76743 100644 --- a/viewport_vr_preview/defaults.py +++ b/viewport_vr_preview/defaults.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -62,7 +46,6 @@ class VRDefaultActions(Enum): # Default action bindings. class VRDefaultActionbindings(Enum): - COSMOS = "cosmos" GAMEPAD = "gamepad" HUAWEI = "huawei" INDEX = "index" @@ -70,11 +53,12 @@ class VRDefaultActionbindings(Enum): REVERB_G2 = "reverb_g2" SIMPLE = "simple" VIVE = "vive" + VIVE_COSMOS = "vive_cosmos" + VIVE_FOCUS = "vive_focus" WMR = "wmr" class VRDefaultActionprofiles(Enum): - COSMOS = "/interaction_profiles/htc/vive_cosmos_controller" GAMEPAD = "/interaction_profiles/microsoft/xbox_controller" HUAWEI = "/interaction_profiles/huawei/controller" INDEX = "/interaction_profiles/valve/index_controller" @@ -82,6 +66,8 @@ class VRDefaultActionprofiles(Enum): REVERB_G2 = "/interaction_profiles/hp/mixed_reality_controller" SIMPLE = "/interaction_profiles/khr/simple_controller" VIVE = "/interaction_profiles/htc/vive_controller" + VIVE_COSMOS = "/interaction_profiles/htc/vive_cosmos_controller" + VIVE_FOCUS = "/interaction_profiles/htc/vive_focus3_controller" WMR = "/interaction_profiles/microsoft/motion_controller" @@ -93,8 +79,7 @@ def vr_defaults_actionmap_add(session_state, name): def vr_defaults_action_add(am, name, - user_path0, - user_path1, + user_paths, op, op_mode, bimanual, @@ -109,8 +94,8 @@ def vr_defaults_action_add(am, ami = am.actionmap_items.new(name, True) if ami: ami.type = 'FLOAT' - ami.user_path0 = user_path0 - ami.user_path1 = user_path1 + for path in user_paths: + ami.user_paths.new(path) ami.op = op ami.op_mode = op_mode ami.bimanual = bimanual @@ -126,15 +111,14 @@ def vr_defaults_action_add(am, def vr_defaults_pose_action_add(am, name, - user_path0, - user_path1, + user_paths, is_controller_grip, is_controller_aim): ami = am.actionmap_items.new(name, True) if ami: ami.type = 'POSE' - ami.user_path0 = user_path0 - ami.user_path1 = user_path1 + for path in user_paths: + ami.user_paths.new(path) ami.pose_is_controller_grip = is_controller_grip ami.pose_is_controller_aim = is_controller_aim @@ -143,13 +127,12 @@ def vr_defaults_pose_action_add(am, def vr_defaults_haptic_action_add(am, name, - user_path0, - user_path1): + user_paths): ami = am.actionmap_items.new(name, True) if ami: ami.type = 'VIBRATION' - ami.user_path0 = user_path0 - ami.user_path1 = user_path1 + for path in user_paths: + ami.user_paths.new(path) return ami @@ -157,16 +140,15 @@ def vr_defaults_haptic_action_add(am, def vr_defaults_actionbinding_add(ami, name, profile, - component_path0, - component_path1, + component_paths, threshold, axis0_region, axis1_region): amb = ami.bindings.new(name, True) if amb: amb.profile = profile - amb.component_path0 = component_path0 - amb.component_path1 = component_path1 + for path in component_paths: + amb.component_paths.new(path) amb.threshold = threshold amb.axis0_region = axis0_region amb.axis1_region = axis1_region @@ -177,15 +159,14 @@ def vr_defaults_actionbinding_add(ami, def vr_defaults_pose_actionbinding_add(ami, name, profile, - component_path0, - component_path1, + component_paths, location, rotation): amb = ami.bindings.new(name, True) if amb: amb.profile = profile - amb.component_path0 = component_path0 - amb.component_path1 = component_path1 + for path in component_paths: + amb.component_paths.new(path) amb.pose_location = location amb.pose_rotation = rotation @@ -195,14 +176,12 @@ def vr_defaults_pose_actionbinding_add(ami, def vr_defaults_haptic_actionbinding_add(ami, name, profile, - component_path0, - component_path1): + component_paths): amb = ami.bindings.new(name, True) if amb: amb.profile = profile - amb.component_path0 = component_path0 - amb.component_path1 = component_path1 - + for path in component_paths: + amb.component_paths.new(path) return amb @@ -215,136 +194,150 @@ def vr_defaults_create_default(session_state): ami = vr_defaults_pose_action_add(am, VRDefaultActions.CONTROLLER_GRIP.value, - "/user/hand/left", - "/user/hand/right", + ["/user/hand/left", + "/user/hand/right"], True, False) if ami: vr_defaults_pose_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - "/input/grip/pose", - "/input/grip/pose", - (0, 0, 0), - (0, 0, 0)) - vr_defaults_pose_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, - "/input/grip/pose", - "/input/grip/pose", + ["/input/grip/pose", + "/input/grip/pose"], (0, 0, 0), (0, 0, 0)) vr_defaults_pose_actionbinding_add(ami, VRDefaultActionbindings.INDEX.value, VRDefaultActionprofiles.INDEX.value, - "/input/grip/pose", - "/input/grip/pose", + ["/input/grip/pose", + "/input/grip/pose"], (0, 0, 0), (0, 0, 0)) vr_defaults_pose_actionbinding_add(ami, VRDefaultActionbindings.OCULUS.value, VRDefaultActionprofiles.OCULUS.value, - "/input/grip/pose", - "/input/grip/pose", + ["/input/grip/pose", + "/input/grip/pose"], (0, 0, 0), (0, 0, 0)) vr_defaults_pose_actionbinding_add(ami, VRDefaultActionbindings.REVERB_G2.value, VRDefaultActionprofiles.REVERB_G2.value, - "/input/grip/pose", - "/input/grip/pose", + ["/input/grip/pose", + "/input/grip/pose"], (0, 0, 0), (0, 0, 0)) vr_defaults_pose_actionbinding_add(ami, VRDefaultActionbindings.SIMPLE.value, VRDefaultActionprofiles.SIMPLE.value, - "/input/grip/pose", - "/input/grip/pose", + ["/input/grip/pose", + "/input/grip/pose"], (0, 0, 0), (0, 0, 0)) vr_defaults_pose_actionbinding_add(ami, VRDefaultActionbindings.VIVE.value, VRDefaultActionprofiles.VIVE.value, - "/input/grip/pose", - "/input/grip/pose", + ["/input/grip/pose", + "/input/grip/pose"], + (0, 0, 0), + (0, 0, 0)) + vr_defaults_pose_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/grip/pose", + "/input/grip/pose"], + (0, 0, 0), + (0, 0, 0)) + vr_defaults_pose_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/grip/pose", + "/input/grip/pose"], (0, 0, 0), (0, 0, 0)) vr_defaults_pose_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, - "/input/grip/pose", - "/input/grip/pose", + ["/input/grip/pose", + "/input/grip/pose"], (0, 0, 0), (0, 0, 0)) ami = vr_defaults_pose_action_add(am, VRDefaultActions.CONTROLLER_AIM.value, - "/user/hand/left", - "/user/hand/right", + ["/user/hand/left", + "/user/hand/right"], False, True) if ami: vr_defaults_pose_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - "/input/aim/pose", - "/input/aim/pose", - (0, 0, 0), - (0, 0, 0)) - vr_defaults_pose_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, - "/input/aim/pose", - "/input/aim/pose", + ["/input/aim/pose", + "/input/aim/pose"], (0, 0, 0), (0, 0, 0)) vr_defaults_pose_actionbinding_add(ami, VRDefaultActionbindings.INDEX.value, VRDefaultActionprofiles.INDEX.value, - "/input/aim/pose", - "/input/aim/pose", + ["/input/aim/pose", + "/input/aim/pose"], (0, 0, 0), (0, 0, 0)) vr_defaults_pose_actionbinding_add(ami, VRDefaultActionbindings.OCULUS.value, VRDefaultActionprofiles.OCULUS.value, - "/input/aim/pose", - "/input/aim/pose", + ["/input/aim/pose", + "/input/aim/pose"], (0, 0, 0), (0, 0, 0)) vr_defaults_pose_actionbinding_add(ami, VRDefaultActionbindings.REVERB_G2.value, VRDefaultActionprofiles.REVERB_G2.value, - "/input/aim/pose", - "/input/aim/pose", + ["/input/aim/pose", + "/input/aim/pose"], (0, 0, 0), (0, 0, 0)) vr_defaults_pose_actionbinding_add(ami, VRDefaultActionbindings.SIMPLE.value, VRDefaultActionprofiles.SIMPLE.value, - "/input/aim/pose", - "/input/aim/pose", + ["/input/aim/pose", + "/input/aim/pose"], (0, 0, 0), (0, 0, 0)) vr_defaults_pose_actionbinding_add(ami, VRDefaultActionbindings.VIVE.value, VRDefaultActionprofiles.VIVE.value, - "/input/aim/pose", - "/input/aim/pose", + ["/input/aim/pose", + "/input/aim/pose"], + (0, 0, 0), + (0, 0, 0)) + vr_defaults_pose_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/aim/pose", + "/input/aim/pose"], + (0, 0, 0), + (0, 0, 0)) + vr_defaults_pose_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/aim/pose", + "/input/aim/pose"], (0, 0, 0), (0, 0, 0)) vr_defaults_pose_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, - "/input/aim/pose", - "/input/aim/pose", + ["/input/aim/pose", + "/input/aim/pose"], (0, 0, 0), (0, 0, 0)) ami = vr_defaults_action_add(am, VRDefaultActions.TELEPORT.value, - "/user/hand/left", - "/user/hand/right", + ["/user/hand/left", + "/user/hand/right"], "wm.xr_navigation_teleport", 'MODAL', False, @@ -356,74 +349,82 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - "/input/trigger/value", - "/input/trigger/value", - 0.3, - 'ANY', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, - "/input/trigger/value", - "/input/trigger/value", + ["/input/trigger/value", + "/input/trigger/value"], 0.3, 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.INDEX.value, VRDefaultActionprofiles.INDEX.value, - "/input/trigger/value", - "/input/trigger/value", + ["/input/trigger/value", + "/input/trigger/value"], 0.3, 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.OCULUS.value, VRDefaultActionprofiles.OCULUS.value, - "/input/trigger/value", - "/input/trigger/value", + ["/input/trigger/value", + "/input/trigger/value"], 0.3, 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.REVERB_G2.value, VRDefaultActionprofiles.REVERB_G2.value, - "/input/trigger/value", - "/input/trigger/value", + ["/input/trigger/value", + "/input/trigger/value"], 0.3, 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.SIMPLE.value, VRDefaultActionprofiles.SIMPLE.value, - "/input/select/click", - "/input/select/click", + ["/input/select/click", + "/input/select/click"], 0.3, 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.VIVE.value, VRDefaultActionprofiles.VIVE.value, - "/input/trigger/value", - "/input/trigger/value", + ["/input/trigger/value", + "/input/trigger/value"], + 0.3, + 'ANY', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/trigger/value", + "/input/trigger/value"], + 0.3, + 'ANY', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/trigger/value", + "/input/trigger/value"], 0.3, 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, - "/input/trigger/value", - "/input/trigger/value", + ["/input/trigger/value", + "/input/trigger/value"], 0.3, 'ANY', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.NAV_GRAB.value, - "/user/hand/left", - "/user/hand/right", + ["/user/hand/left", + "/user/hand/right"], "wm.xr_navigation_grab", 'MODAL', True, @@ -435,74 +436,81 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - "/input/squeeze/click", - "/input/squeeze/click", - 0.3, - 'ANY', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, - "/input/trackpad/click", - "/input/trackpad/click", + ["/input/trackpad/click", + "/input/trackpad/click"], 0.3, 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.INDEX.value, VRDefaultActionprofiles.INDEX.value, - "/input/squeeze/force", - "/input/squeeze/force", + ["/input/squeeze/force", + "/input/squeeze/force"], 0.5, 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.OCULUS.value, VRDefaultActionprofiles.OCULUS.value, - "/input/squeeze/value", - "/input/squeeze/value", + ["/input/squeeze/value", + "/input/squeeze/value"], 0.3, 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.REVERB_G2.value, VRDefaultActionprofiles.REVERB_G2.value, - "/input/squeeze/value", - "/input/squeeze/value", + ["/input/squeeze/value", + "/input/squeeze/value"], 0.3, 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.SIMPLE.value, VRDefaultActionprofiles.SIMPLE.value, - "/input/menu/click", - "/input/menu/click", + ["/input/menu/click", + "/input/menu/click"], 0.3, 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.VIVE.value, VRDefaultActionprofiles.VIVE.value, - "/input/squeeze/click", - "/input/squeeze/click", + ["/input/squeeze/click", + "/input/squeeze/click"], + 0.3, + 'ANY', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/squeeze/click", + "/input/squeeze/click"], + 0.3, + 'ANY', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/squeeze/click", + "/input/squeeze/click"], 0.3, 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, - "/input/squeeze/click", - "/input/squeeze/click", + ["/input/squeeze/click", + "/input/squeeze/click"], 0.3, 'ANY', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.FLY_FORWARD.value, - "/user/hand/left", - "", + ["/user/hand/left"], "wm.xr_navigation_fly", 'MODAL', False, @@ -514,66 +522,65 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - "/input/thumbstick/y", - "", - 0.3, - 'POSITIVE', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, - "/input/trackpad/y", - "", + ["/input/trackpad/y"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.INDEX.value, VRDefaultActionprofiles.INDEX.value, - "/input/thumbstick/y", - "", + ["/input/thumbstick/y"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.OCULUS.value, VRDefaultActionprofiles.OCULUS.value, - "/input/thumbstick/y", - "", + ["/input/thumbstick/y"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.REVERB_G2.value, VRDefaultActionprofiles.REVERB_G2.value, - "/input/thumbstick/y", - "", + ["/input/thumbstick/y"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.VIVE.value, VRDefaultActionprofiles.VIVE.value, - "/input/trackpad/y", - "", + ["/input/trackpad/y"], + 0.3, + 'POSITIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/thumbstick/y"], + 0.3, + 'POSITIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/thumbstick/y"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, - "/input/thumbstick/y", - "", + ["/input/thumbstick/y"], 0.3, 'POSITIVE', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.FLY_BACK.value, - "/user/hand/left", - "", + ["/user/hand/left"], "wm.xr_navigation_fly", 'MODAL', False, @@ -585,66 +592,65 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - "/input/thumbstick/y", - "", - 0.3, - 'NEGATIVE', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, - "/input/trackpad/y", - "", + ["/input/trackpad/y"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.INDEX.value, VRDefaultActionprofiles.INDEX.value, - "/input/thumbstick/y", - "", + ["/input/thumbstick/y"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.OCULUS.value, VRDefaultActionprofiles.OCULUS.value, - "/input/thumbstick/y", - "", + ["/input/thumbstick/y"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.REVERB_G2.value, VRDefaultActionprofiles.REVERB_G2.value, - "/input/thumbstick/y", - "", + ["/input/thumbstick/y"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.VIVE.value, VRDefaultActionprofiles.VIVE.value, - "/input/trackpad/y", - "", + ["/input/trackpad/y"], + 0.3, + 'NEGATIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/thumbstick/y"], + 0.3, + 'NEGATIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/thumbstick/y"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, - "/input/thumbstick/y", - "", + ["/input/thumbstick/y"], 0.3, 'NEGATIVE', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.FLY_LEFT.value, - "/user/hand/left", - "", + ["/user/hand/left"], "wm.xr_navigation_fly", 'MODAL', False, @@ -656,66 +662,65 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - "/input/thumbstick/x", - "", - 0.3, - 'NEGATIVE', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, - "/input/trackpad/x", - "", + ["/input/trackpad/x"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.INDEX.value, VRDefaultActionprofiles.INDEX.value, - "/input/thumbstick/x", - "", + ["/input/thumbstick/x"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.OCULUS.value, VRDefaultActionprofiles.OCULUS.value, - "/input/thumbstick/x", - "", + ["/input/thumbstick/x"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.REVERB_G2.value, VRDefaultActionprofiles.REVERB_G2.value, - "/input/thumbstick/x", - "", + ["/input/thumbstick/x"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.VIVE.value, VRDefaultActionprofiles.VIVE.value, - "/input/trackpad/x", - "", + ["/input/trackpad/x"], + 0.3, + 'NEGATIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/thumbstick/x"], + 0.3, + 'NEGATIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/thumbstick/x"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, - "/input/thumbstick/x", - "", + ["/input/thumbstick/x"], 0.3, 'NEGATIVE', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.FLY_RIGHT.value, - "/user/hand/left", - "", + ["/user/hand/left"], "wm.xr_navigation_fly", 'MODAL', False, @@ -727,66 +732,65 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - "/input/thumbstick/x", - "", - 0.3, - 'POSITIVE', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, - "/input/trackpad/x", - "", + ["/input/trackpad/x"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.INDEX.value, VRDefaultActionprofiles.INDEX.value, - "/input/thumbstick/x", - "", + ["/input/thumbstick/x"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.OCULUS.value, VRDefaultActionprofiles.OCULUS.value, - "/input/thumbstick/x", - "", + ["/input/thumbstick/x"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.REVERB_G2.value, VRDefaultActionprofiles.REVERB_G2.value, - "/input/thumbstick/x", - "", + ["/input/thumbstick/x"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.VIVE.value, VRDefaultActionprofiles.VIVE.value, - "/input/trackpad/x", - "", + ["/input/trackpad/x"], + 0.3, + 'POSITIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/thumbstick/x"], + 0.3, + 'POSITIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/thumbstick/x"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, - "/input/thumbstick/x", - "", + ["/input/thumbstick/x"], 0.3, 'POSITIVE', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.FLY_UP.value, - "/user/hand/right", - "", + ["/user/hand/right"], "wm.xr_navigation_fly", 'MODAL', False, @@ -798,66 +802,65 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - "/input/thumbstick/y", - "", - 0.3, - 'POSITIVE', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, - "/input/trackpad/y", - "", + ["/input/trackpad/y"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.INDEX.value, VRDefaultActionprofiles.INDEX.value, - "/input/thumbstick/y", - "", + ["/input/thumbstick/y"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.OCULUS.value, VRDefaultActionprofiles.OCULUS.value, - "/input/thumbstick/y", - "", + ["/input/thumbstick/y"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.REVERB_G2.value, VRDefaultActionprofiles.REVERB_G2.value, - "/input/thumbstick/y", - "", + ["/input/thumbstick/y"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.VIVE.value, VRDefaultActionprofiles.VIVE.value, - "/input/trackpad/y", - "", + ["/input/trackpad/y"], + 0.3, + 'POSITIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/thumbstick/y"], + 0.3, + 'POSITIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/thumbstick/y"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, - "/input/thumbstick/y", - "", + ["/input/thumbstick/y"], 0.3, 'POSITIVE', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.FLY_DOWN.value, - "/user/hand/right", - "", + ["/user/hand/right"], "wm.xr_navigation_fly", 'MODAL', False, @@ -869,66 +872,65 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - "/input/thumbstick/y", - "", - 0.3, - 'NEGATIVE', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, - "/input/trackpad/y", - "", + ["/input/trackpad/y"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.INDEX.value, VRDefaultActionprofiles.INDEX.value, - "/input/thumbstick/y", - "", + ["/input/thumbstick/y"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.OCULUS.value, VRDefaultActionprofiles.OCULUS.value, - "/input/thumbstick/y", - "", + ["/input/thumbstick/y"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.REVERB_G2.value, VRDefaultActionprofiles.REVERB_G2.value, - "/input/thumbstick/y", - "", + ["/input/thumbstick/y"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.VIVE.value, VRDefaultActionprofiles.VIVE.value, - "/input/trackpad/y", - "", + ["/input/trackpad/y"], + 0.3, + 'NEGATIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/thumbstick/y"], + 0.3, + 'NEGATIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/thumbstick/y"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, - "/input/thumbstick/y", - "", + ["/input/thumbstick/y"], 0.3, 'NEGATIVE', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.FLY_TURNLEFT.value, - "/user/hand/right", - "", + ["/user/hand/right"], "wm.xr_navigation_fly", 'MODAL', False, @@ -940,66 +942,65 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - "/input/thumbstick/x", - "", - 0.3, - 'NEGATIVE', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, - "/input/trackpad/x", - "", + ["/input/trackpad/x"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.INDEX.value, VRDefaultActionprofiles.INDEX.value, - "/input/thumbstick/x", - "", + ["/input/thumbstick/x"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.OCULUS.value, VRDefaultActionprofiles.OCULUS.value, - "/input/thumbstick/x", - "", + ["/input/thumbstick/x"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.REVERB_G2.value, VRDefaultActionprofiles.REVERB_G2.value, - "/input/thumbstick/x", - "", + ["/input/thumbstick/x"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.VIVE.value, VRDefaultActionprofiles.VIVE.value, - "/input/trackpad/x", - "", + ["/input/trackpad/x"], + 0.3, + 'NEGATIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/thumbstick/x"], + 0.3, + 'NEGATIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/thumbstick/x"], 0.3, 'NEGATIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, - "/input/thumbstick/x", - "", + ["/input/thumbstick/x"], 0.3, 'NEGATIVE', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.FLY_TURNRIGHT.value, - "/user/hand/right", - "", + ["/user/hand/right"], "wm.xr_navigation_fly", 'MODAL', False, @@ -1011,66 +1012,66 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - "/input/thumbstick/x", - "", - 0.3, - 'POSITIVE', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, - "/input/trackpad/x", - "", + ["/input/trackpad/x"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.INDEX.value, VRDefaultActionprofiles.INDEX.value, - "/input/thumbstick/x", - "", + ["/input/thumbstick/x"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.OCULUS.value, VRDefaultActionprofiles.OCULUS.value, - "/input/thumbstick/x", - "", + ["/input/thumbstick/x"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.REVERB_G2.value, VRDefaultActionprofiles.REVERB_G2.value, - "/input/thumbstick/x", - "", + ["/input/thumbstick/x"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.VIVE.value, VRDefaultActionprofiles.VIVE.value, - "/input/trackpad/x", - "", + ["/input/trackpad/x"], + 0.3, + 'POSITIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/thumbstick/x"], + 0.3, + 'POSITIVE', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/thumbstick/x"], 0.3, 'POSITIVE', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, - "/input/thumbstick/x", - "", + ["/input/thumbstick/x"], 0.3, 'POSITIVE', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.NAV_RESET.value, - "/user/hand/left", - "/user/hand/right", + ["/user/hand/left", + "/user/hand/right"], "wm.xr_navigation_reset", 'PRESS', False, @@ -1082,107 +1083,120 @@ def vr_defaults_create_default(session_state): 'PRESS') if ami: vr_defaults_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - "/input/x/click", - "/input/a/click", - 0.3, - 'ANY', - 'ANY') - vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, - "/input/back/click", - "/input/back/click", + ["/input/back/click", + "/input/back/click"], 0.3, 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.INDEX.value, VRDefaultActionprofiles.INDEX.value, - "/input/a/click", - "/input/a/click", + ["/input/a/click", + "/input/a/click"], 0.3, 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.OCULUS.value, VRDefaultActionprofiles.OCULUS.value, - "/input/x/click", - "/input/a/click", + ["/input/x/click", + "/input/a/click"], 0.3, 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.REVERB_G2.value, VRDefaultActionprofiles.REVERB_G2.value, - "/input/x/click", - "/input/a/click", + ["/input/x/click", + "/input/a/click"], 0.3, 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.VIVE.value, VRDefaultActionprofiles.VIVE.value, - "/input/menu/click", - "/input/menu/click", + ["/input/menu/click", + "/input/menu/click"], + 0.3, + 'ANY', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/input/x/click", + "/input/a/click"], + 0.3, + 'ANY', + 'ANY') + vr_defaults_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/input/x/click", + "/input/a/click"], 0.3, 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, - "/input/menu/click", - "/input/menu/click", + ["/input/menu/click", + "/input/menu/click"], 0.3, 'ANY', 'ANY') ami = vr_defaults_haptic_action_add(am, VRDefaultActions.HAPTIC.value, - "/user/hand/left", - "/user/hand/right") + ["/user/hand/left", + "/user/hand/right"]) if ami: vr_defaults_haptic_actionbinding_add(ami, - VRDefaultActionbindings.COSMOS.value, - VRDefaultActionprofiles.COSMOS.value, - "/output/haptic", - "/output/haptic") - vr_defaults_haptic_actionbinding_add(ami, VRDefaultActionbindings.HUAWEI.value, VRDefaultActionprofiles.HUAWEI.value, - "/output/haptic", - "/output/haptic") + ["/output/haptic", + "/output/haptic"]) vr_defaults_haptic_actionbinding_add(ami, VRDefaultActionbindings.INDEX.value, VRDefaultActionprofiles.INDEX.value, - "/output/haptic", - "/output/haptic") + ["/output/haptic", + "/output/haptic"]) vr_defaults_haptic_actionbinding_add(ami, VRDefaultActionbindings.OCULUS.value, VRDefaultActionprofiles.OCULUS.value, - "/output/haptic", - "/output/haptic") + ["/output/haptic", + "/output/haptic"]) vr_defaults_haptic_actionbinding_add(ami, VRDefaultActionbindings.REVERB_G2.value, VRDefaultActionprofiles.REVERB_G2.value, - "/output/haptic", - "/output/haptic") + ["/output/haptic", + "/output/haptic"]) vr_defaults_haptic_actionbinding_add(ami, VRDefaultActionbindings.SIMPLE.value, VRDefaultActionprofiles.SIMPLE.value, - "/output/haptic", - "/output/haptic") + ["/output/haptic", + "/output/haptic"]) vr_defaults_haptic_actionbinding_add(ami, VRDefaultActionbindings.VIVE.value, VRDefaultActionprofiles.VIVE.value, - "/output/haptic", - "/output/haptic") + ["/output/haptic", + "/output/haptic"]) + vr_defaults_haptic_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_COSMOS.value, + VRDefaultActionprofiles.VIVE_COSMOS.value, + ["/output/haptic", + "/output/haptic"]) + vr_defaults_haptic_actionbinding_add(ami, + VRDefaultActionbindings.VIVE_FOCUS.value, + VRDefaultActionprofiles.VIVE_FOCUS.value, + ["/output/haptic", + "/output/haptic"]) vr_defaults_haptic_actionbinding_add(ami, VRDefaultActionbindings.WMR.value, VRDefaultActionprofiles.WMR.value, - "/output/haptic", - "/output/haptic") + ["/output/haptic", + "/output/haptic"]) def vr_defaults_create_default_gamepad(session_state): @@ -1191,8 +1205,7 @@ def vr_defaults_create_default_gamepad(session_state): ami = vr_defaults_action_add(am, VRDefaultActions.TELEPORT.value, - "/user/gamepad", - "", + ["/user/gamepad"], "wm.xr_navigation_teleport", 'MODAL', False, @@ -1206,16 +1219,14 @@ def vr_defaults_create_default_gamepad(session_state): vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.GAMEPAD.value, VRDefaultActionprofiles.GAMEPAD.value, - "/input/trigger_right/value", - "", + ["/input/trigger_right/value"], 0.3, 'ANY', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.FLY.value, - "/user/gamepad", - "", + ["/user/gamepad"], "wm.xr_navigation_fly", 'MODAL', False, @@ -1229,16 +1240,14 @@ def vr_defaults_create_default_gamepad(session_state): vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.GAMEPAD.value, VRDefaultActionprofiles.GAMEPAD.value, - "/input/trigger_left/value", - "", + ["/input/trigger_left/value"], 0.3, 'ANY', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.FLY_FORWARD.value, - "/user/gamepad", - "", + ["/user/gamepad"], "wm.xr_navigation_fly", 'MODAL', False, @@ -1252,16 +1261,14 @@ def vr_defaults_create_default_gamepad(session_state): vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.GAMEPAD.value, VRDefaultActionprofiles.GAMEPAD.value, - "/input/thumbstick_left/y", - "", + ["/input/thumbstick_left/y"], 0.3, 'POSITIVE', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.FLY_BACK.value, - "/user/gamepad", - "", + ["/user/gamepad"], "wm.xr_navigation_fly", 'MODAL', False, @@ -1275,16 +1282,14 @@ def vr_defaults_create_default_gamepad(session_state): vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.GAMEPAD.value, VRDefaultActionprofiles.GAMEPAD.value, - "/input/thumbstick_left/y", - "", + ["/input/thumbstick_left/y"], 0.3, 'NEGATIVE', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.FLY_LEFT.value, - "/user/gamepad", - "", + ["/user/gamepad"], "wm.xr_navigation_fly", 'MODAL', False, @@ -1298,16 +1303,14 @@ def vr_defaults_create_default_gamepad(session_state): vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.GAMEPAD.value, VRDefaultActionprofiles.GAMEPAD.value, - "/input/thumbstick_left/x", - "", + ["/input/thumbstick_left/x"], 0.3, 'NEGATIVE', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.FLY_RIGHT.value, - "/user/gamepad", - "", + ["/user/gamepad"], "wm.xr_navigation_fly", 'MODAL', False, @@ -1321,16 +1324,14 @@ def vr_defaults_create_default_gamepad(session_state): vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.GAMEPAD.value, VRDefaultActionprofiles.GAMEPAD.value, - "/input/thumbstick_left/x", - "", + ["/input/thumbstick_left/x"], 0.3, 'POSITIVE', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.FLY_UP.value, - "/user/gamepad", - "", + ["/user/gamepad"], "wm.xr_navigation_fly", 'MODAL', False, @@ -1344,16 +1345,14 @@ def vr_defaults_create_default_gamepad(session_state): vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.GAMEPAD.value, VRDefaultActionprofiles.GAMEPAD.value, - "/input/thumbstick_right/y", - "", + ["/input/thumbstick_right/y"], 0.3, 'POSITIVE', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.FLY_DOWN.value, - "/user/gamepad", - "", + ["/user/gamepad"], "wm.xr_navigation_fly", 'MODAL', False, @@ -1367,16 +1366,14 @@ def vr_defaults_create_default_gamepad(session_state): vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.GAMEPAD.value, VRDefaultActionprofiles.GAMEPAD.value, - "/input/thumbstick_right/y", - "", + ["/input/thumbstick_right/y"], 0.3, 'NEGATIVE', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.FLY_TURNLEFT.value, - "/user/gamepad", - "", + ["/user/gamepad"], "wm.xr_navigation_fly", 'MODAL', False, @@ -1390,16 +1387,14 @@ def vr_defaults_create_default_gamepad(session_state): vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.GAMEPAD.value, VRDefaultActionprofiles.GAMEPAD.value, - "/input/thumbstick_right/x", - "", + ["/input/thumbstick_right/x"], 0.3, 'NEGATIVE', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.FLY_TURNRIGHT.value, - "/user/gamepad", - "", + ["/user/gamepad"], "wm.xr_navigation_fly", 'MODAL', False, @@ -1413,16 +1408,14 @@ def vr_defaults_create_default_gamepad(session_state): vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.GAMEPAD.value, VRDefaultActionprofiles.GAMEPAD.value, - "/input/thumbstick_right/x", - "", + ["/input/thumbstick_right/x"], 0.3, 'POSITIVE', 'ANY') ami = vr_defaults_action_add(am, VRDefaultActions.NAV_RESET.value, - "/user/gamepad", - "", + ["/user/gamepad"], "wm.xr_navigation_reset", 'PRESS', False, @@ -1436,55 +1429,46 @@ def vr_defaults_create_default_gamepad(session_state): vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.GAMEPAD.value, VRDefaultActionprofiles.GAMEPAD.value, - "/input/a/click", - "", + ["/input/a/click"], 0.3, 'ANY', 'ANY') ami =vr_defaults_haptic_action_add(am, VRDefaultActions.HAPTIC_LEFT.value, - "/user/gamepad", - "") + ["/user/gamepad"]) if ami: vr_defaults_haptic_actionbinding_add(ami, VRDefaultActionbindings.GAMEPAD.value, VRDefaultActionprofiles.GAMEPAD.value, - "/output/haptic_left", - "") + ["/output/haptic_left"]) ami =vr_defaults_haptic_action_add(am, VRDefaultActions.HAPTIC_RIGHT.value, - "/user/gamepad", - "") + ["/user/gamepad"]) if ami: vr_defaults_haptic_actionbinding_add(ami, VRDefaultActionbindings.GAMEPAD.value, VRDefaultActionprofiles.GAMEPAD.value, - "/output/haptic_right", - "") + ["/output/haptic_right"]) ami = vr_defaults_haptic_action_add(am, VRDefaultActions.HAPTIC_LEFTTRIGGER.value, - "/user/gamepad", - "") + ["/user/gamepad"]) if ami: vr_defaults_haptic_actionbinding_add(ami, VRDefaultActionbindings.GAMEPAD.value, VRDefaultActionprofiles.GAMEPAD.value, - "/output/haptic_left_trigger", - "") + ["/output/haptic_left_trigger"]) ami = vr_defaults_haptic_action_add(am, VRDefaultActions.HAPTIC_RIGHTTRIGGER.value, - "/user/gamepad", - "") + ["/user/gamepad"]) if ami: vr_defaults_haptic_actionbinding_add(ami, VRDefaultActionbindings.GAMEPAD.value, VRDefaultActionprofiles.GAMEPAD.value, - "/output/haptic_right_trigger", - "") + ["/output/haptic_right_trigger"]) def vr_get_default_config_path(): diff --git a/viewport_vr_preview/gui.py b/viewport_vr_preview/gui.py index 44d18d67..376e9de8 100644 --- a/viewport_vr_preview/gui.py +++ b/viewport_vr_preview/gui.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -104,6 +88,7 @@ class VIEW3D_MT_vr_landmark_menu(Menu): def draw(self, _context): layout = self.layout + layout.operator("view3d.vr_camera_landmark_from_session") layout.operator("view3d.vr_landmark_from_camera") layout.operator("view3d.update_vr_landmark") layout.separator() @@ -172,7 +157,7 @@ class VIEW3D_PT_vr_landmarks(Panel): "base_scale", text="Scale") -### View. +### Actions. class VIEW3D_PT_vr_actionmaps(Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'UI' @@ -192,7 +177,8 @@ class VIEW3D_PT_vr_actionmaps(Panel): col = layout.column(align=True, heading="Extensions") col.prop(scene, "vr_actions_enable_reverb_g2", text="HP Reverb G2") - col.prop(scene, "vr_actions_enable_cosmos", text="HTC Vive Cosmos") + col.prop(scene, "vr_actions_enable_vive_cosmos", text="HTC Vive Cosmos") + col.prop(scene, "vr_actions_enable_vive_focus", text="HTC Vive Focus") col.prop(scene, "vr_actions_enable_huawei", text="Huawei") diff --git a/viewport_vr_preview/operators.py b/viewport_vr_preview/operators.py index 7a19b9fb..67638ea4 100644 --- a/viewport_vr_preview/operators.py +++ b/viewport_vr_preview/operators.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> @@ -113,6 +97,39 @@ class VIEW3D_OT_vr_landmark_from_session(Operator): return {'FINISHED'} +class VIEW3D_OT_vr_camera_landmark_from_session(Operator): + bl_idname = "view3d.vr_camera_landmark_from_session" + bl_label = "Add Camera and VR Landmark from Session" + bl_description = "Create a new Camera and VR Landmark from the viewer pose of the running VR session and select it" + bl_options = {'UNDO', 'REGISTER'} + + @classmethod + def poll(cls, context): + return bpy.types.XrSessionState.is_running(context) + + def execute(self, context): + scene = context.scene + landmarks = scene.vr_landmarks + wm = context.window_manager + + lm = landmarks.add() + lm.type = 'OBJECT' + scene.vr_landmarks_selected = len(landmarks) - 1 + + loc = wm.xr_session_state.viewer_pose_location + rot = wm.xr_session_state.viewer_pose_rotation.to_euler() + + cam = bpy.data.cameras.new("Camera_" + lm.name) + new_cam = bpy.data.objects.new("Camera_" + lm.name, cam) + scene.collection.objects.link(new_cam) + new_cam.location = loc + new_cam.rotation_euler = rot + + lm.base_pose_object = new_cam + + return {'FINISHED'} + + class VIEW3D_OT_update_vr_landmark(Operator): bl_idname = "view3d.update_vr_landmark" bl_label = "Update Custom VR Landmark" @@ -205,7 +222,7 @@ class VIEW3D_OT_add_camera_from_vr_landmark(Operator): scene.collection.objects.link(new_cam) angle = lm.base_pose_angle new_cam.location = lm.base_pose_location - new_cam.rotation_euler = (math.pi, 0, angle) + new_cam.rotation_euler = (math.pi / 2, 0, angle) return {'FINISHED'} @@ -496,6 +513,7 @@ classes = ( VIEW3D_OT_vr_landmark_remove, VIEW3D_OT_vr_landmark_activate, VIEW3D_OT_vr_landmark_from_session, + VIEW3D_OT_vr_camera_landmark_from_session, VIEW3D_OT_add_camera_from_vr_landmark, VIEW3D_OT_camera_to_vr_landmark, VIEW3D_OT_vr_landmark_from_camera, diff --git a/viewport_vr_preview/properties.py b/viewport_vr_preview/properties.py index 03f03e8c..55a4d4eb 100644 --- a/viewport_vr_preview/properties.py +++ b/viewport_vr_preview/properties.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> diff --git a/viewport_vr_preview/versioning.py b/viewport_vr_preview/versioning.py index 15d4de29..fbff2a70 100644 --- a/viewport_vr_preview/versioning.py +++ b/viewport_vr_preview/versioning.py @@ -1,20 +1,4 @@ -# ##### 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 ##### +# SPDX-License-Identifier: GPL-2.0-or-later # <pep8 compliant> |