diff --git a/add_curve_aceous_galore.py b/add_curve_aceous_galore.py index 7b7159c0ed60adbcb9518fa8df76c1ab7d26ea97..a4ce149e0acdcaa5b92d0424fb6390ccdabc4d05 100644 --- a/add_curve_aceous_galore.py +++ b/add_curve_aceous_galore.py @@ -652,7 +652,7 @@ def createCurve(vertArray, options, curveOptions, align_matrix): scene.objects.link(new_obj) # place in active scene new_obj.selected = True # set as selected scene.objects.active = new_obj # set as active - new_obj.matrix = align_matrix # apply matrix + new_obj.matrix_world = align_matrix # apply matrix # set bezierhandles if splineType == 'BEZIER': diff --git a/add_curve_torus_knots.py b/add_curve_torus_knots.py index 245d8a6966b603e8e7a9525f17463487c2cd6a87..f49c25e295087572d1aa76ee52079e8331360d5b 100644 --- a/add_curve_torus_knots.py +++ b/add_curve_torus_knots.py @@ -105,7 +105,7 @@ def createCurve(vertArray, GEO, align_matrix): scene.objects.link(new_obj) # place in active scene new_obj.selected = True # set as selected scene.objects.active = new_obj # set as active - new_obj.matrix = align_matrix # apply matrix + new_obj.matrix_world = align_matrix # apply matrix return diff --git a/add_mesh_3d_function_surface.py b/add_mesh_3d_function_surface.py index c4abc8381696e635e7e4d21802971444d5546004..bc9c4814f692877ab185f42f037069aca2012fd9 100644 --- a/add_mesh_3d_function_surface.py +++ b/add_mesh_3d_function_surface.py @@ -196,7 +196,7 @@ def create_mesh_object(context, verts, edges, faces, name, edit, align_matrix): # Place the object at the 3D cursor location. # apply viewRotaion - ob_new.matrix = align_matrix + ob_new.matrix_world = align_matrix if obj_act and obj_act.mode == 'EDIT': if not edit: diff --git a/add_mesh_extras.py b/add_mesh_extras.py index 230efa0d0cc33630415020a6b1be4b3604636d72..4c6b842adbe3f2ab23781471754f63c1db5b4b6c 100644 --- a/add_mesh_extras.py +++ b/add_mesh_extras.py @@ -107,7 +107,7 @@ def create_mesh_object(context, verts, edges, faces, name, edit, align_matrix): # Place the object at the 3D cursor location. # apply viewRotaion - ob_new.matrix = align_matrix + ob_new.matrix_world = align_matrix if obj_act and obj_act.mode == 'EDIT': if not edit: diff --git a/add_mesh_gears.py b/add_mesh_gears.py index f329de9114400973ef3ff80f8349fec1c471025c..b08f3cd5ba3135b6ff5c349e9d0dbda46945a0c9 100644 --- a/add_mesh_gears.py +++ b/add_mesh_gears.py @@ -142,7 +142,7 @@ def create_mesh_object(context, verts, edges, faces, name, edit, align_matrix): # Place the object at the 3D cursor location. # apply viewRotaion - ob_new.matrix = align_matrix + ob_new.matrix_world = align_matrix if obj_act and obj_act.mode == 'EDIT': diff --git a/add_mesh_gemstones.py b/add_mesh_gemstones.py index 5f916d6701abccb4c408b03ecb1cc83e58fc6d8f..0d12ab16b9ecdd7d6986dda19a38df8be6085d40 100644 --- a/add_mesh_gemstones.py +++ b/add_mesh_gemstones.py @@ -107,7 +107,7 @@ def create_mesh_object(context, verts, edges, faces, name, edit, align_matrix): # Place the object at the 3D cursor location. # apply viewRotaion - ob_new.matrix = align_matrix + ob_new.matrix_world = align_matrix if obj_act and obj_act.mode == 'EDIT': if not edit: diff --git a/add_mesh_pipe_joint.py b/add_mesh_pipe_joint.py index 04f368d7be1ee94c92f905edc60f52669228444e..68baca29213addcaca2d48c78e6d9b6d0e15b546 100644 --- a/add_mesh_pipe_joint.py +++ b/add_mesh_pipe_joint.py @@ -198,7 +198,7 @@ def create_mesh_object(context, verts, edges, faces, name, edit, align_matrix): ob_new.selected = True # Place the object at the 3D cursor location. - ob_new.matrix = align_matrix + ob_new.matrix_world = align_matrix if obj_act and obj_act.mode == 'EDIT': if not edit: diff --git a/add_mesh_twisted_torus.py b/add_mesh_twisted_torus.py index 03c8a1f31844936610061a90f83a31d9b461a846..31996774c1735987820369ed9b7cdddee82abc02 100644 --- a/add_mesh_twisted_torus.py +++ b/add_mesh_twisted_torus.py @@ -135,7 +135,7 @@ def create_mesh_object(context, verts, edges, faces, name, edit, align_matrix): # Place the object at the 3D cursor location. # apply viewRotaion - ob_new.matrix = align_matrix + ob_new.matrix_world = align_matrix if obj_act and obj_act.mode == 'EDIT': if not edit: diff --git a/curve_simplify.py b/curve_simplify.py index a6b579f697fe39d2ed0cbb184d3ddcd96fbfa1af..b1f3c8e6dfecc4a74c8dbe094e526cc870dc9c2f 100644 --- a/curve_simplify.py +++ b/curve_simplify.py @@ -285,7 +285,7 @@ def main(context, obj, options): scene.objects.link(newCurve) newCurve.selected = True scene.objects.active = newCurve - newCurve.matrix = obj.matrix + newCurve.matrix = obj.matrix_world # set bezierhandles to auto setBezierHandles(newCurve) diff --git a/export_unreal_psk_psa.py b/export_unreal_psk_psa.py index df66d344804787fade9fa3aca0cc6b9a339f4538..b5be318ff32e460b0fc721e14938db159d753088 100644 --- a/export_unreal_psk_psa.py +++ b/export_unreal_psk_psa.py @@ -792,7 +792,7 @@ def parse_meshes(blender_meshes, psk_file): # Transform position for export #vpos = vert.co * object_material_index - vpos = vert.co * current_obj.matrix + vpos = vert.co * current_obj.matrix_world # Create the point p = VPoint() p.Point.X = vpos.x @@ -891,7 +891,7 @@ def parse_meshes(blender_meshes, psk_file): vert_weight = vgroup.weight if(bonegroup.index == vgroup.group): p = VPoint() - vpos = current_vert.co * current_obj.matrix + vpos = current_vert.co * current_obj.matrix_world p.Point.X = vpos.x p.Point.Y = vpos.y p.Point.Z = vpos.z @@ -1053,7 +1053,7 @@ def parse_armature(blender_armature, psk_file, psa_file): """ for current_bone in current_armature.bones: #list the bone. #note this will list all the bones. if(current_bone.parent == None): - parse_bone(current_bone, psk_file, psa_file, 0, 0, current_obj.matrix, None) + parse_bone(current_bone, psk_file, psa_file, 0, 0, current_obj.matrix_world, None) break # get blender objects by type diff --git a/io_anim_camera.py b/io_anim_camera.py index 6e186b25ae32ef64ecbc723558789fcf7a6bdd0a..489cf8569bd069e8c3522fcf3a422d2fe5548671 100644 --- a/io_anim_camera.py +++ b/io_anim_camera.py @@ -82,7 +82,7 @@ def writeCameras(context, filepath, frame_start, frame_end, only_selected=False) for obj, obj_data in cameras: fw("obj = cameras['%s']\n" % obj.name) - matrix = obj.matrix.copy() + 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()))) diff --git a/io_mesh_raw/export_raw.py b/io_mesh_raw/export_raw.py index e2fd918bcb7cf2a6a73009c868914d58b385695b..59f8381041ce4c456b8efaa8ad599ac84be0afcc 100644 --- a/io_mesh_raw/export_raw.py +++ b/io_mesh_raw/export_raw.py @@ -65,7 +65,7 @@ def export_raw(filepath, applyMods, triangulate): faces = [] for obj in bpy.context.selected_objects: if obj.type == 'MESH': - matrix = obj.matrix + matrix = obj.matrix_world if (applyMods): me = obj.create_mesh(True, "PREVIEW") diff --git a/space_view3d_panel_measure.py b/space_view3d_panel_measure.py index b893b2714fc0ae8097a0f6578a4eb2b35b9c73b8..a790a10490238f79f63fb76519c434ff637024c1 100644 --- a/space_view3d_panel_measure.py +++ b/space_view3d_panel_measure.py @@ -180,10 +180,9 @@ def getMeasurePoints(context): mesh = obj.data # Get transformation matrix from object. - ob_mat = obj.matrix + ob_mat = obj.matrix_world # Also make an inversed copy! of the matrix. - ob_mat_inv = ob_mat.copy() - Matrix.invert(ob_mat_inv) + ob_mat_inv = ob_mat.copy().invert() # Get the selected vertices. # @todo: Better (more efficient) way to do this? @@ -282,14 +281,14 @@ def getMeasurePoints(context): # Return the area of a face (in global space). # @note Copies the functionality of the following functions, -# but also respects the scaling (via the "obj.matrix" parameter): +# but also respects the scaling (via the "obj.matrix_world" parameter): # @sa: rna_mesh.c:rna_MeshFace_area_get # @sa: math_geom.c:area_quad_v3 # @sa: math_geom.c:area_tri_v3 def faceAreaGlobal(face, obj): area = 0.0 - mat = obj.matrix + mat = obj.matrix_world if len(face.verts) == 4: # Quad @@ -665,7 +664,7 @@ class VIEW3D_PT_measure(bpy.types.Panel): mesh = obj.data # Get transformation matrix from object. - ob_mat = obj.matrix + ob_mat = obj.matrix_world # Also make an inversed copy! of the matrix. ob_mat_inv = ob_mat.copy() Matrix.invert(ob_mat_inv) diff --git a/space_view3d_spacebar_menu.py b/space_view3d_spacebar_menu.py index 18e66ea0c6eca05a1c4c7732e7d22ddb34e6c8a6..ab9395ba7fb5be16e6e42676631442a3e00856d7 100644 --- a/space_view3d_spacebar_menu.py +++ b/space_view3d_spacebar_menu.py @@ -1397,7 +1397,7 @@ def edgeIntersect(context, operator): operator.report({'ERROR'}, "Selected edges are parallel.") return - tm = obj.matrix.copy() + tm = obj.matrix_world.copy() point = ((line[0] + line[1]) / 2) point = tm * point