diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-07-25 06:02:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-07-25 06:02:10 +0400 |
commit | f7ed59065a9069de777e4957f48650d72bd2a400 (patch) | |
tree | ee3ea6c554015dc242c89dbfe72b51a1963e4121 | |
parent | c8c166df88185920d098144dd4d8c894d2288a4c (diff) |
reverse matrix, vector multiplication order,
previous order deprecated.
-rw-r--r-- | io_scene_3ds/import_3ds.py | 2 | ||||
-rw-r--r-- | io_scene_fbx/export_fbx.py | 8 | ||||
-rw-r--r-- | io_scene_map/__init__.py | 7 | ||||
-rw-r--r-- | io_scene_obj/export_obj.py | 3 | ||||
-rw-r--r-- | io_scene_x3d/export_x3d.py | 2 |
5 files changed, 11 insertions, 11 deletions
diff --git a/io_scene_3ds/import_3ds.py b/io_scene_3ds/import_3ds.py index 9dfda2aa..209fc404 100644 --- a/io_scene_3ds/import_3ds.py +++ b/io_scene_3ds/import_3ds.py @@ -767,7 +767,7 @@ def process_next_chunk(file, previous_chunk, importedObjects, IMAGE_SEARCH): if ob.type == 'MESH': pivot = pivot_list[ind] pivot_matrix = object_matrix.get(ob, mathutils.Matrix()) # unlikely to fail - pivot_matrix = mathutils.Matrix.Translation(-pivot * pivot_matrix.to_3x3()) + pivot_matrix = mathutils.Matrix.Translation(pivot_matrix.to_3x3() * -pivot) ob.data.transform(pivot_matrix) diff --git a/io_scene_fbx/export_fbx.py b/io_scene_fbx/export_fbx.py index 4cc7adb7..61c27059 100644 --- a/io_scene_fbx/export_fbx.py +++ b/io_scene_fbx/export_fbx.py @@ -374,7 +374,7 @@ def save_single(operator, scene, filepath="", if obj_type == 'LAMP': matrix_rot = matrix_rot * mtx_x90 elif obj_type == 'CAMERA': - y = Vector((0.0, 1.0, 0.0)) * matrix_rot + y = matrix_rot * Vector((0.0, 1.0, 0.0)) matrix_rot = Matrix.Rotation(math.pi / 2.0, 3, y) * matrix_rot return matrix_rot @@ -467,7 +467,7 @@ def save_single(operator, scene, filepath="", if ob and ob.type == 'LAMP': matrix_rot = matrix_rot * mtx_x90 elif ob and ob.type == 'CAMERA': - y = Vector((0.0, 1.0, 0.0)) * matrix_rot + y = matrix_rot * Vector((0.0, 1.0, 0.0)) matrix_rot = Matrix.Rotation(math.pi / 2.0, 3, y) * matrix_rot # else do nothing. @@ -922,8 +922,8 @@ def save_single(operator, scene, filepath="", ) file.write('\n\t\tPosition: %.6f,%.6f,%.6f' % loc) - file.write('\n\t\tUp: %.6f,%.6f,%.6f' % tuple(Vector((0.0, 1.0, 0.0)) * matrix_rot)) - file.write('\n\t\tLookAt: %.6f,%.6f,%.6f' % tuple(Vector((0.0, 0.0, -1.0)) * matrix_rot)) + file.write('\n\t\tUp: %.6f,%.6f,%.6f' % (matrix_rot * Vector((0.0, 1.0, 0.0)))[:]) + file.write('\n\t\tLookAt: %.6f,%.6f,%.6f' % (matrix_rot * Vector((0.0, 0.0, -1.0)))[:]) #file.write('\n\t\tUp: 0,0,0' ) #file.write('\n\t\tLookAt: 0,0,0' ) diff --git a/io_scene_map/__init__.py b/io_scene_map/__init__.py index cc265410..51e889d9 100644 --- a/io_scene_map/__init__.py +++ b/io_scene_map/__init__.py @@ -24,10 +24,11 @@ bl_info = { "blender": (2, 5, 7), "api": 35622, "location": "File > Export", - "description": "Export MAP brushes, nurbs surfaces, lamps and empties as map nodes", + "description": ("Export MAP brushes, nurbs surfaces, " + "lamps and empties as map nodes"), "warning": "", - "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.5/Py/"\ - "Scripts/Import-Export/Quake_MAP", + "wiki_url": ("http://wiki.blender.org/index.php/Extensions:2.5/Py/" + "Scripts/Import-Export/Quake_MAP"), "tracker_url": "", "support": 'OFFICIAL', "category": "Import-Export"} diff --git a/io_scene_obj/export_obj.py b/io_scene_obj/export_obj.py index a6570907..0eb1b8d3 100644 --- a/io_scene_obj/export_obj.py +++ b/io_scene_obj/export_obj.py @@ -172,8 +172,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.to_3d() * ob_mat - file.write('v %.6f %.6f %.6f\n' % (pt[0], pt[1], pt[2])) + file.write('v %.6f %.6f %.6f\n' % (ob_mat * pt.co.to_3d())[:]) pt_num += 1 tot_verts += pt_num diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py index ae385a5e..c54d5d0a 100644 --- a/io_scene_x3d/export_x3d.py +++ b/io_scene_x3d/export_x3d.py @@ -74,7 +74,7 @@ def clamp_color(col): def matrix_direction_neg_z(matrix): - return (mathutils.Vector((0.0, 0.0, -1.0)) * matrix.to_3x3()).normalized()[:] + return (matrix.to_3x3() * mathutils.Vector((0.0, 0.0, -1.0))).normalized()[:] def prefix_quoted_str(value, prefix): |