From 2502531bb4ab4a76a876c003dab34951da31e1eb Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 15 Mar 2022 18:29:24 +0100 Subject: Cleanup: fix source typos Contributed by luzpaz. Differential Revision: https://developer.blender.org/D14313 --- magic_uv/__init__.py | 8 ++++---- magic_uv/properites.py | 27 --------------------------- magic_uv/properties.py | 27 +++++++++++++++++++++++++++ mesh_snap_utilities_line/common_classes.py | 4 ++-- 4 files changed, 33 insertions(+), 33 deletions(-) delete mode 100644 magic_uv/properites.py create mode 100644 magic_uv/properties.py diff --git a/magic_uv/__init__.py b/magic_uv/__init__.py index 18bdb17c..dc3c9641 100644 --- a/magic_uv/__init__.py +++ b/magic_uv/__init__.py @@ -32,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 @@ -40,7 +40,7 @@ else: from . import utils from . import op from . import ui - from . import properites + from . import properties from . import preferences import bpy @@ -48,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() @@ -56,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/properites.py b/magic_uv/properites.py deleted file mode 100644 index 21506915..00000000 --- a/magic_uv/properites.py +++ /dev/null @@ -1,27 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later - -# - -__author__ = "Nutti " -__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 + +# + +__author__ = "Nutti " +__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/mesh_snap_utilities_line/common_classes.py b/mesh_snap_utilities_line/common_classes.py index 0e921dc6..713b2698 100644 --- a/mesh_snap_utilities_line/common_classes.py +++ b/mesh_snap_utilities_line/common_classes.py @@ -201,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': -- cgit v1.2.3 From df34f4f1db405c5b8deeb03db0937bee9ba81f42 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 15 Mar 2022 18:29:39 +0100 Subject: Cleanup: fix source comment typos Contributed by luzpaz. Differential Revision: https://developer.blender.org/D14312 --- add_mesh_extra_objects/Blocks.py | 2 +- .../add_mesh_rocks/randomize_texture.py | 2 +- ant_landscape/eroder.py | 2 +- curve_tools/show_resolution.py | 2 +- greasepencil_tools/import_brush_pack.py | 2 +- greasepencil_tools/rotate_canvas.py | 2 +- greasepencil_tools/timeline_scrub.py | 2 +- io_coat3D/__init__.py | 2 +- io_scene_fbx/export_fbx_bin.py | 2 +- io_scene_fbx/import_fbx.py | 10 +++++----- io_scene_x3d/import_x3d.py | 2 +- materials_library_vx/__init__.py | 2 +- mesh_tissue/polyhedra.py | 4 ++-- mesh_tissue/tessellate_numpy.py | 8 ++++---- mesh_tissue/utils.py | 2 +- mesh_tissue/weight_tools.py | 16 ++++++++-------- precision_drawing_tools/pdt_command_functions.py | 4 ++-- precision_drawing_tools/pdt_design.py | 4 ++-- render_povray/object_primitives.py | 2 +- 19 files changed, 36 insertions(+), 36 deletions(-) diff --git a/add_mesh_extra_objects/Blocks.py b/add_mesh_extra_objects/Blocks.py index 928ed1d6..22676670 100644 --- a/add_mesh_extra_objects/Blocks.py +++ b/add_mesh_extra_objects/Blocks.py @@ -1246,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/add_mesh_rocks/randomize_texture.py b/add_mesh_extra_objects/add_mesh_rocks/randomize_texture.py index 8fc92890..b1dd99bd 100644 --- a/add_mesh_extra_objects/add_mesh_rocks/randomize_texture.py +++ b/add_mesh_extra_objects/add_mesh_rocks/randomize_texture.py @@ -135,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/ant_landscape/eroder.py b/ant_landscape/eroder.py index 1859ab66..558d2edb 100644 --- a/ant_landscape/eroder.py +++ b/ant_landscape/eroder.py @@ -154,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/curve_tools/show_resolution.py b/curve_tools/show_resolution.py index cd63f59f..b2dbda7f 100644 --- a/curve_tools/show_resolution.py +++ b/curve_tools/show_resolution.py @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later -# LOAD MODUL # +# LOAD MODULE # import bpy from bpy import * from bpy.props import * diff --git a/greasepencil_tools/import_brush_pack.py b/greasepencil_tools/import_brush_pack.py index 296ac957..695ca411 100644 --- a/greasepencil_tools/import_brush_pack.py +++ b/greasepencil_tools/import_brush_pack.py @@ -103,7 +103,7 @@ class GP_OT_install_brush_pack(bpy.types.Operator): self.report({'WARNING'}, 'Brushes loaded from temp directory (No download)') return {"FINISHED"} - self.report({'ERROR'}, f'Check your internet connexion, Impossible to connect to url: {dl_url}') + self.report({'ERROR'}, f'Check your internet connection, impossible to connect to url: {dl_url}') return {"CANCELLED"} if file_size is None: diff --git a/greasepencil_tools/rotate_canvas.py b/greasepencil_tools/rotate_canvas.py index 6db43234..a733eb2d 100644 --- a/greasepencil_tools/rotate_canvas.py +++ b/greasepencil_tools/rotate_canvas.py @@ -251,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 eaccab99..6a1913ae 100644 --- a/greasepencil_tools/timeline_scrub.py +++ b/greasepencil_tools/timeline_scrub.py @@ -156,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/io_coat3D/__init__.py b/io_coat3D/__init__.py index 35e686cc..9a3d06af 100644 --- a/io_coat3D/__init__.py +++ b/io_coat3D/__init__.py @@ -1040,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_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py index 9dad8f01..50aefe03 100644 --- a/io_scene_fbx/export_fbx_bin.py +++ b/io_scene_fbx/export_fbx_bin.py @@ -1000,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 diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py index f2726047..bf5641ca 100644 --- a/io_scene_fbx/import_fbx.py +++ b/io_scene_fbx/import_fbx.py @@ -1113,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 @@ -1162,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 @@ -1179,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, ) @@ -2666,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)] diff --git a/io_scene_x3d/import_x3d.py b/io_scene_x3d/import_x3d.py index 834485cb..8299faf1 100644 --- a/io_scene_x3d/import_x3d.py +++ b/io_scene_x3d/import_x3d.py @@ -45,7 +45,7 @@ def imageConvertCompat(path): # rotation first defines axis then amount in radians -# =============================== VRML Spesific +# =============================== VRML Specific def vrml_split_fields(value): """ diff --git a/materials_library_vx/__init__.py b/materials_library_vx/__init__.py index 03d4f0cd..c19eab87 100644 --- a/materials_library_vx/__init__.py +++ b/materials_library_vx/__init__.py @@ -749,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/mesh_tissue/polyhedra.py b/mesh_tissue/polyhedra.py index 394d605a..d58f08aa 100644 --- a/mesh_tissue/polyhedra.py +++ b/mesh_tissue/polyhedra.py @@ -174,7 +174,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 +190,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 d3c1fc21..50516b2a 100644 --- a/mesh_tissue/tessellate_numpy.py +++ b/mesh_tissue/tessellate_numpy.py @@ -576,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 @@ -1252,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( @@ -1567,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': @@ -3725,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/utils.py b/mesh_tissue/utils.py index cf43d609..b617ac93 100644 --- a/mesh_tissue/utils.py +++ b/mesh_tissue/utils.py @@ -1432,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/weight_tools.py b/mesh_tissue/weight_tools.py index d58adc6f..ef83f128 100644 --- a/mesh_tissue/weight_tools.py +++ b/mesh_tissue/weight_tools.py @@ -18,10 +18,10 @@ #-------------------------- 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 +229,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/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/render_povray/object_primitives.py b/render_povray/object_primitives.py index 2b9eab95..d017c4d0 100755 --- a/render_povray/object_primitives.py +++ b/render_povray/object_primitives.py @@ -856,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 -- cgit v1.2.3 From d6f0fb5b17f00c1c498f9afa8775bf8502b97778 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 18 Mar 2022 10:22:28 +1100 Subject: File headers: use SPDX license identifiers da9a50a46ed3e293146428a87a275a947a54b9fe reverted these changes. --- mesh_tissue/config.py | 2 ++ mesh_tissue/curves_tools.py | 18 +----------------- mesh_tissue/material_tools.py | 18 +----------------- mesh_tissue/polyhedra.py | 18 +----------------- mesh_tissue/tissue_properties.py | 18 +----------------- mesh_tissue/utils_pip.py | 20 +------------------- mesh_tissue/weight_tools.py | 18 +----------------- 7 files changed, 8 insertions(+), 104 deletions(-) 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/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/polyhedra.py b/mesh_tissue/polyhedra.py index d58f08aa..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 ------------------------------- # 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_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 # diff --git a/mesh_tissue/weight_tools.py b/mesh_tissue/weight_tools.py index ef83f128..2736945e 100644 --- a/mesh_tissue/weight_tools.py +++ b/mesh_tissue/weight_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 #-------------------------- COLORS / GROUPS EXCHANGER -------------------------# # # -- cgit v1.2.3 From 5aa25f6a3f0a41aef27d6e477ad8b2e2771b000f Mon Sep 17 00:00:00 2001 From: Peter Kim Date: Fri, 25 Mar 2022 13:22:50 +0900 Subject: VR: Add "Camera Landmark from Session" operator Creates a new camera and "Custom Object"-type landmark from the VR headset pose. In contrast to the existing "Landmark from Session" operator that only saves the headset rotation around the global z-axis, this preserves the exact rotation of the headset by assigning it to the newly-created camera (although the landmark itself still only inherits the z-rotation component). --- viewport_vr_preview/gui.py | 3 ++- viewport_vr_preview/operators.py | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/viewport_vr_preview/gui.py b/viewport_vr_preview/gui.py index 163cbd48..376e9de8 100644 --- a/viewport_vr_preview/gui.py +++ b/viewport_vr_preview/gui.py @@ -88,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() @@ -156,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' diff --git a/viewport_vr_preview/operators.py b/viewport_vr_preview/operators.py index dc2dd4b9..67638ea4 100644 --- a/viewport_vr_preview/operators.py +++ b/viewport_vr_preview/operators.py @@ -97,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" @@ -480,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, -- cgit v1.2.3