[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [757] trunk/py/scripts/addons: update for changes in blender

Campbell Barton ideasman42 at gmail.com
Sat Jul 3 19:39:45 CEST 2010


Revision: 757
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=757
Author:   campbellbarton
Date:     2010-07-03 19:39:45 +0200 (Sat, 03 Jul 2010)

Log Message:
-----------
update for changes in blender

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_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/curve_simplify.py
    trunk/py/scripts/addons/export_unreal_psk_psa.py
    trunk/py/scripts/addons/io_anim_camera.py
    trunk/py/scripts/addons/io_mesh_raw/export_raw.py
    trunk/py/scripts/addons/space_view3d_panel_measure.py
    trunk/py/scripts/addons/space_view3d_spacebar_menu.py

Modified: trunk/py/scripts/addons/add_curve_aceous_galore.py
===================================================================
--- trunk/py/scripts/addons/add_curve_aceous_galore.py	2010-06-30 09:34:04 UTC (rev 756)
+++ trunk/py/scripts/addons/add_curve_aceous_galore.py	2010-07-03 17:39:45 UTC (rev 757)
@@ -652,7 +652,7 @@
     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':

Modified: trunk/py/scripts/addons/add_curve_torus_knots.py
===================================================================
--- trunk/py/scripts/addons/add_curve_torus_knots.py	2010-06-30 09:34:04 UTC (rev 756)
+++ trunk/py/scripts/addons/add_curve_torus_knots.py	2010-07-03 17:39:45 UTC (rev 757)
@@ -105,7 +105,7 @@
     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
 

Modified: trunk/py/scripts/addons/add_mesh_3d_function_surface.py
===================================================================
--- trunk/py/scripts/addons/add_mesh_3d_function_surface.py	2010-06-30 09:34:04 UTC (rev 756)
+++ trunk/py/scripts/addons/add_mesh_3d_function_surface.py	2010-07-03 17:39:45 UTC (rev 757)
@@ -196,7 +196,7 @@
 
         # 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:

Modified: trunk/py/scripts/addons/add_mesh_extras.py
===================================================================
--- trunk/py/scripts/addons/add_mesh_extras.py	2010-06-30 09:34:04 UTC (rev 756)
+++ trunk/py/scripts/addons/add_mesh_extras.py	2010-07-03 17:39:45 UTC (rev 757)
@@ -107,7 +107,7 @@
 
         # 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:

Modified: trunk/py/scripts/addons/add_mesh_gears.py
===================================================================
--- trunk/py/scripts/addons/add_mesh_gears.py	2010-06-30 09:34:04 UTC (rev 756)
+++ trunk/py/scripts/addons/add_mesh_gears.py	2010-07-03 17:39:45 UTC (rev 757)
@@ -142,7 +142,7 @@
 
         # 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':

Modified: trunk/py/scripts/addons/add_mesh_gemstones.py
===================================================================
--- trunk/py/scripts/addons/add_mesh_gemstones.py	2010-06-30 09:34:04 UTC (rev 756)
+++ trunk/py/scripts/addons/add_mesh_gemstones.py	2010-07-03 17:39:45 UTC (rev 757)
@@ -107,7 +107,7 @@
 
         # 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:

Modified: trunk/py/scripts/addons/add_mesh_pipe_joint.py
===================================================================
--- trunk/py/scripts/addons/add_mesh_pipe_joint.py	2010-06-30 09:34:04 UTC (rev 756)
+++ trunk/py/scripts/addons/add_mesh_pipe_joint.py	2010-07-03 17:39:45 UTC (rev 757)
@@ -198,7 +198,7 @@
         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:

Modified: trunk/py/scripts/addons/add_mesh_twisted_torus.py
===================================================================
--- trunk/py/scripts/addons/add_mesh_twisted_torus.py	2010-06-30 09:34:04 UTC (rev 756)
+++ trunk/py/scripts/addons/add_mesh_twisted_torus.py	2010-07-03 17:39:45 UTC (rev 757)
@@ -135,7 +135,7 @@
 
         # 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:

Modified: trunk/py/scripts/addons/curve_simplify.py
===================================================================
--- trunk/py/scripts/addons/curve_simplify.py	2010-06-30 09:34:04 UTC (rev 756)
+++ trunk/py/scripts/addons/curve_simplify.py	2010-07-03 17:39:45 UTC (rev 757)
@@ -285,7 +285,7 @@
     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)

Modified: trunk/py/scripts/addons/export_unreal_psk_psa.py
===================================================================
--- trunk/py/scripts/addons/export_unreal_psk_psa.py	2010-06-30 09:34:04 UTC (rev 756)
+++ trunk/py/scripts/addons/export_unreal_psk_psa.py	2010-07-03 17:39:45 UTC (rev 757)
@@ -792,7 +792,7 @@
 					
 					# 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 @@
 					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 @@
 		"""
 		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		

Modified: trunk/py/scripts/addons/io_anim_camera.py
===================================================================
--- trunk/py/scripts/addons/io_anim_camera.py	2010-06-30 09:34:04 UTC (rev 756)
+++ trunk/py/scripts/addons/io_anim_camera.py	2010-07-03 17:39:45 UTC (rev 757)
@@ -82,7 +82,7 @@
         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())))

Modified: trunk/py/scripts/addons/io_mesh_raw/export_raw.py
===================================================================
--- trunk/py/scripts/addons/io_mesh_raw/export_raw.py	2010-06-30 09:34:04 UTC (rev 756)
+++ trunk/py/scripts/addons/io_mesh_raw/export_raw.py	2010-07-03 17:39:45 UTC (rev 757)
@@ -65,7 +65,7 @@
     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")

Modified: trunk/py/scripts/addons/space_view3d_panel_measure.py
===================================================================
--- trunk/py/scripts/addons/space_view3d_panel_measure.py	2010-06-30 09:34:04 UTC (rev 756)
+++ trunk/py/scripts/addons/space_view3d_panel_measure.py	2010-07-03 17:39:45 UTC (rev 757)
@@ -180,10 +180,9 @@
             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 @@
 
 # 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 @@
                 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)

Modified: trunk/py/scripts/addons/space_view3d_spacebar_menu.py
===================================================================
--- trunk/py/scripts/addons/space_view3d_spacebar_menu.py	2010-06-30 09:34:04 UTC (rev 756)
+++ trunk/py/scripts/addons/space_view3d_spacebar_menu.py	2010-07-03 17:39:45 UTC (rev 757)
@@ -1397,7 +1397,7 @@
         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
 




More information about the Bf-extensions-cvs mailing list