diff --git a/add_curve_aceous_galore.py b/add_curve_aceous_galore.py index b7283e26ab1f53de5532476a87178b7993ab01cd..fe8cefa1bc84462627683628a221cae061cc55d4 100644 --- a/add_curve_aceous_galore.py +++ b/add_curve_aceous_galore.py @@ -576,7 +576,7 @@ def CycloidCurve( number=24, length=2.0, type=0, a=1.0, b=1.0, startangle=0.0, e # calculates the matrix for the new object # depending on user pref def align_matrix(context): - loc = TranslationMatrix(context.scene.cursor_location) + loc = Matrix.Translation(context.scene.cursor_location) obj_align = context.user_preferences.edit.object_align if (context.space_data.type == 'VIEW_3D' and obj_align == 'VIEW'): diff --git a/add_curve_torus_knots.py b/add_curve_torus_knots.py index fd90cd551d65676b455679632e48bd719a826fd6..7a28edc2b398e300d019e122250a8fe921ee7b59 100644 --- a/add_curve_torus_knots.py +++ b/add_curve_torus_knots.py @@ -41,7 +41,7 @@ from math import * # calculates the matrix for the new object # depending on user pref def align_matrix(context): - loc = TranslationMatrix(context.scene.cursor_location) + loc = Matrix.Translation(context.scene.cursor_location) obj_align = context.user_preferences.edit.object_align if (context.space_data.type == 'VIEW_3D' and obj_align == 'VIEW'): diff --git a/add_mesh_3d_function_surface.py b/add_mesh_3d_function_surface.py index e6fa89a8ea2de29893a662eac1fda96d250ff35c..ea7cbfefe079f5d28e5ea64b3761d05e6e4f9bd0 100644 --- a/add_mesh_3d_function_surface.py +++ b/add_mesh_3d_function_surface.py @@ -124,7 +124,7 @@ safe_dict = dict([(k, globals().get(k, None)) for k in safe_list]) # calculates the matrix for the new object # depending on user pref def align_matrix(context): - loc = TranslationMatrix(context.scene.cursor_location) + loc = Matrix.Translation(context.scene.cursor_location) obj_align = context.user_preferences.edit.object_align if (context.space_data.type == 'VIEW_3D' and obj_align == 'VIEW'): diff --git a/add_mesh_BoltFactory/Boltfactory.py b/add_mesh_BoltFactory/Boltfactory.py index 3bc20185492044fa532f4a3e2da15417bdfe3dbc..4ba11db076233fc7ed0054970b23273fcbe9d89e 100644 --- a/add_mesh_BoltFactory/Boltfactory.py +++ b/add_mesh_BoltFactory/Boltfactory.py @@ -29,7 +29,7 @@ from add_mesh_BoltFactory.preset_utils import * # calculates the matrix for the new object # depending on user pref def align_matrix(context): - loc = mathutils.TranslationMatrix(context.scene.cursor_location) + loc = mathutils.Matrix.Translation(context.scene.cursor_location) obj_align = context.user_preferences.edit.object_align if (context.space_data.type == 'VIEW_3D' and obj_align == 'VIEW'): diff --git a/add_mesh_ant_landscape.py b/add_mesh_ant_landscape.py index 5f4cc8ec3436024743cd2487f0efd86a8849017c..b720a626f841fedb996f283a83c2a90a83387e65 100644 --- a/add_mesh_ant_landscape.py +++ b/add_mesh_ant_landscape.py @@ -38,7 +38,7 @@ from math import * ###------------------------------------------------------------ # calculates the matrix for the new object depending on user pref def align_matrix(context): - loc = TranslationMatrix(context.scene.cursor_location) + loc = Matrix.Translation(context.scene.cursor_location) obj_align = context.user_preferences.edit.object_align if (context.space_data.type == 'VIEW_3D' and obj_align == 'VIEW'): diff --git a/add_mesh_extras.py b/add_mesh_extras.py index c76cfce0f234a9d891c778b17b3f98e37ed5edb2..a109f3e69284709f7a2e5cba0ef011af3be0c35e 100644 --- a/add_mesh_extras.py +++ b/add_mesh_extras.py @@ -36,7 +36,7 @@ from bpy.props import * # calculates the matrix for the new object # depending on user pref def align_matrix(context): - loc = TranslationMatrix(context.scene.cursor_location) + loc = Matrix.Translation(context.scene.cursor_location) obj_align = context.user_preferences.edit.object_align if (context.space_data.type == 'VIEW_3D' and obj_align == 'VIEW'): @@ -386,7 +386,7 @@ def add_spindle(segments, radius, height, cap_height): upper_edgeloop = [] lower_edgeloop = [] for index in range(segments): - mtx = RotationMatrix(2.0 * pi * float(index) / segments, 3, 'Z') + mtx = Matrix.Rotation(2.0 * pi * float(index) / segments, 3, 'Z') # Calculate index & location of upper verte4x tip. idx_up = len(verts) diff --git a/add_mesh_gears.py b/add_mesh_gears.py index 3b3b2106e06376609a0179fcf945e601e7066461..2ff134452b79e1dcbc315102722c8d001eeae29b 100644 --- a/add_mesh_gears.py +++ b/add_mesh_gears.py @@ -70,7 +70,7 @@ from bpy.props import * # calculates the matrix for the new object # depending on user pref def align_matrix(context): - loc = mathutils.TranslationMatrix(context.scene.cursor_location) + loc = mathutils.Matrix.Translation(context.scene.cursor_location) obj_align = context.user_preferences.edit.object_align if (context.space_data.type == 'VIEW_3D' and obj_align == 'VIEW'): diff --git a/add_mesh_gemstones.py b/add_mesh_gemstones.py index 645f509d1935786cb4a3b94f3ef93753092b12fd..8d53c4d8a48ea57c7897868aa91da02c3fb58a24 100644 --- a/add_mesh_gemstones.py +++ b/add_mesh_gemstones.py @@ -36,7 +36,7 @@ from bpy.props import * # calculates the matrix for the new object # depending on user pref def align_matrix(context): - loc = TranslationMatrix(context.scene.cursor_location) + loc = Matrix.Translation(context.scene.cursor_location) obj_align = context.user_preferences.edit.object_align if (context.space_data.type == 'VIEW_3D' and obj_align == 'VIEW'): diff --git a/add_mesh_pipe_joint.py b/add_mesh_pipe_joint.py index 3ebbf5d1152f88eca543b8e568b2c3ff48f1420a..129acb2b95e4d830938cbdc0c263a20774969ed9 100644 --- a/add_mesh_pipe_joint.py +++ b/add_mesh_pipe_joint.py @@ -113,7 +113,7 @@ http://blenderartists.org/forum/showthread.php?t=154394 TODO: Use a rotation matrix for rotating the circle vertices: -rotation_matrix = mathutils.RotationMatrix(-math.pi/2, 4, 'x') +rotation_matrix = mathutils.Matrix.Rotation(-math.pi/2, 4, 'x') mesh.transform(rotation_matrix) """ @@ -129,7 +129,7 @@ from bpy.props import * # calculates the matrix for the new object # depending on user pref def align_matrix(context): - loc = mathutils.TranslationMatrix(context.scene.cursor_location) + loc = mathutils.Matrix.Translation(context.scene.cursor_location) obj_align = context.user_preferences.edit.object_align if (context.space_data.type == 'VIEW_3D' and obj_align == 'VIEW'): diff --git a/add_mesh_twisted_torus.py b/add_mesh_twisted_torus.py index 094692f0e0aa100b8298503632e0a32057b100eb..66fbe9a6f91ad2cb0f5045ca621d88a9c458259a 100644 --- a/add_mesh_twisted_torus.py +++ b/add_mesh_twisted_torus.py @@ -51,7 +51,7 @@ from math import cos, sin, pi # calculates the matrix for the new object # depending on user pref def align_matrix(context): - loc = TranslationMatrix(context.scene.cursor_location) + loc = Matrix.Translation(context.scene.cursor_location) obj_align = context.user_preferences.edit.object_align if (context.space_data.type == 'VIEW_3D' and obj_align == 'VIEW'): diff --git a/io_export_directx_x.py b/io_export_directx_x.py index 986dfa4d5114c05951af15fa7781649d1fbbf00d..bf4551232742fc202fea44ddb0ecd59008d394d7 100644 --- a/io_export_directx_x.py +++ b/io_export_directx_x.py @@ -111,15 +111,15 @@ def ExportDirectX(Config): print("Setting up...", end=" ") Config.SystemMatrix = Matrix() if Config.RotateX: - Config.SystemMatrix *= RotationMatrix(radians(-90), 4, "X") + Config.SystemMatrix *= Matrix.Rotation(radians(-90), 4, "X") if Config.CoordinateSystem == 1: - Config.SystemMatrix *= ScaleMatrix(-1, 4, Vector((0, 1, 0))) + Config.SystemMatrix *= Matrix.Scale(-1, 4, Vector((0, 1, 0))) Config.InverseSystemMatrix = Config.SystemMatrix.copy().invert() #Used for animating rotations Config.SystemQuaternion = Quaternion((1,0,0,0)) if Config.RotateX: - Config.SystemQuaternion = RotationMatrix(radians(-90), 3, "X").to_quat() + Config.SystemQuaternion = Matrix.Rotation(radians(-90), 3, "X").to_quat() Config.InverseSystemQuaternion = Config.SystemQuaternion.copy().inverse() Config.FlipZ = -1 if Config.CoordinateSystem == 1 else 1 @@ -297,11 +297,11 @@ def WriteArmatureBones(Config, Object, ChildList): if Bone.parent: BoneMatrix = (PoseBone.parent.matrix * - RotationMatrix(radians(-90), 4, "X")).invert() + Matrix.Rotation(radians(-90), 4, "X")).invert() else: BoneMatrix = Matrix() - BoneMatrix *= PoseBone.matrix * RotationMatrix(radians(-90), 4, "X") + BoneMatrix *= PoseBone.matrix * Matrix.Rotation(radians(-90), 4, "X") BoneMatrix = Config.SystemMatrix * BoneMatrix * Config.InverseSystemMatrix Config.File.write("{}FrameTransformMatrix {{\n".format(" " * Config.Whitespace)) @@ -611,7 +611,7 @@ def WriteMeshSkinWeights(Config, Object, Mesh): # - Armature Space to Bone Space (The bone matrix needs to be rotated 90 degrees to align with Blender's world axes) #This way, when BoneMatrix is transformed by the bone's Frame matrix, the vertices will be in their final world position. - BoneMatrix = (RestBone.matrix_local * RotationMatrix(radians(-90), 4, "X")).invert() + BoneMatrix = (RestBone.matrix_local * Matrix.Rotation(radians(-90), 4, "X")).invert() BoneMatrix *= ArmatureObject.matrix_world.copy().invert() BoneMatrix *= Object.matrix_world @@ -807,10 +807,10 @@ def WriteKeyedAnimationSet(Config): bpy.context.scene.set_frame(Keyframe) if Bone.parent: - PoseMatrix = (Bone.parent.matrix * RotationMatrix(radians(-90), 4, "X")).invert() + PoseMatrix = (Bone.parent.matrix * Matrix.Rotation(radians(-90), 4, "X")).invert() else: PoseMatrix = Matrix() - PoseMatrix *= Bone.matrix * RotationMatrix(radians(-90), 4, "X") + PoseMatrix *= Bone.matrix * Matrix.Rotation(radians(-90), 4, "X") PoseMatrix = Config.SystemMatrix * PoseMatrix * Config.InverseSystemMatrix @@ -843,10 +843,10 @@ def WriteKeyedAnimationSet(Config): bpy.context.scene.set_frame(Keyframe) if Bone.parent: - PoseMatrix = (Bone.parent.matrix * RotationMatrix(radians(-90), 4, "X")).invert() + PoseMatrix = (Bone.parent.matrix * Matrix.Rotation(radians(-90), 4, "X")).invert() else: PoseMatrix = Matrix() - PoseMatrix *= Bone.matrix * RotationMatrix(radians(-90), 4, "X") + PoseMatrix *= Bone.matrix * Matrix.Rotation(radians(-90), 4, "X") PoseMatrix = Config.SystemMatrix * PoseMatrix * Config.InverseSystemMatrix @@ -879,10 +879,10 @@ def WriteKeyedAnimationSet(Config): bpy.context.scene.set_frame(Keyframe) if Bone.parent: - PoseMatrix = (Bone.parent.matrix * RotationMatrix(radians(-90), 4, "X")).invert() + PoseMatrix = (Bone.parent.matrix * Matrix.Rotation(radians(-90), 4, "X")).invert() else: PoseMatrix = Matrix() - PoseMatrix *= Bone.matrix * RotationMatrix(radians(-90), 4, "X") + PoseMatrix *= Bone.matrix * Matrix.Rotation(radians(-90), 4, "X") PoseMatrix = Config.SystemMatrix * PoseMatrix * Config.InverseSystemMatrix diff --git a/io_import_scene_mhx.py b/io_import_scene_mhx.py index f2a3934e8288b41d622b8489d7d3c6226cc5ff4d..4ea15e914ca18ee4b4f93e390e0f080f81c9d8fe 100644 --- a/io_import_scene_mhx.py +++ b/io_import_scene_mhx.py @@ -1805,7 +1805,7 @@ def parseProcess(args, tokens): print(val) axis = val[1] angle = float(val[2]) - mat = mathutils.RotationMatrix(angle, 4, axis) + mat = mathutils.Matrix.Rotation(angle, 4, axis) try: pb = pbones[val[0]] prod = pb.matrix_local * mat