Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--add_curve_aceous_galore.py2
-rw-r--r--add_mesh_BoltFactory/Boltfactory.py2
-rw-r--r--add_mesh_BoltFactory/createMesh.py2
-rw-r--r--curve_simplify.py4
-rw-r--r--io_anim_bvh/export_bvh.py14
-rw-r--r--io_anim_bvh/import_bvh.py12
-rw-r--r--io_anim_camera.py6
-rw-r--r--io_export_directx_x.py42
-rw-r--r--io_export_unreal_psk_psa.py16
-rw-r--r--io_import_images_as_planes.py2
-rw-r--r--io_import_scene_dxf.py10
-rw-r--r--io_import_scene_unreal_psk.py8
-rw-r--r--io_scene_3ds/export_3ds.py2
-rw-r--r--io_scene_3ds/import_3ds.py2
-rw-r--r--io_scene_fbx/export_fbx.py26
-rw-r--r--io_scene_obj/export_obj.py2
-rw-r--r--io_scene_x3d/export_x3d.py6
-rw-r--r--io_scene_x3d/import_x3d.py20
-rw-r--r--modules/add_utils.py6
-rw-r--r--render_povray/render.py4
-rw-r--r--rigify/rigs/misc/delta.py6
-rw-r--r--rigify/utils.py4
-rw-r--r--space_view3d_copy_attributes.py14
-rw-r--r--space_view3d_math_vis/draw.py6
-rw-r--r--space_view3d_math_vis/utils.py4
-rw-r--r--space_view3d_panel_measure.py10
26 files changed, 116 insertions, 116 deletions
diff --git a/add_curve_aceous_galore.py b/add_curve_aceous_galore.py
index be8bbc6e..fcc27502 100644
--- a/add_curve_aceous_galore.py
+++ b/add_curve_aceous_galore.py
@@ -603,7 +603,7 @@ def align_matrix(context):
obj_align = context.user_preferences.edit.object_align
if (context.space_data.type == 'VIEW_3D'
and obj_align == 'VIEW'):
- rot = context.space_data.region_3d.view_matrix.rotation_part().invert().resize4x4()
+ rot = context.space_data.region_3d.view_matrix.to_3x3().inverted().to_4x4()
else:
rot = Matrix()
align_matrix = loc * rot
diff --git a/add_mesh_BoltFactory/Boltfactory.py b/add_mesh_BoltFactory/Boltfactory.py
index aa6e470e..97a489b0 100644
--- a/add_mesh_BoltFactory/Boltfactory.py
+++ b/add_mesh_BoltFactory/Boltfactory.py
@@ -33,7 +33,7 @@ def align_matrix(context):
obj_align = context.user_preferences.edit.object_align
if (context.space_data.type == 'VIEW_3D'
and obj_align == 'VIEW'):
- rot = context.space_data.region_3d.view_matrix.rotation_part().invert().resize4x4()
+ rot = context.space_data.region_3d.view_matrix.to_3x3().inverted().to_4x4()
else:
rot = mathutils.Matrix()
align_matrix = loc * rot
diff --git a/add_mesh_BoltFactory/createMesh.py b/add_mesh_BoltFactory/createMesh.py
index cb972f40..4cec092d 100644
--- a/add_mesh_BoltFactory/createMesh.py
+++ b/add_mesh_BoltFactory/createMesh.py
@@ -2064,7 +2064,7 @@ def align_matrix(context):
obj_align = context.user_preferences.edit.object_align
if (context.space_data.type == 'VIEW_3D'
and obj_align == 'VIEW'):
- rot = context.space_data.region_3d.view_matrix.rotation_part().invert().resize4x4()
+ rot = context.space_data.region_3d.view_matrix.to_3x3().inverted().to_4x4()
else:
rot = Matrix()
align_matrix = loc * rot
diff --git a/curve_simplify.py b/curve_simplify.py
index 8b1fc0ad..8533769d 100644
--- a/curve_simplify.py
+++ b/curve_simplify.py
@@ -254,7 +254,7 @@ def main(context, obj, options):
for splineVert in spline.bezier_points.values()]
else: # verts from all other types of curves
- splineVerts = [splineVert.co.copy().resize3D()
+ splineVerts = [splineVert.co.to_3d()
for splineVert in spline.points.values()]
# simplify spline according to mode
@@ -304,7 +304,7 @@ def getFcurveData(obj):
fcurves = []
for fc in obj.animation_data.action.fcurves:
if fc.select:
- fcVerts = [vcVert.co.copy().resize3D()
+ fcVerts = [vcVert.co.to_3d()
for vcVert in fc.keyframe_points.values()]
fcurves.append(fcVerts)
return fcurves
diff --git a/io_anim_bvh/export_bvh.py b/io_anim_bvh/export_bvh.py
index 25694fa4..2a49f083 100644
--- a/io_anim_bvh/export_bvh.py
+++ b/io_anim_bvh/export_bvh.py
@@ -151,9 +151,9 @@ def write_armature(context, filepath, frame_start, frame_end, global_scale=1.0):
self.rest_local_mat = self.rest_bone.matrix
# inverted mats
- self.pose_imat = self.pose_mat.copy().invert()
- self.rest_arm_imat = self.rest_arm_mat.copy().invert()
- self.rest_local_imat = self.rest_local_mat.copy().invert()
+ self.pose_imat = self.pose_mat.inverted()
+ self.rest_arm_imat = self.rest_arm_mat.inverted()
+ self.rest_local_imat = self.rest_local_mat.inverted()
self.parent = None
self.prev_euler = Euler((0.0, 0.0, 0.0))
@@ -161,7 +161,7 @@ def write_armature(context, filepath, frame_start, frame_end, global_scale=1.0):
def update_posedata(self):
self.pose_mat = self.pose_bone.matrix
- self.pose_imat = self.pose_mat.copy().invert()
+ self.pose_imat = self.pose_mat.inverted()
def __repr__(self):
if self.parent:
@@ -202,14 +202,14 @@ def write_armature(context, filepath, frame_start, frame_end, global_scale=1.0):
if dbone.parent:
mat_final = dbone.parent.rest_arm_mat * dbone.parent.pose_imat * dbone.pose_mat * dbone.rest_arm_imat
mat_final = itrans * mat_final * trans
- loc = mat_final.translation_part() + (dbone.rest_bone.head_local - dbone.parent.rest_bone.head_local)
+ loc = mat_final.to_translation() + (dbone.rest_bone.head_local - dbone.parent.rest_bone.head_local)
else:
mat_final = dbone.pose_mat * dbone.rest_arm_imat
mat_final = itrans * mat_final * trans
- loc = mat_final.translation_part() + dbone.rest_bone.head
+ loc = mat_final.to_translation() + dbone.rest_bone.head
# keep eulers compatible, no jumping on interpolation.
- rot = mat_final.rotation_part().invert().to_euler('XYZ', dbone.prev_euler)
+ rot = mat_final.to_3x3().inverted().to_euler('XYZ', dbone.prev_euler)
if not dbone.connected:
file.write("%.6f %.6f %.6f " % (loc * global_scale)[:])
diff --git a/io_anim_bvh/import_bvh.py b/io_anim_bvh/import_bvh.py
index 464b76bf..9a0126b3 100644
--- a/io_anim_bvh/import_bvh.py
+++ b/io_anim_bvh/import_bvh.py
@@ -446,13 +446,13 @@ def bvh_node_dict2armature(context, bvh_name, bvh_nodes, rotate_mode='XYZ', fram
bone_name = bvh_node.temp # may not be the same name as the bvh_node, could have been shortened.
pose_bone = pose_bones[bone_name]
rest_bone = arm_data.bones[bone_name]
- bone_rest_matrix = rest_bone.matrix_local.rotation_part()
+ bone_rest_matrix = rest_bone.matrix_local.to_3x3()
bone_rest_matrix_inv = Matrix(bone_rest_matrix)
bone_rest_matrix_inv.invert()
- bone_rest_matrix_inv.resize4x4()
- bone_rest_matrix.resize4x4()
+ bone_rest_matrix_inv.resize_4x4()
+ bone_rest_matrix.resize_4x4()
bvh_node.temp = (pose_bone, bone, bone_rest_matrix, bone_rest_matrix_inv)
# Make a dict for fast access without rebuilding a list all the time.
@@ -479,18 +479,18 @@ def bvh_node_dict2armature(context, bvh_name, bvh_nodes, rotate_mode='XYZ', fram
if bvh_node.has_rot:
# apply rotation order and convert to XYZ
# note that the rot_order_str is reversed.
- bone_rotation_matrix = Euler((rx, ry, rz), bvh_node.rot_order_str[::-1]).to_matrix().resize4x4()
+ bone_rotation_matrix = Euler((rx, ry, rz), bvh_node.rot_order_str[::-1]).to_matrix().to_4x4()
bone_rotation_matrix = bone_rest_matrix_inv * bone_rotation_matrix * bone_rest_matrix
if rotate_mode == 'QUATERNION':
- pose_bone.rotation_quaternion = bone_rotation_matrix.to_quat()
+ pose_bone.rotation_quaternion = bone_rotation_matrix.to_quaternion()
else:
euler = bone_rotation_matrix.to_euler(bvh_node.rot_order_str, prev_euler[i])
pose_bone.rotation_euler = euler
prev_euler[i] = euler
if bvh_node.has_loc:
- pose_bone.location = (bone_rest_matrix_inv * Matrix.Translation(Vector((lx, ly, lz)) - bvh_node.rest_head_local)).translation_part()
+ pose_bone.location = (bone_rest_matrix_inv * Matrix.Translation(Vector((lx, ly, lz)) - bvh_node.rest_head_local)).to_translation()
if bvh_node.has_loc:
pose_bone.keyframe_insert("location")
diff --git a/io_anim_camera.py b/io_anim_camera.py
index bd0e884e..1a34fdc2 100644
--- a/io_anim_camera.py
+++ b/io_anim_camera.py
@@ -87,9 +87,9 @@ def writeCameras(context, filepath, frame_start, frame_end, only_selected=False)
fw("obj = cameras['%s']\n" % obj.name)
matrix = obj.matrix_world.copy()
- fw("obj.location = %s\n" % repr(tuple(matrix.translation_part())))
- fw("obj.scale = %s\n" % repr(tuple(matrix.scale_part())))
- fw("obj.rotation_euler = %s\n" % repr(tuple(matrix.to_euler())))
+ fw("obj.location = %r\n" % matrix.to_translation()[:])
+ fw("obj.scale = %r\n" % matrix.to_scale()[:])
+ fw("obj.rotation_euler = %r\n" % matrix.to_euler()[:])
fw("obj.keyframe_insert('location')\n")
fw("obj.keyframe_insert('scale')\n")
diff --git a/io_export_directx_x.py b/io_export_directx_x.py
index 20739fa5..bb655064 100644
--- a/io_export_directx_x.py
+++ b/io_export_directx_x.py
@@ -312,7 +312,7 @@ def WriteArmatureBones(Config, Object, ChildList):
PoseBone = PoseBones[Bone.name]
if Bone.parent:
- BoneMatrix = PoseBone.parent.matrix.copy().invert()
+ BoneMatrix = PoseBone.parent.matrix.inverted()
else:
BoneMatrix = Matrix()
@@ -625,8 +625,8 @@ 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.copy().invert()
- BoneMatrix *= ArmatureObject.matrix_world.copy().invert()
+ BoneMatrix = RestBone.matrix_local.inverted()
+ BoneMatrix *= ArmatureObject.matrix_world.inverted()
BoneMatrix *= Object.matrix_world
Config.File.write("{}{:9f},{:9f},{:9f},{:9f},\n".format(" " * Config.Whitespace, BoneMatrix[0][0], BoneMatrix[0][1], BoneMatrix[0][2], BoneMatrix[0][3]))
@@ -697,7 +697,7 @@ def WriteKeyedAnimationSet(Config):
else:
Config.File.write("{}2;\n{}1;\n".format(" " * Config.Whitespace, " " * Config.Whitespace))
bpy.context.scene.frame_set(bpy.context.scene.frame_start)
- Position = Object.matrix_local.translation_part()
+ Position = Object.matrix_local.to_translation()
Config.File.write("{}{}{:9f},{:9f},{:9f};;;\n".format(" " * Config.Whitespace, ("0;3;").ljust(8), Position[0], Position[1], Position[2]))
Config.Whitespace -= 1
Config.File.write("{}}}\n".format(" " * Config.Whitespace))
@@ -732,7 +732,7 @@ def WriteKeyedAnimationSet(Config):
Rotation[0] = ((RotationFCurves[0][Keyframe] if Keyframe in RotationFCurves[0] else Object.rotation_euler[0]) if RotationFCurves[0] else Object.rotation_euler[0])
Rotation[1] = ((RotationFCurves[1][Keyframe] if Keyframe in RotationFCurves[1] else Object.rotation_euler[1]) if RotationFCurves[1] else Object.rotation_euler[1])
Rotation[2] = ((RotationFCurves[2][Keyframe] if Keyframe in RotationFCurves[2] else Object.rotation_euler[2]) if RotationFCurves[2] else Object.rotation_euler[2])
- Rotation = Rotation.to_quat()
+ Rotation = Rotation.to_quaternion()
Config.File.write("{}{}{:9f},{:9f},{:9f},{:9f};;".format(" " * Config.Whitespace, (str(Keyframe - bpy.context.scene.frame_start) + ";4;").ljust(8), - Rotation[0], Rotation[1], Rotation[2], Rotation[3]))
if Keyframe == AllKeyframes[-1]:
Config.File.write(";\n")
@@ -741,7 +741,7 @@ def WriteKeyedAnimationSet(Config):
else:
Config.File.write("{}0;\n{}1;\n".format(" " * Config.Whitespace, " " * Config.Whitespace))
bpy.context.scene.frame_set(bpy.context.scene.frame_start)
- Rotation = Object.rotation_euler.to_quat()
+ Rotation = Object.rotation_euler.to_quaternion()
Config.File.write("{}{}{:9f},{:9f},{:9f},{:9f};;;\n".format(" " * Config.Whitespace, ("0;4;").ljust(8), -Rotation[0], Rotation[1], Rotation[2], Rotation[3]))
Config.Whitespace -= 1
Config.File.write("{}}}\n".format(" " * Config.Whitespace))
@@ -784,7 +784,7 @@ def WriteKeyedAnimationSet(Config):
else:
Config.File.write("{}1;\n{}1;\n".format(" " * Config.Whitespace, " " * Config.Whitespace))
bpy.context.scene.frame_set(bpy.context.scene.frame_start)
- Scale = Object.matrix_local.scale_part()
+ Scale = Object.matrix_local.to_scale()
Config.File.write("{}{}{:9f},{:9f},{:9f};;;\n".format(" " * Config.Whitespace, ("0;3;").ljust(8), Scale[0], Scale[1], Scale[2]))
Config.Whitespace -= 1
Config.File.write("{}}}\n".format(" " * Config.Whitespace))
@@ -850,12 +850,12 @@ def WriteKeyedAnimationSet(Config):
bpy.context.scene.frame_set(Keyframe)
if Bone.parent:
- PoseMatrix = Bone.parent.matrix.copy().invert()
+ PoseMatrix = Bone.parent.matrix.inverted()
else:
PoseMatrix = Matrix()
PoseMatrix *= Bone.matrix
- Position = PoseMatrix.translation_part()
+ Position = PoseMatrix.to_translation()
Config.File.write("{}{}{:9f},{:9f},{:9f};;".format(" " * Config.Whitespace, (str(Keyframe - bpy.context.scene.frame_start) + ";3;").ljust(8), Position[0], Position[1], Position[2]))
if Keyframe == AllKeyframes[-1]:
Config.File.write(";\n")
@@ -893,12 +893,12 @@ def WriteKeyedAnimationSet(Config):
bpy.context.scene.frame_set(Keyframe)
if Bone.parent:
- PoseMatrix = Bone.parent.matrix.copy().invert()
+ PoseMatrix = Bone.parent.matrix.inverted()
else:
PoseMatrix = Matrix()
PoseMatrix *= Bone.matrix
- Rotation = PoseMatrix.rotation_part().to_quat()
+ Rotation = PoseMatrix.to_3x3().to_quaternion()
Config.File.write("{}{}{:9f},{:9f},{:9f},{:9f};;".format(" " * Config.Whitespace, (str(Keyframe - bpy.context.scene.frame_start) + ";4;").ljust(8), -Rotation[0], Rotation[1], Rotation[2], Rotation[3]))
if Keyframe == AllKeyframes[-1]:
Config.File.write(";\n")
@@ -936,12 +936,12 @@ def WriteKeyedAnimationSet(Config):
bpy.context.scene.frame_set(Keyframe)
if Bone.parent:
- PoseMatrix = Bone.parent.matrix.copy().invert()
+ PoseMatrix = Bone.parent.matrix.inverted()
else:
PoseMatrix = Matrix()
PoseMatrix *= Bone.matrix
- Scale = PoseMatrix.scale_part()
+ Scale = PoseMatrix.to_scale()
Config.File.write("{}{}{:9f},{:9f},{:9f};;".format(" " * Config.Whitespace, (str(Keyframe - bpy.context.scene.frame_start) + ";3;").ljust(8), Scale[0], Scale[1], Scale[2]))
if Keyframe == AllKeyframes[-1]:
Config.File.write(";\n")
@@ -986,7 +986,7 @@ def WriteFullAnimationSet(Config):
Config.File.write("{}2;\n{}{};\n".format(" " * Config.Whitespace, " " * Config.Whitespace, KeyframeCount))
for Frame in range(0, KeyframeCount):
bpy.context.scene.frame_set(Frame + bpy.context.scene.frame_start)
- Position = Object.matrix_local.translation_part()
+ Position = Object.matrix_local.to_translation()
Config.File.write("{}{}{:9f},{:9f},{:9f};;".format(" " * Config.Whitespace, (str(Frame) + ";3;").ljust(8), Position[0], Position[1], Position[2]))
if Frame == KeyframeCount-1:
Config.File.write(";\n")
@@ -1005,7 +1005,7 @@ def WriteFullAnimationSet(Config):
Config.File.write("{}0;\n{}{};\n".format(" " * Config.Whitespace, " " * Config.Whitespace, KeyframeCount))
for Frame in range(0, KeyframeCount):
bpy.context.scene.frame_set(Frame + bpy.context.scene.frame_start)
- Rotation = Object.rotation_euler.to_quat()
+ Rotation = Object.rotation_euler.to_quaternion()
Config.File.write("{}{}{:9f},{:9f},{:9f},{:9f};;".format(" " * Config.Whitespace, (str(Frame) + ";4;").ljust(8), -Rotation[0], Rotation[1], Rotation[2], Rotation[3]))
if Frame == KeyframeCount-1:
Config.File.write(";\n")
@@ -1024,7 +1024,7 @@ def WriteFullAnimationSet(Config):
Config.File.write("{}1;\n{}{};\n".format(" " * Config.Whitespace, " " * Config.Whitespace, KeyframeCount))
for Frame in range(0, KeyframeCount):
bpy.context.scene.frame_set(Frame + bpy.context.scene.frame_start)
- Scale = Object.matrix_local.scale_part()
+ Scale = Object.matrix_local.to_scale()
Config.File.write("{}{}{:9f},{:9f},{:9f};;".format(" " * Config.Whitespace, (str(Frame) + ";3;").ljust(8), Scale[0], Scale[1], Scale[2]))
if Frame == KeyframeCount-1:
Config.File.write(";\n")
@@ -1061,12 +1061,12 @@ def WriteFullAnimationSet(Config):
bpy.context.scene.frame_set(Frame + bpy.context.scene.frame_start)
if Bone.parent:
- PoseMatrix = Bone.parent.matrix.copy().invert()
+ PoseMatrix = Bone.parent.matrix.inverted()
else:
PoseMatrix = Matrix()
PoseMatrix *= Bone.matrix
- Position = PoseMatrix.translation_part()
+ Position = PoseMatrix.to_translation()
Config.File.write("{}{}{:9f},{:9f},{:9f};;".format(" " * Config.Whitespace, (str(Frame) + ";3;").ljust(8), Position[0], Position[1], Position[2]))
if Frame == KeyframeCount-1:
Config.File.write(";\n")
@@ -1086,7 +1086,7 @@ def WriteFullAnimationSet(Config):
for Frame in range(0, KeyframeCount):
bpy.context.scene.frame_set(Frame + bpy.context.scene.frame_start)
- Rotation = Bones[Bone.name].matrix.to_quat() * Bone.rotation_quaternion
+ Rotation = Bones[Bone.name].matrix.to_quaternion() * Bone.rotation_quaternion
Config.File.write("{}{}{:9f},{:9f},{:9f},{:9f};;".format(" " * Config.Whitespace, (str(Frame) + ";4;").ljust(8), -Rotation[0], Rotation[1], Rotation[2], Rotation[3]))
if Frame == KeyframeCount-1:
@@ -1108,12 +1108,12 @@ def WriteFullAnimationSet(Config):
bpy.context.scene.frame_set(Frame + bpy.context.scene.frame_start)
if Bone.parent:
- PoseMatrix = Bone.parent.matrix.copy().invert()
+ PoseMatrix = Bone.parent.matrix.inverted()
else:
PoseMatrix = Matrix()
PoseMatrix *= Bone.matrix
- Scale = PoseMatrix.scale_part()
+ Scale = PoseMatrix.to_scale()
Config.File.write("{}{}{:9f},{:9f},{:9f};;".format(" " * Config.Whitespace, (str(Frame) + ";3;").ljust(8), Scale[0], Scale[1], Scale[2]))
if Frame == KeyframeCount-1:
Config.File.write(";\n")
diff --git a/io_export_unreal_psk_psa.py b/io_export_unreal_psk_psa.py
index 738e1205..dd5e29ed 100644
--- a/io_export_unreal_psk_psa.py
+++ b/io_export_unreal_psk_psa.py
@@ -969,9 +969,9 @@ def parse_bone(blender_bone, psk_file, psa_file, parent_id, is_root_bone, parent
if child_parent != None:
quat_root = blender_bone.matrix
- quat = make_fquat(quat_root.to_quat())
+ quat = make_fquat(quat_root.to_quaternion())
- quat_parent = child_parent.matrix.to_quat().inverse()
+ quat_parent = child_parent.matrix.to_quaternion().inverse()
parent_head = child_parent.head * quat_parent
parent_tail = child_parent.tail * quat_parent
@@ -980,10 +980,10 @@ def parse_bone(blender_bone, psk_file, psa_file, parent_id, is_root_bone, parent
# ROOT BONE
#This for root
set_position = blender_bone.head * parent_matrix #ARMATURE OBJECT Locction
- rot_mat = blender_bone.matrix * parent_matrix.rotation_part() #ARMATURE OBJECT Rotation
+ rot_mat = blender_bone.matrix * parent_matrix.to_3x3() #ARMATURE OBJECT Rotation
#print(dir(rot_mat))
- quat = make_fquat_default(rot_mat.to_quat())
+ quat = make_fquat_default(rot_mat.to_quaternion())
#print ("[[======= FINAL POSITION:", set_position)
final_parent_id = parent_id
@@ -1266,8 +1266,8 @@ def parse_animation(blender_scene, blender_armatures, psa_file):
parentposemat = mathutils.Matrix(parent_pose.matrix)
#blender 2.4X it been flip around with new 2.50 (mat1 * mat2) should now be (mat2 * mat1)
posebonemat = parentposemat.invert() * posebonemat
- head = posebonemat.translation_part()
- quat = posebonemat.to_quat().normalize()
+ head = posebonemat.to_translation()
+ quat = posebonemat.to_quaternion().normalize()
vkey = VQuatAnimKey()
vkey.Position.X = head.x
vkey.Position.Y = head.y
@@ -1411,8 +1411,8 @@ def parse_animation(blender_scene, blender_armatures, psa_file):
parentposemat = mathutils.Matrix(parent_pose.matrix)
#blender 2.4X it been flip around with new 2.50 (mat1 * mat2) should now be (mat2 * mat1)
posebonemat = parentposemat.invert() * posebonemat
- head = posebonemat.translation_part()
- quat = posebonemat.to_quat().normalize()
+ head = posebonemat.to_translation()
+ quat = posebonemat.to_quaternion().normalize()
vkey = VQuatAnimKey()
vkey.Position.X = head.x
vkey.Position.Y = head.y
diff --git a/io_import_images_as_planes.py b/io_import_images_as_planes.py
index 0180e474..3156d293 100644
--- a/io_import_images_as_planes.py
+++ b/io_import_images_as_planes.py
@@ -185,7 +185,7 @@ def align_planes(self, planes):
offset += (plane.dimensions.x / 2) + gap
if i == 0: continue
move_local = mathutils.Vector((offset, 0, 0))
- move_world = plane.location + move_local * plane.matrix_world.copy().invert()
+ move_world = plane.location + move_local * plane.matrix_world.inverted()
plane.location += move_world
offset += (plane.dimensions.x / 2)
diff --git a/io_import_scene_dxf.py b/io_import_scene_dxf.py
index bb776a82..5ab94d54 100644
--- a/io_import_scene_dxf.py
+++ b/io_import_scene_dxf.py
@@ -1414,15 +1414,15 @@ def transform(normal, rotation, obj): #----------------------------------------
"""
ma = Matrix(((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1)))
o = Vector(obj.location)
- ma_new = getOCS(normal)
- if ma_new:
- ma = ma_new.resize4x4()
- o = o * ma #.copy().invert()
+ ma = getOCS(normal)
+ if ma:
+ ma.resize_4x4()
+ o = o * ma #.inverted()
if rotation != 0:
g = radians(-rotation)
rmat = Matrix(((cos(g), -sin(g), 0), (sin(g), cos(g), 0), (0, 0, 1)))
- ma = ma * rmat.resize4x4()
+ ma = ma * rmat.to_4x4()
obj.matrix_world = ma #must be matrix4x4
obj.location = o
diff --git a/io_import_scene_unreal_psk.py b/io_import_scene_unreal_psk.py
index 2fcb70d1..4fe97333 100644
--- a/io_import_scene_unreal_psk.py
+++ b/io_import_scene_unreal_psk.py
@@ -389,10 +389,10 @@ def pskimport(infile):
#print( "LINKING:" , bone.parent ,"j")
parentbone = ob_new.data.edit_bones[bone.parent]
newbone.parent = parentbone
- rotmatrix = bone.bindmat.to_matrix().resize4x4().rotation_part()
+ rotmatrix = bone.bindmat.to_matrix().to_4x4().to_3x3() # XXX, redundant matrix conversion?
- #parent_head = parentbone.head * parentbone.matrix.to_quat().inverse()
- #parent_tail = parentbone.tail * parentbone.matrix.to_quat().inverse()
+ #parent_head = parentbone.head * parentbone.matrix.to_quaternion().inverse()
+ #parent_tail = parentbone.tail * parentbone.matrix.to_quaternion().inverse()
#location=Vector(pos_x,pos_y,pos_z)
#set_position = (parent_tail - parent_head) + location
#print("tmp head:",set_position)
@@ -409,7 +409,7 @@ def pskimport(infile):
newbone.tail.y = parentbone.head.y + (pos_y + bonesize * rotmatrix[1][1])
newbone.tail.z = parentbone.head.z + (pos_z + bonesize * rotmatrix[1][2])
else:
- rotmatrix = bone.bindmat.to_matrix().resize4x4().rotation_part()
+ rotmatrix = bone.bindmat.to_matrix().resize_4x4().to_3x3() # XXX, redundant matrix conversion?
newbone.head.x = bone.bindpos[0]
newbone.head.y = bone.bindpos[1]
newbone.head.z = bone.bindpos[2]
diff --git a/io_scene_3ds/export_3ds.py b/io_scene_3ds/export_3ds.py
index 5a467297..1a85c5e2 100644
--- a/io_scene_3ds/export_3ds.py
+++ b/io_scene_3ds/export_3ds.py
@@ -777,7 +777,7 @@ def make_track_chunk(ID, obj):
track_chunk.add_variable("position", _3ds_point_3d(obj.getLocation()))
elif ID==ROT_TRACK_TAG:
# rotation (quaternion, angle first, followed by axis):
- q = obj.getEuler().to_quat()
+ q = obj.getEuler().to_quaternion() # XXX, todo!
track_chunk.add_variable("rotation", _3ds_point_4d((q.angle, q.axis[0], q.axis[1], q.axis[2])))
elif ID==SCL_TRACK_TAG:
# scale vector:
diff --git a/io_scene_3ds/import_3ds.py b/io_scene_3ds/import_3ds.py
index 26093078..33abcd4d 100644
--- a/io_scene_3ds/import_3ds.py
+++ b/io_scene_3ds/import_3ds.py
@@ -822,7 +822,7 @@ def load_3ds(filepath, context, IMPORT_CONSTRAIN_BOUNDS=10.0, IMAGE_SEARCH=True,
for ob in importedObjects:
if ob.type == 'MESH':
me = ob.data
- me.transform(ob.matrix_local.copy().invert())
+ me.transform(ob.matrix_local.inverted())
# Done DUMMYVERT
"""
diff --git a/io_scene_fbx/export_fbx.py b/io_scene_fbx/export_fbx.py
index f1eabc67..a5d173c5 100644
--- a/io_scene_fbx/export_fbx.py
+++ b/io_scene_fbx/export_fbx.py
@@ -413,7 +413,7 @@ def save(operator, context, filepath="",
# self.restMatrix = blenBone.matrix['ARMATURESPACE']
# not used yet
- # self.restMatrixInv = self.restMatrix.copy().invert()
+ # self.restMatrixInv = self.restMatrix.inverted()
# self.restMatrixLocal = None # set later, need parent matrix
self.parent = None
@@ -429,7 +429,7 @@ def save(operator, context, filepath="",
'''
def calcRestMatrixLocal(self):
if self.parent:
- self.restMatrixLocal = self.restMatrix * self.parent.restMatrix.copy().invert()
+ self.restMatrixLocal = self.restMatrix * self.parent.restMatrix.inverted()
else:
self.restMatrixLocal = self.restMatrix.copy()
'''
@@ -513,20 +513,20 @@ def save(operator, context, filepath="",
def parRelMatrix(self):
if self.fbxParent:
- return self.fbxParent.matrixWorld.copy().invert() * self.matrixWorld
+ return self.fbxParent.matrixWorld.inverted() * self.matrixWorld
else:
return self.matrixWorld
def setPoseFrame(self, f, fake=False):
if fake:
# annoying, have to clear GLOBAL_MATRIX
- self.__anim_poselist[f] = self.matrixWorld * GLOBAL_MATRIX.copy().invert()
+ self.__anim_poselist[f] = self.matrixWorld * GLOBAL_MATRIX.inverted()
else:
self.__anim_poselist[f] = self.blenObject.matrix_world.copy()
def getAnimParRelMatrix(self, frame):
if self.fbxParent:
- #return (self.__anim_poselist[frame] * self.fbxParent.__anim_poselist[frame].copy().invert() ) * GLOBAL_MATRIX
+ #return (self.__anim_poselist[frame] * self.fbxParent.__anim_poselist[frame].inverted() ) * GLOBAL_MATRIX
return (GLOBAL_MATRIX * self.fbxParent.__anim_poselist[frame]).invert() * (GLOBAL_MATRIX * self.__anim_poselist[frame])
else:
return GLOBAL_MATRIX * self.__anim_poselist[frame]
@@ -534,9 +534,9 @@ def save(operator, context, filepath="",
def getAnimParRelMatrixRot(self, frame):
obj_type = self.blenObject.type
if self.fbxParent:
- matrix_rot = ((GLOBAL_MATRIX * self.fbxParent.__anim_poselist[frame]).invert() * (GLOBAL_MATRIX * self.__anim_poselist[frame])).rotation_part()
+ matrix_rot = ((GLOBAL_MATRIX * self.fbxParent.__anim_poselist[frame]).invert() * (GLOBAL_MATRIX * self.__anim_poselist[frame])).to_3x3()
else:
- matrix_rot = (GLOBAL_MATRIX * self.__anim_poselist[frame]).rotation_part()
+ matrix_rot = (GLOBAL_MATRIX * self.__anim_poselist[frame]).to_3x3()
# Lamps need to be rotated
if obj_type == 'LAMP':
@@ -609,7 +609,7 @@ def save(operator, context, filepath="",
#par_matrix = mtx4_z90 * (parent.matrix['ARMATURESPACE'] * matrix_mod)
par_matrix = parent.matrix_local * mtx4_z90 # dont apply armature matrix anymore
# par_matrix = mtx4_z90 * parent.matrix['ARMATURESPACE'] # dont apply armature matrix anymore
- matrix = par_matrix.copy().invert() * matrix
+ matrix = par_matrix.inverted() * matrix
loc, rot, scale = matrix.decompose()
matrix_rot = rot.to_matrix()
@@ -1091,7 +1091,7 @@ def save(operator, context, filepath="",
do_light = not (light.use_only_shadow or (not light.use_diffuse and not light.use_specular))
do_shadow = (light.shadow_method in ('RAY_SHADOW', 'BUFFER_SHADOW'))
- scale = abs(GLOBAL_MATRIX.scale_part()[0]) # scale is always uniform in this case
+ scale = abs(GLOBAL_MATRIX.to_scale()[0]) # scale is always uniform in this case
file.write('\n\t\t\tProperty: "LightType", "enum", "",%i' % light_type)
file.write('\n\t\t\tProperty: "CastLightOnObject", "bool", "",1')
@@ -1434,10 +1434,10 @@ def save(operator, context, filepath="",
if my_mesh.fbxParent:
# TODO FIXME, this case is broken in some cases. skinned meshes just shouldnt have parents where possible!
- m = (my_mesh.matrixWorld.copy().invert() * my_bone.fbxArm.matrixWorld.copy() * my_bone.restMatrix) * mtx4_z90
+ m = (my_mesh.matrixWorld.inverted() * my_bone.fbxArm.matrixWorld.copy() * my_bone.restMatrix) * mtx4_z90
else:
# Yes! this is it... - but dosnt work when the mesh is a.
- m = (my_mesh.matrixWorld.copy().invert() * my_bone.fbxArm.matrixWorld.copy() * my_bone.restMatrix) * mtx4_z90
+ m = (my_mesh.matrixWorld.inverted() * my_bone.fbxArm.matrixWorld.copy() * my_bone.restMatrix) * mtx4_z90
#m = mtx4_z90 * my_bone.restMatrix
matstr = mat4x4str(m)
@@ -2728,9 +2728,9 @@ Takes: {''')
for TX_LAYER, TX_CHAN in enumerate('TRS'): # transform, rotate, scale
if TX_CHAN == 'T':
- context_bone_anim_vecs = [mtx[0].translation_part() for mtx in context_bone_anim_mats]
+ context_bone_anim_vecs = [mtx[0].to_translation() for mtx in context_bone_anim_mats]
elif TX_CHAN == 'S':
- context_bone_anim_vecs = [mtx[0].scale_part() for mtx in context_bone_anim_mats]
+ context_bone_anim_vecs = [mtx[0].to_scale() for mtx in context_bone_anim_mats]
elif TX_CHAN == 'R':
# Was....
# elif TX_CHAN=='R': context_bone_anim_vecs = [mtx[1].to_euler() for mtx in context_bone_anim_mats]
diff --git a/io_scene_obj/export_obj.py b/io_scene_obj/export_obj.py
index 7fdff183..d3fd917e 100644
--- a/io_scene_obj/export_obj.py
+++ b/io_scene_obj/export_obj.py
@@ -218,7 +218,7 @@ def write_nurb(file, ob, ob_mat):
do_endpoints = (do_closed == 0) and nu.use_endpoint_u
for pt in nu.points:
- pt = pt.co.copy().resize3D() * ob_mat
+ pt = pt.co.to_3d() * ob_mat
file.write('v %.6f %.6f %.6f\n' % (pt[0], pt[1], pt[2]))
pt_num += 1
tot_verts += pt_num
diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py
index 822065b2..a3e37648 100644
--- a/io_scene_x3d/export_x3d.py
+++ b/io_scene_x3d/export_x3d.py
@@ -47,7 +47,7 @@ def round_color(col, cp):
def matrix_direction(mtx):
- return (mathutils.Vector((0.0, 0.0, -1.0)) * mtx.rotation_part()).normalize()[:]
+ return (mathutils.Vector((0.0, 0.0, -1.0)) * mtx.to_3x3()).normalize()[:]
##########################################################
@@ -204,7 +204,7 @@ class x3d_class:
dx, dy, dz = matrix_direction(mtx)
- location = mtx.translation_part()[:]
+ location = mtx.to_translation()[:]
radius = lamp.distance * math.cos(beamWidth)
# radius = lamp.dist*math.cos(beamWidth)
@@ -247,7 +247,7 @@ class x3d_class:
amb_intensity = 0.0
intensity = min(lamp.energy / 1.75, 1.0)
- location = mtx.translation_part()[:]
+ location = mtx.to_translation()[:]
self.file.write("<PointLight DEF=\"%s\" " % safeName)
self.file.write("ambientIntensity=\"%.4f\" " % amb_intensity)
diff --git a/io_scene_x3d/import_x3d.py b/io_scene_x3d/import_x3d.py
index 78a14605..307f6670 100644
--- a/io_scene_x3d/import_x3d.py
+++ b/io_scene_x3d/import_x3d.py
@@ -1465,8 +1465,8 @@ def translateTransform(node, ancestry):
tx = node.getFieldAsFloatTuple('translation', None, ancestry) # (0.0, 0.0, 0.0)
if cent:
- cent_mat = Matrix.Translation(Vector(cent)).resize4x4()
- cent_imat = cent_mat.copy().invert()
+ cent_mat = Matrix.Translation(cent)
+ cent_imat = cent_mat.inverted()
else:
cent_mat = cent_imat = None
@@ -1482,12 +1482,12 @@ def translateTransform(node, ancestry):
if scaori:
scaori_mat = translateRotation(scaori)
- scaori_imat = scaori_mat.copy().invert()
+ scaori_imat = scaori_mat.inverted()
else:
scaori_mat = scaori_imat = None
if tx:
- tx_mat = Matrix.Translation(Vector(tx)).resize4x4()
+ tx_mat = Matrix.Translation(tx)
else:
tx_mat = None
@@ -1509,8 +1509,8 @@ def translateTexTransform(node, ancestry):
if cent:
# cent is at a corner by default
- cent_mat = Matrix.Translation(Vector(cent).resize3D()).resize4x4()
- cent_imat = cent_mat.copy().invert()
+ cent_mat = Matrix.Translation(Vector(cent).resize_3d())
+ cent_imat = cent_mat.inverted()
else:
cent_mat = cent_imat = None
@@ -1525,7 +1525,7 @@ def translateTexTransform(node, ancestry):
sca_mat = None
if tx:
- tx_mat = Matrix.Translation(Vector(tx).resize3D()).resize4x4()
+ tx_mat = Matrix.Translation(Vector(tx).resize_3d())
else:
tx_mat = None
@@ -2042,7 +2042,7 @@ def importMesh_Box(geom, ancestry):
# Scale the box to the size set
scale_mat = Matrix(((size[0], 0, 0), (0, size[1], 0), (0, 0, size[2]))) * 0.5
- bpymesh.transform(scale_mat.resize4x4())
+ bpymesh.transform(scale_mat.to_4x4())
return bpymesh
@@ -2266,7 +2266,7 @@ def importLamp_DirectionalLight(node, ancestry):
bpylamp.color = color
# lamps have their direction as -z, yup
- mtx = Vector(direction).to_track_quat('-Z', 'Y').to_matrix().resize4x4()
+ mtx = Vector(direction).to_track_quat('-Z', 'Y').to_matrix().to_4x4()
return bpylamp, mtx
@@ -2305,7 +2305,7 @@ def importLamp_SpotLight(node, ancestry):
# Convert
# lamps have their direction as -z, y==up
- mtx = Matrix.Translation(Vector(location)) * Vector(direction).to_track_quat('-Z', 'Y').to_matrix().resize4x4()
+ mtx = Matrix.Translation(location) * Vector(direction).to_track_quat('-Z', 'Y').to_matrix().to_4x4()
return bpylamp, mtx
diff --git a/modules/add_utils.py b/modules/add_utils.py
index 62bd5f78..bc54abc6 100644
--- a/modules/add_utils.py
+++ b/modules/add_utils.py
@@ -47,19 +47,19 @@ def add_object_align_init(context, operator):
and operator.properties.is_property_set("location")
and operator.properties.is_property_set("rotation")):
location = mathutils.Matrix.Translation(mathutils.Vector(operator.properties.location))
- rotation = mathutils.Euler(operator.properties.rotation).to_matrix().resize4x4()
+ rotation = mathutils.Euler(operator.properties.rotation).to_matrix().to_4x4()
else:
# TODO, local view cursor!
location = mathutils.Matrix.Translation(context.scene.cursor_location)
if context.user_preferences.edit.object_align == 'VIEW' and context.space_data.type == 'VIEW_3D':
- rotation = context.space_data.region_3d.view_matrix.rotation_part().invert().resize4x4()
+ rotation = context.space_data.region_3d.view_matrix.to_3x3().inverted().to_4x4()
else:
rotation = mathutils.Matrix()
# set the operator properties
if operator:
- operator.properties.location = location.translation_part()
+ operator.properties.location = location.to_translation()
operator.properties.rotation = rotation.to_euler()
return location * rotation
diff --git a/render_povray/render.py b/render_povray/render.py
index 85b425c0..cd1c80a5 100644
--- a/render_povray/render.py
+++ b/render_povray/render.py
@@ -516,7 +516,7 @@ def write_pov(filename, scene=None, info_callback=None):
# compute resolution
Qsize = float(render.resolution_x) / float(render.resolution_y)
tabWrite("#declare camLocation = <%.6f, %.6f, %.6f>;\n" % (matrix[3][0], matrix[3][1], matrix[3][2]))
- tabWrite("#declare camLookAt = <%.6f, %.6f, %.6f>;\n" % tuple([degrees(e) for e in matrix.rotation_part().to_euler()]))
+ tabWrite("#declare camLookAt = <%.6f, %.6f, %.6f>;\n" % tuple([degrees(e) for e in matrix.to_3x3().to_euler()]))
tabWrite("camera {\n")
if scene.pov_baking_enable and active_object and active_object.type == 'MESH':
@@ -533,7 +533,7 @@ def write_pov(filename, scene=None, info_callback=None):
tabWrite("up <0, 1, 0>\n")
tabWrite("angle %f\n" % (360.0 * atan(16.0 / camera.data.lens) / pi))
- tabWrite("rotate <%.6f, %.6f, %.6f>\n" % tuple([degrees(e) for e in matrix.rotation_part().to_euler()]))
+ tabWrite("rotate <%.6f, %.6f, %.6f>\n" % tuple([degrees(e) for e in matrix.to_3x3().to_euler()]))
tabWrite("translate <%.6f, %.6f, %.6f>\n" % (matrix[3][0], matrix[3][1], matrix[3][2]))
if camera.data.pov_dof_enable and focal_point != 0:
tabWrite("aperture %.3g\n" % camera.data.pov_dof_aperture)
diff --git a/rigify/rigs/misc/delta.py b/rigify/rigs/misc/delta.py
index 2157970a..bc5f7eba 100644
--- a/rigify/rigs/misc/delta.py
+++ b/rigify/rigs/misc/delta.py
@@ -144,15 +144,15 @@ def set_mat(obj, bone_name, matrix):
a.transform(matrix)
- d = acos(a.matrix.to_quat().dot(matrix.to_quat())) * 2
+ d = acos(a.matrix.to_quaternion().dot(matrix.to_quaternion())) * 2.0
roll_1 = a.roll + d
roll_2 = a.roll - d
a.roll = roll_1
- d1 = a.matrix.to_quat().dot(matrix.to_quat())
+ d1 = a.matrix.to_quaternion().dot(matrix.to_quaternion())
a.roll = roll_2
- d2 = a.matrix.to_quat().dot(matrix.to_quat())
+ d2 = a.matrix.to_quaternion().dot(matrix.to_quaternion())
if d1 > d2:
a.roll = roll_1
diff --git a/rigify/utils.py b/rigify/utils.py
index 84d4c4f1..f0a19aac 100644
--- a/rigify/utils.py
+++ b/rigify/utils.py
@@ -237,12 +237,12 @@ def obj_to_bone(obj, rig, bone_name):
mat = rig.matrix_world * bone.matrix_local
- obj.location = mat.translation_part()
+ obj.location = mat.to_translation()
obj.rotation_mode = 'XYZ'
obj.rotation_euler = mat.to_euler()
- scl = mat.scale_part()
+ scl = mat.to_scale()
scl_avg = (scl[0] + scl[1] + scl[2]) / 3
obj.scale = (bone.length * scl_avg), (bone.length * scl_avg), (bone.length * scl_avg)
diff --git a/space_view3d_copy_attributes.py b/space_view3d_copy_attributes.py
index b31a66c2..2b1ccebe 100644
--- a/space_view3d_copy_attributes.py
+++ b/space_view3d_copy_attributes.py
@@ -121,13 +121,13 @@ def getmat(bone, active, context, ignoreparent):
def rotcopy(item, mat):
'''copy rotation to item from matrix mat depending on item.rotation_mode'''
if item.rotation_mode == 'QUATERNION':
- item.rotation_quaternion = mat.rotation_part().to_quat()
+ item.rotation_quaternion = mat.to_3x3().to_quaternion()
elif item.rotation_mode == 'AXIS_ANGLE':
- quat = mat.rotation_part().to_quat()
+ quat = mat.to_3x3().to_quaternion()
item.rotation_axis_angle = Vector([quat.axis[0],
quat.axis[1], quat.axis[2], quat.angle])
else:
- item.rotation_euler = mat.rotation_part().to_euler(item.rotation_mode)
+ item.rotation_euler = mat.to_3x3().to_euler(item.rotation_mode)
def pLoopExec(self, context, funk):
@@ -146,7 +146,7 @@ def pLocLocExec(bone, active, context):
def pLocRotExec(bone, active, context):
- rotcopy(bone, active.matrix_basis.rotation_part())
+ rotcopy(bone, active.matrix_basis.to_3x3())
def pLocScaExec(bone, active, context):
@@ -154,7 +154,7 @@ def pLocScaExec(bone, active, context):
def pVisLocExec(bone, active, context):
- bone.location = getmat(bone, active, context, False).translation_part()
+ bone.location = getmat(bone, active, context, False).to_translation()
def pVisRotExec(bone, active, context):
@@ -165,7 +165,7 @@ def pVisRotExec(bone, active, context):
def pVisScaExec(bone, active, context):
bone.scale = getmat(bone, active, context,
not context.active_object.data.bones[bone.name].use_inherit_scale)\
- .scale_part()
+ .to_scale()
def pDrwExec(bone, active, context):
@@ -289,7 +289,7 @@ def obLoc(ob, active, context):
def obRot(ob, active, context):
- rotcopy(ob, active.matrix_world.rotation_part())
+ rotcopy(ob, active.matrix_world.to_3x3())
def obSca(ob, active, context):
diff --git a/space_view3d_math_vis/draw.py b/space_view3d_math_vis/draw.py
index a7f25d37..5f2593b5 100644
--- a/space_view3d_math_vis/draw.py
+++ b/space_view3d_math_vis/draw.py
@@ -193,7 +193,7 @@ def draw_callback_view(self, context):
glBegin(GL_POINTS)
glColor3f(0.5, 0.5, 1)
for key, vec in data_vector.items():
- glVertex3f(*vec.copy().resize3D())
+ glVertex3f(*vec.to_3d())
glEnd();
glPointSize(1.0)
@@ -219,13 +219,13 @@ def draw_callback_view(self, context):
if data_quat:
loc = context.scene.cursor_location.copy()
for quat in data_quat.values():
- mat = quat.to_matrix().resize4x4()
+ mat = quat.to_matrix().to_4x4()
mat[3][0:3] = loc
draw_matrix(mat)
if data_euler:
loc = context.scene.cursor_location.copy()
for eul in data_euler.values():
- mat = eul.to_matrix().resize4x4()
+ mat = eul.to_matrix().to_4x4()
mat[3][0:3] = loc
draw_matrix(mat)
diff --git a/space_view3d_math_vis/utils.py b/space_view3d_math_vis/utils.py
index 5511cf30..b0a7757d 100644
--- a/space_view3d_math_vis/utils.py
+++ b/space_view3d_math_vis/utils.py
@@ -44,11 +44,11 @@ def console_math_data():
if var_type is Matrix:
if var.col_size != 4 or var.row_size != 4:
- var = var.copy().resize4x4()
+ var = var.to_4x4()
data_matrix[key] = var
elif var_type is Vector:
if len(var) < 3:
- var = var.copy().resize3D()
+ var = var.to_3d()
data_vector[key] = var
elif var_type is Quaternion:
data_quat[key] = var
diff --git a/space_view3d_panel_measure.py b/space_view3d_panel_measure.py
index e137840f..8fd00712 100644
--- a/space_view3d_panel_measure.py
+++ b/space_view3d_panel_measure.py
@@ -237,7 +237,7 @@ def getMeasurePoints(context):
# local ... the object center to the 3D cursor.
# global ... the origin to the 3D cursor.
cur_loc = sce.cursor_location
- obj_loc = obj.matrix_world.translation_part()
+ obj_loc = obj.matrix_world.to_translation()
# Convert to local space, if needed.
if measureLocal(sce):
@@ -272,7 +272,7 @@ def getMeasurePoints(context):
# Two vertices selected.
# We measure the distance between the
# two selected vertices.
- obj_loc = obj.matrix_world.translation_part()
+ obj_loc = obj.matrix_world.to_translation()
vert1_loc = verts_selected[0].co.copy()
vert2_loc = verts_selected[1].co.copy()
@@ -299,15 +299,15 @@ def getMeasurePoints(context):
# 2 objects selected.
# We measure the distance between the 2 selected objects.
obj1, obj2 = context.selected_objects
- obj1_loc = obj1.matrix_world.translation_part()
- obj2_loc = obj2.matrix_world.translation_part()
+ obj1_loc = obj1.matrix_world.to_translation()
+ obj2_loc = obj2.matrix_world.to_translation()
return (obj1_loc, obj2_loc, COLOR_GLOBAL)
elif (obj):
# One object selected.
# We measure the distance from the object to the 3D cursor.
cur_loc = sce.cursor_location
- obj_loc = obj.matrix_world.translation_part()
+ obj_loc = obj.matrix_world.to_translation()
return (obj_loc, cur_loc, COLOR_GLOBAL)
elif not context.selected_objects: