[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [909] trunk/py/scripts/addons: updates for changes in mathutils
Campbell Barton
ideasman42 at gmail.com
Wed Aug 11 18:42:23 CEST 2010
Revision: 909
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=909
Author: campbellbarton
Date: 2010-08-11 18:42:22 +0200 (Wed, 11 Aug 2010)
Log Message:
-----------
updates for changes in mathutils
Modified Paths:
--------------
trunk/py/scripts/addons/add_curve_aceous_galore.py
trunk/py/scripts/addons/add_curve_torus_knots.py
trunk/py/scripts/addons/add_mesh_3d_function_surface.py
trunk/py/scripts/addons/add_mesh_BoltFactory/Boltfactory.py
trunk/py/scripts/addons/add_mesh_ant_landscape.py
trunk/py/scripts/addons/add_mesh_extras.py
trunk/py/scripts/addons/add_mesh_gears.py
trunk/py/scripts/addons/add_mesh_gemstones.py
trunk/py/scripts/addons/add_mesh_pipe_joint.py
trunk/py/scripts/addons/add_mesh_twisted_torus.py
trunk/py/scripts/addons/io_export_directx_x.py
trunk/py/scripts/addons/io_import_scene_mhx.py
Modified: trunk/py/scripts/addons/add_curve_aceous_galore.py
===================================================================
--- trunk/py/scripts/addons/add_curve_aceous_galore.py 2010-08-11 15:57:53 UTC (rev 908)
+++ trunk/py/scripts/addons/add_curve_aceous_galore.py 2010-08-11 16:42:22 UTC (rev 909)
@@ -576,7 +576,7 @@
# 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'):
Modified: trunk/py/scripts/addons/add_curve_torus_knots.py
===================================================================
--- trunk/py/scripts/addons/add_curve_torus_knots.py 2010-08-11 15:57:53 UTC (rev 908)
+++ trunk/py/scripts/addons/add_curve_torus_knots.py 2010-08-11 16:42:22 UTC (rev 909)
@@ -41,7 +41,7 @@
# 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'):
Modified: trunk/py/scripts/addons/add_mesh_3d_function_surface.py
===================================================================
--- trunk/py/scripts/addons/add_mesh_3d_function_surface.py 2010-08-11 15:57:53 UTC (rev 908)
+++ trunk/py/scripts/addons/add_mesh_3d_function_surface.py 2010-08-11 16:42:22 UTC (rev 909)
@@ -124,7 +124,7 @@
# 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'):
Modified: trunk/py/scripts/addons/add_mesh_BoltFactory/Boltfactory.py
===================================================================
--- trunk/py/scripts/addons/add_mesh_BoltFactory/Boltfactory.py 2010-08-11 15:57:53 UTC (rev 908)
+++ trunk/py/scripts/addons/add_mesh_BoltFactory/Boltfactory.py 2010-08-11 16:42:22 UTC (rev 909)
@@ -29,7 +29,7 @@
# 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'):
Modified: trunk/py/scripts/addons/add_mesh_ant_landscape.py
===================================================================
--- trunk/py/scripts/addons/add_mesh_ant_landscape.py 2010-08-11 15:57:53 UTC (rev 908)
+++ trunk/py/scripts/addons/add_mesh_ant_landscape.py 2010-08-11 16:42:22 UTC (rev 909)
@@ -38,7 +38,7 @@
###------------------------------------------------------------
# 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'):
Modified: trunk/py/scripts/addons/add_mesh_extras.py
===================================================================
--- trunk/py/scripts/addons/add_mesh_extras.py 2010-08-11 15:57:53 UTC (rev 908)
+++ trunk/py/scripts/addons/add_mesh_extras.py 2010-08-11 16:42:22 UTC (rev 909)
@@ -36,7 +36,7 @@
# 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 @@
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)
Modified: trunk/py/scripts/addons/add_mesh_gears.py
===================================================================
--- trunk/py/scripts/addons/add_mesh_gears.py 2010-08-11 15:57:53 UTC (rev 908)
+++ trunk/py/scripts/addons/add_mesh_gears.py 2010-08-11 16:42:22 UTC (rev 909)
@@ -70,7 +70,7 @@
# 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'):
Modified: trunk/py/scripts/addons/add_mesh_gemstones.py
===================================================================
--- trunk/py/scripts/addons/add_mesh_gemstones.py 2010-08-11 15:57:53 UTC (rev 908)
+++ trunk/py/scripts/addons/add_mesh_gemstones.py 2010-08-11 16:42:22 UTC (rev 909)
@@ -36,7 +36,7 @@
# 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'):
Modified: trunk/py/scripts/addons/add_mesh_pipe_joint.py
===================================================================
--- trunk/py/scripts/addons/add_mesh_pipe_joint.py 2010-08-11 15:57:53 UTC (rev 908)
+++ trunk/py/scripts/addons/add_mesh_pipe_joint.py 2010-08-11 16:42:22 UTC (rev 909)
@@ -113,7 +113,7 @@
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 @@
# 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'):
Modified: trunk/py/scripts/addons/add_mesh_twisted_torus.py
===================================================================
--- trunk/py/scripts/addons/add_mesh_twisted_torus.py 2010-08-11 15:57:53 UTC (rev 908)
+++ trunk/py/scripts/addons/add_mesh_twisted_torus.py 2010-08-11 16:42:22 UTC (rev 909)
@@ -51,7 +51,7 @@
# 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'):
Modified: trunk/py/scripts/addons/io_export_directx_x.py
===================================================================
--- trunk/py/scripts/addons/io_export_directx_x.py 2010-08-11 15:57:53 UTC (rev 908)
+++ trunk/py/scripts/addons/io_export_directx_x.py 2010-08-11 16:42:22 UTC (rev 909)
@@ -111,15 +111,15 @@
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 @@
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 @@
# - 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 @@
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:
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list