Merge branch 'master' into xr-dev

This commit is contained in:
Peter Kim 2022-03-25 15:36:53 +09:00
commit 4691c6c4a8
29 changed files with 85 additions and 146 deletions

View File

@ -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']]

View File

@ -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]

View File

@ -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

View File

@ -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 *

View File

@ -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:

View File

@ -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()

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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)]

View File

@ -45,7 +45,7 @@ def imageConvertCompat(path):
# rotation first defines axis then amount in radians
# =============================== VRML Spesific
# =============================== VRML Specific
def vrml_split_fields(value):
"""

View File

@ -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()

View File

@ -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"}

View File

@ -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':

View File

@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later
import bpy
from bpy.props import (
IntProperty,

View File

@ -1,20 +1,4 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software 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 #

View File

@ -1,20 +1,4 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software 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 #

View File

@ -1,20 +1,4 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software 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:

View File

@ -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:

View File

@ -1,20 +1,4 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software 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 ------------------------------- #

View File

@ -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):

View File

@ -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>

View File

@ -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,

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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()

View File

@ -101,6 +101,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"
@ -1137,6 +1170,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,