diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-07-03 21:39:29 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-07-03 21:39:29 +0400 |
commit | 9a85435e96af9933b282594b6ad8b23ca598d8bc (patch) | |
tree | db9f8adf20ba7dbe91da3a7523388bb9e1ece19d /release | |
parent | 7a495a12e1c367f8f1dbe14586c3798db5982171 (diff) |
rna api:
rename object.matrix --> matrix_world
added object.matrix_local (parent relative matrix)
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/io/engine_render_pov.py | 8 | ||||
-rw-r--r-- | release/scripts/io/export_3ds.py | 2 | ||||
-rw-r--r-- | release/scripts/io/export_fbx.py | 9 | ||||
-rw-r--r-- | release/scripts/io/export_mdd.py | 4 | ||||
-rw-r--r-- | release/scripts/io/export_obj.py | 2 | ||||
-rw-r--r-- | release/scripts/io/export_ply.py | 2 | ||||
-rw-r--r-- | release/scripts/io/export_x3d.py | 12 | ||||
-rw-r--r-- | release/scripts/io/import_scene_3ds.py | 8 | ||||
-rw-r--r-- | release/scripts/modules/add_object_utils.py | 2 | ||||
-rw-r--r-- | release/scripts/op/object.py | 2 | ||||
-rw-r--r-- | release/scripts/op/object_align.py | 4 | ||||
-rw-r--r-- | release/scripts/op/uvcalc_smart_project.py | 2 |
12 files changed, 27 insertions, 30 deletions
diff --git a/release/scripts/io/engine_render_pov.py b/release/scripts/io/engine_render_pov.py index 426bc761041..9cda4375ecc 100644 --- a/release/scripts/io/engine_render_pov.py +++ b/release/scripts/io/engine_render_pov.py @@ -134,7 +134,7 @@ def write_pov(filename, scene=None, info_callback=None): def exportCamera(): camera = scene.camera - matrix = camera.matrix + matrix = camera.matrix_world # compute resolution Qsize = float(render.resolution_x) / float(render.resolution_y) @@ -155,7 +155,7 @@ def write_pov(filename, scene=None, info_callback=None): for ob in lamps: lamp = ob.data - matrix = ob.matrix + matrix = ob.matrix_world color = tuple([c * lamp.energy for c in lamp.color]) # Colour is modified by energy @@ -263,7 +263,7 @@ def write_pov(filename, scene=None, info_callback=None): writeObjectMaterial(material) - writeMatrix(ob.matrix) + writeMatrix(ob.matrix_world) file.write('}\n') @@ -292,7 +292,7 @@ def write_pov(filename, scene=None, info_callback=None): # continue # me = ob.data - matrix = ob.matrix + matrix = ob.matrix_world try: uv_layer = me.active_uv_texture.data except: diff --git a/release/scripts/io/export_3ds.py b/release/scripts/io/export_3ds.py index 341b974fe06..bfe568153f9 100644 --- a/release/scripts/io/export_3ds.py +++ b/release/scripts/io/export_3ds.py @@ -82,7 +82,7 @@ def create_derived_objects(scene, ob): ob.create_dupli_list(scene) return True, [(dob.object, dob.matrix) for dob in ob.dupli_list] else: - return False, [(ob, ob.matrix)] + return False, [(ob, ob.matrix_world)] # also used by X3D exporter def free_derived_objects(ob): diff --git a/release/scripts/io/export_fbx.py b/release/scripts/io/export_fbx.py index 967bbf50307..9468cadec83 100644 --- a/release/scripts/io/export_fbx.py +++ b/release/scripts/io/export_fbx.py @@ -528,7 +528,7 @@ def write(filename, batch_objects = None, \ self.fbxGroupNames = [] self.fbxParent = None # set later on IF the parent is in the selection. if matrixWorld: self.matrixWorld = GLOBAL_MATRIX * matrixWorld - else: self.matrixWorld = GLOBAL_MATRIX * ob.matrix + else: self.matrixWorld = GLOBAL_MATRIX * ob.matrix_world # else: self.matrixWorld = ob.matrixWorld * GLOBAL_MATRIX self.__anim_poselist = {} # we should only access this @@ -539,8 +539,7 @@ def write(filename, batch_objects = None, \ return self.matrixWorld def setPoseFrame(self, f): - self.__anim_poselist[f] = self.blenObject.matrix.copy() -# self.__anim_poselist[f] = self.blenObject.matrixWorld.copy() + self.__anim_poselist[f] = self.blenObject.matrix_world.copy() def getAnimParRelMatrix(self, frame): if self.fbxParent: @@ -646,7 +645,7 @@ def write(filename, batch_objects = None, \ else: # This is bad because we need the parent relative matrix from the fbx parent (if we have one), dont use anymore - #if ob and not matrix: matrix = ob.matrixWorld * GLOBAL_MATRIX + #if ob and not matrix: matrix = ob.matrix_world * GLOBAL_MATRIX if ob and not matrix: raise Exception("error: this should never happen!") matrix_rot = matrix @@ -2025,7 +2024,7 @@ def write(filename, batch_objects = None, \ if ob_base.parent and ob_base.parent.dupli_type != 'NONE': continue - obs = [(ob_base, ob_base.matrix)] + obs = [(ob_base, ob_base.matrix_world)] if ob_base.dupli_type != 'NONE': ob_base.create_dupli_list(scene) obs = [(dob.object, dob.matrix) for dob in ob_base.dupli_list] diff --git a/release/scripts/io/export_mdd.py b/release/scripts/io/export_mdd.py index 3c82ff5d497..b7de707c9f0 100644 --- a/release/scripts/io/export_mdd.py +++ b/release/scripts/io/export_mdd.py @@ -113,7 +113,7 @@ def write(filename, sce, ob, PREF_STARTFRAME, PREF_ENDFRAME, PREF_FPS): """ check_vertcount(me, numverts) - me.transform(mat_flip * ob.matrix) + me.transform(mat_flip * ob.matrix_world) f.write(pack(">%df" % (numverts * 3), *[axis for v in me.verts for axis in v.co])) for frame in range(PREF_STARTFRAME, PREF_ENDFRAME + 1):#in order to start at desired frame @@ -125,7 +125,7 @@ def write(filename, sce, ob, PREF_STARTFRAME, PREF_ENDFRAME, PREF_FPS): sce.set_frame(frame) me = ob.create_mesh(sce, True, 'PREVIEW') check_vertcount(me, numverts) - me.transform(mat_flip * ob.matrix) + me.transform(mat_flip * ob.matrix_world) # Write the vertex data f.write(pack(">%df" % (numverts * 3), *[axis for v in me.verts for axis in v.co])) diff --git a/release/scripts/io/export_obj.py b/release/scripts/io/export_obj.py index 40ef68041de..4451cb77a1b 100644 --- a/release/scripts/io/export_obj.py +++ b/release/scripts/io/export_obj.py @@ -403,7 +403,7 @@ def write(filepath, objects, scene, # XXX debug print print(ob_main.name, 'has', len(obs), 'dupli children') else: - obs = [(ob_main, ob_main.matrix)] + obs = [(ob_main, ob_main.matrix_world)] for ob, ob_mat in obs: diff --git a/release/scripts/io/export_ply.py b/release/scripts/io/export_ply.py index aee56550526..09d25b61010 100644 --- a/release/scripts/io/export_ply.py +++ b/release/scripts/io/export_ply.py @@ -111,7 +111,7 @@ def write(filename, scene, ob, \ raise ("Error, could not get mesh data from active object") return - # mesh.transform(ob.matrixWorld) # XXX + # mesh.transform(ob.matrix_world) # XXX faceUV = (len(mesh.uv_textures) > 0) vertexUV = (len(mesh.sticky) > 0) diff --git a/release/scripts/io/export_x3d.py b/release/scripts/io/export_x3d.py index 6dc2340ec93..2ade015a1e9 100644 --- a/release/scripts/io/export_x3d.py +++ b/release/scripts/io/export_x3d.py @@ -237,7 +237,7 @@ class x3d_class: lens = min(lens, math.pi) # get the camera location, subtract 90 degress from X to orient like X3D does - # mat = ob.matrixWorld - mat is now passed! + # mat = ob.matrix_world - mat is now passed! loc = self.rotatePointForVRML(mat.translation_part()) rot = mat.to_euler() @@ -300,7 +300,7 @@ class x3d_class: # note -dz seems to equal om[3][1] # note dy seems to equal om[3][2] - #location=(ob.matrixWorld*MATWORLD).translation_part() # now passed + #location=(ob.matrix_world*MATWORLD).translation_part() # now passed location=(mtx*MATWORLD).translation_part() radius = lamp.distance*math.cos(beamWidth) @@ -346,7 +346,7 @@ class x3d_class: ambi = 0 ambientIntensity = 0 - # location=(ob.matrixWorld*MATWORLD).translation_part() # now passed + # location=(ob.matrix_world*MATWORLD).translation_part() # now passed location= (mtx*MATWORLD).translation_part() self.file.write("<PointLight DEF=\"%s\" " % safeName) @@ -364,7 +364,7 @@ class x3d_class: return else: dx,dy,dz = self.computeDirection(mtx) - # location=(ob.matrixWorld*MATWORLD).translation_part() + # location=(ob.matrix_world*MATWORLD).translation_part() location=(mtx*MATWORLD).translation_part() self.writeIndented("<%s\n" % obname,1) self.writeIndented("direction=\"%s %s %s\"\n" % (round(dx,3),round(dy,3),round(dz,3))) @@ -445,7 +445,7 @@ class x3d_class: else: bTwoSided=0 - # mtx = ob.matrixWorld * MATWORLD # mtx is now passed + # mtx = ob.matrix_world * MATWORLD # mtx is now passed mtx = mtx * MATWORLD loc= mtx.translation_part() @@ -601,7 +601,7 @@ class x3d_class: self.file.write("\">\n") else: #-- vertices - # mesh.transform(ob.matrixWorld) + # mesh.transform(ob.matrix_world) self.writeIndented("<Coordinate DEF=\"%s%s\" \n" % ("coord_",meshName), 1) self.file.write("\t\t\t\tpoint=\"") for v in mesh.verts: diff --git a/release/scripts/io/import_scene_3ds.py b/release/scripts/io/import_scene_3ds.py index 67d53044dcd..6502dee73f1 100644 --- a/release/scripts/io/import_scene_3ds.py +++ b/release/scripts/io/import_scene_3ds.py @@ -427,9 +427,7 @@ def process_next_chunk(file, previous_chunk, importedObjects, IMAGE_SEARCH): ''' if contextMatrix_rot: - # ob.matrix = [x for row in contextMatrix_rot for x in row] - ob.matrix = contextMatrix_rot -# ob.setMatrix(contextMatrix_rot) + ob.matrix_world = contextMatrix_rot importedObjects.append(ob) bmesh.update() @@ -892,7 +890,7 @@ def load_3ds(filename, context, IMPORT_CONSTRAIN_BOUNDS=10.0, IMAGE_SEARCH=True, # me = ob.getData(mesh=1) # me.verts.delete([me.verts[0],]) # if not APPLY_MATRIX: -# me.transform(ob.matrixWorld.copy().invert()) +# me.transform(ob.matrix_world.copy().invert()) # Done DUMMYVERT """ @@ -950,7 +948,7 @@ def load_3ds(filename, context, IMPORT_CONSTRAIN_BOUNDS=10.0, IMAGE_SEARCH=True, # SCALE_MAT = Blender.mathutils.Matrix([SCALE,0,0,0],[0,SCALE,0,0],[0,0,SCALE,0],[0,0,0,1]) for ob in importedObjects: - ob.setMatrix(ob.matrixWorld * SCALE_MAT) + ob.matrix_world = ob.matrix_world * SCALE_MAT # Done constraining to bounds. diff --git a/release/scripts/modules/add_object_utils.py b/release/scripts/modules/add_object_utils.py index ed64cf9ae2b..cef368c529d 100644 --- a/release/scripts/modules/add_object_utils.py +++ b/release/scripts/modules/add_object_utils.py @@ -61,7 +61,7 @@ def add_object_data(context, obdata, operator=None): base.layers_from_view(context.space_data) - obj_new.matrix = add_object_align_init(context, operator) + obj_new.matrix_world = add_object_align_init(context, operator) obj_act = scene.objects.active diff --git a/release/scripts/op/object.py b/release/scripts/op/object.py index 9d240fee5c6..e76218e4637 100644 --- a/release/scripts/op/object.py +++ b/release/scripts/op/object.py @@ -473,7 +473,7 @@ class MakeDupliFace(bpy.types.Operator): linked.setdefault(data, []).append(obj) for data, objects in linked.items(): - face_verts = [axis for obj in objects for v in matrix_to_quat(obj.matrix) for axis in v] + face_verts = [axis for obj in objects for v in matrix_to_quat(obj.matrix_world) for axis in v] faces = list(range(int(len(face_verts) / 3))) mesh = bpy.data.meshes.new(data.name + "_dupli") diff --git a/release/scripts/op/object_align.py b/release/scripts/op/object_align.py index 970eee58d69..6e5eef0fbc2 100644 --- a/release/scripts/op/object_align.py +++ b/release/scripts/op/object_align.py @@ -34,7 +34,7 @@ def align_objects(align_x, align_y, align_z, align_mode, relative_to): for obj in bpy.context.selected_objects: if obj.type == 'MESH': - bb_world = [obj.matrix * Vector(v[:]) for v in obj.bound_box] + bb_world = [obj.matrix_world * Vector(v[:]) for v in obj.bound_box] Left_Up_Front = bb_world[1] Right_Down_Back = bb_world[7] @@ -95,7 +95,7 @@ def align_objects(align_x, align_y, align_z, align_mode, relative_to): if obj.type == 'MESH': loc_world = obj.location - bb_world = [obj.matrix * Vector(v[:]) for v in obj.bound_box] + bb_world = [obj.matrix_world * Vector(v[:]) for v in obj.bound_box] Left_Up_Front = bb_world[1] Right_Down_Back = bb_world[7] diff --git a/release/scripts/op/uvcalc_smart_project.py b/release/scripts/op/uvcalc_smart_project.py index e0854f3720b..13bf6244f4d 100644 --- a/release/scripts/op/uvcalc_smart_project.py +++ b/release/scripts/op/uvcalc_smart_project.py @@ -935,7 +935,7 @@ def main(context, island_margin, projection_limit): # Initialize projectVecs if USER_VIEW_INIT: # Generate Projection - projectVecs = [Vector(Window.GetViewVector()) * ob.matrixWorld.copy().invert().rotation_part()] # We add to this allong the way + projectVecs = [Vector(Window.GetViewVector()) * ob.matrix_world.copy().invert().rotation_part()] # We add to this allong the way else: projectVecs = [] |