diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-04-11 18:22:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-04-11 18:22:27 +0400 |
commit | 67cfc427eefdefc003ba53db9ca7cf6f4633c252 (patch) | |
tree | 43c56a3f29f58ed97f7064b0619bb7d53cee8674 /release | |
parent | 4d2bc9f907d312ef86ad340abdee5ea1dadff94b (diff) |
PyAPI
- added new mathutils.Color() type, use with rna so we can do for eg:
material.diffuse_color.r = 1.0
# also has hsv access
material.diffuse_color.s = 0.6
- made Mathutils and Geometry module names lowercase.
Diffstat (limited to 'release')
34 files changed, 76 insertions, 77 deletions
diff --git a/release/scripts/io/export_fbx.py b/release/scripts/io/export_fbx.py index 08d142d80e8..3aed242289d 100644 --- a/release/scripts/io/export_fbx.py +++ b/release/scripts/io/export_fbx.py @@ -77,7 +77,7 @@ import shutil # for file copying # import Blender import bpy -import Mathutils +import mathutils @@ -135,7 +135,7 @@ def copy_images(dest_dir, textures): # I guess FBX uses degrees instead of radians (Arystan). # Call this function just before writing to FBX. def eulerRadToDeg(eul): - ret = Mathutils.Euler() + ret = mathutils.Euler() ret.x = 180 / math.pi * eul[0] ret.y = 180 / math.pi * eul[1] @@ -143,10 +143,10 @@ def eulerRadToDeg(eul): return ret -mtx4_identity = Mathutils.Matrix() +mtx4_identity = mathutils.Matrix() # testing -mtx_x90 = Mathutils.RotationMatrix( math.pi/2, 3, 'X') # used +mtx_x90 = mathutils.RotationMatrix( math.pi/2, 3, 'X') # used #mtx_x90n = RotationMatrix(-90, 3, 'x') #mtx_y90 = RotationMatrix( 90, 3, 'y') #mtx_y90n = RotationMatrix(-90, 3, 'y') @@ -154,11 +154,11 @@ mtx_x90 = Mathutils.RotationMatrix( math.pi/2, 3, 'X') # used #mtx_z90n = RotationMatrix(-90, 3, 'z') #mtx4_x90 = RotationMatrix( 90, 4, 'x') -mtx4_x90n = Mathutils.RotationMatrix(-math.pi/2, 4, 'X') # used +mtx4_x90n = mathutils.RotationMatrix(-math.pi/2, 4, 'X') # used #mtx4_y90 = RotationMatrix( 90, 4, 'y') -mtx4_y90n = Mathutils.RotationMatrix(-math.pi/2, 4, 'Y') # used -mtx4_z90 = Mathutils.RotationMatrix( math.pi/2, 4, 'Z') # used -mtx4_z90n = Mathutils.RotationMatrix(-math.pi/2, 4, 'Z') # used +mtx4_y90n = mathutils.RotationMatrix(-math.pi/2, 4, 'Y') # used +mtx4_z90 = mathutils.RotationMatrix( math.pi/2, 4, 'Z') # used +mtx4_z90n = mathutils.RotationMatrix(-math.pi/2, 4, 'Z') # used # def strip_path(p): # return p.split('\\')[-1].split('/')[-1] @@ -333,7 +333,7 @@ def write(filename, batch_objects = None, \ EXP_CAMERA = True, EXP_EMPTY = True, EXP_IMAGE_COPY = False, - GLOBAL_MATRIX = Mathutils.Matrix(), + GLOBAL_MATRIX = mathutils.Matrix(), ANIM_ENABLE = True, ANIM_OPTIMIZE = True, ANIM_OPTIMIZE_PRECISSION = 6, @@ -600,8 +600,8 @@ def write(filename, batch_objects = None, \ matrix_rot = matrix_rot * mtx_x90 elif type =='CAMERA': # elif ob and type =='Camera': - y = matrix_rot * Mathutils.Vector(0,1,0) - matrix_rot = Mathutils.RotationMatrix(math.pi/2, 3, y) * matrix_rot + y = matrix_rot * mathutils.Vector(0,1,0) + matrix_rot = mathutils.RotationMatrix(math.pi/2, 3, y) * matrix_rot return matrix_rot @@ -702,8 +702,8 @@ def write(filename, batch_objects = None, \ matrix_rot = matrix_rot * mtx_x90 rot = tuple(matrix_rot.to_euler()) elif ob and ob.type =='Camera': - y = matrix_rot * Mathutils.Vector(0,1,0) - matrix_rot = Mathutils.RotationMatrix(math.pi/2, 3, y) * matrix_rot + y = matrix_rot * mathutils.Vector(0,1,0) + matrix_rot = mathutils.RotationMatrix(math.pi/2, 3, y) * matrix_rot rot = tuple(matrix_rot.to_euler()) else: rot = tuple(matrix_rot.to_euler()) @@ -1088,8 +1088,8 @@ def write(filename, batch_objects = None, \ file.write('\n\t\tTypeFlags: "Camera"') file.write('\n\t\tGeometryVersion: 124') file.write('\n\t\tPosition: %.6f,%.6f,%.6f' % loc) - file.write('\n\t\tUp: %.6f,%.6f,%.6f' % tuple(matrix_rot * Mathutils.Vector(0,1,0)) ) - file.write('\n\t\tLookAt: %.6f,%.6f,%.6f' % tuple(matrix_rot * Mathutils.Vector(0,0,-1)) ) + file.write('\n\t\tUp: %.6f,%.6f,%.6f' % tuple(matrix_rot * mathutils.Vector(0,1,0)) ) + file.write('\n\t\tLookAt: %.6f,%.6f,%.6f' % tuple(matrix_rot * mathutils.Vector(0,0,-1)) ) #file.write('\n\t\tUp: 0,0,0' ) #file.write('\n\t\tLookAt: 0,0,0' ) diff --git a/release/scripts/io/export_mdd.py b/release/scripts/io/export_mdd.py index 6523ce8b466..578813db2c6 100644 --- a/release/scripts/io/export_mdd.py +++ b/release/scripts/io/export_mdd.py @@ -48,7 +48,7 @@ Be sure not to use modifiers that change the number or order of verts in the mes # ***** END GPL LICENCE BLOCK ***** import bpy -import Mathutils +import mathutils from struct import pack @@ -87,7 +87,7 @@ def write(filename, sce, ob, PREF_STARTFRAME, PREF_ENDFRAME, PREF_FPS): me = ob.create_mesh(sce, True, 'PREVIEW') #Flip y and z - mat_flip = Mathutils.Matrix(\ + mat_flip = mathutils.Matrix(\ [1.0, 0.0, 0.0, 0.0],\ [0.0, 0.0, 1.0, 0.0],\ [0.0, 1.0, 0.0, 0.0],\ diff --git a/release/scripts/io/export_obj.py b/release/scripts/io/export_obj.py index c87a2af67c6..2d09844e592 100644 --- a/release/scripts/io/export_obj.py +++ b/release/scripts/io/export_obj.py @@ -47,7 +47,7 @@ import time import shutil import bpy -import Mathutils +import mathutils # Returns a tuple - path,extension. @@ -221,7 +221,7 @@ def write_nurb(file, ob, ob_mat): cu = ob.data # use negative indices - Vector = Blender.Mathutils.Vector + Vector = Blender.mathutils.Vector for nu in cu: if nu.type==0: DEG_ORDER_U = 1 @@ -370,7 +370,7 @@ def write(filename, objects, scene, file.write('mtllib %s\n' % ( mtlfilename.split('\\')[-1].split('/')[-1] )) if EXPORT_ROTX90: - mat_xrot90= Mathutils.RotationMatrix(-math.pi/2, 4, 'X') + mat_xrot90= mathutils.RotationMatrix(-math.pi/2, 4, 'X') # Initialize totals, these are updated each object totverts = totuvco = totno = 1 diff --git a/release/scripts/io/export_x3d.py b/release/scripts/io/export_x3d.py index e5c3213ee94..619c0b3d373 100644 --- a/release/scripts/io/export_x3d.py +++ b/release/scripts/io/export_x3d.py @@ -69,7 +69,7 @@ import math import os import bpy -import Mathutils +import mathutils from export_3ds import create_derived_objects, free_derived_objects @@ -81,7 +81,7 @@ from export_3ds import create_derived_objects, free_derived_objects # DEG2RAD=0.017453292519943295 -MATWORLD= Mathutils.RotationMatrix(-90, 4, 'X') +MATWORLD= mathutils.RotationMatrix(-90, 4, 'X') #################################### # Global Variables diff --git a/release/scripts/io/import_anim_bvh.py b/release/scripts/io/import_anim_bvh.py index e6142a2db8a..b1020d14b12 100644 --- a/release/scripts/io/import_anim_bvh.py +++ b/release/scripts/io/import_anim_bvh.py @@ -22,8 +22,8 @@ import math from math import radians import bpy -import Mathutils -from Mathutils import Vector, Euler, Matrix, RotationMatrix, TranslationMatrix +import mathutils +from mathutils import Vector, Euler, Matrix, RotationMatrix, TranslationMatrix class bvh_node_class(object): diff --git a/release/scripts/io/import_scene_3ds.py b/release/scripts/io/import_scene_3ds.py index 19bb734028b..ca7ef774a72 100644 --- a/release/scripts/io/import_scene_3ds.py +++ b/release/scripts/io/import_scene_3ds.py @@ -144,7 +144,7 @@ import struct from import_scene_obj import unpack_face_list, load_image import bpy -import Mathutils +import mathutils BOUNDS_3DS = [] @@ -310,8 +310,8 @@ def process_next_chunk(file, previous_chunk, importedObjects, IMAGE_SEARCH): contextObName = None contextLamp = [None, None] # object, Data contextMaterial = None - contextMatrix_rot = None # Blender.Mathutils.Matrix(); contextMatrix.identity() - #contextMatrix_tx = None # Blender.Mathutils.Matrix(); contextMatrix.identity() + contextMatrix_rot = None # Blender.mathutils.Matrix(); contextMatrix.identity() + #contextMatrix_tx = None # Blender.mathutils.Matrix(); contextMatrix.identity() contextMesh_vertls = None contextMesh_facels = None contextMeshMaterials = {} # matname:[face_idxs] @@ -722,7 +722,7 @@ def process_next_chunk(file, previous_chunk, importedObjects, IMAGE_SEARCH): def getuv(): temp_data = file.read(STRUCT_SIZE_2FLOAT) new_chunk.bytes_read += STRUCT_SIZE_2FLOAT #2 float x 4 bytes each - return Mathutils.Vector( struct.unpack('<2f', temp_data) ) + return mathutils.Vector( struct.unpack('<2f', temp_data) ) contextMeshUV = [ getuv() for i in range(num_uv) ] @@ -732,7 +732,7 @@ def process_next_chunk(file, previous_chunk, importedObjects, IMAGE_SEARCH): data = list( struct.unpack('<ffffffffffff', temp_data) ) new_chunk.bytes_read += STRUCT_SIZE_4x3MAT - contextMatrix_rot = Mathutils.Matrix(\ + contextMatrix_rot = mathutils.Matrix(\ data[:3] + [0],\ data[3:6] + [0],\ data[6:9] + [0],\ @@ -740,7 +740,7 @@ def process_next_chunk(file, previous_chunk, importedObjects, IMAGE_SEARCH): ''' - contextMatrix_rot = Blender.Mathutils.Matrix(\ + contextMatrix_rot = Blender.mathutils.Matrix(\ data[:3] + [0],\ data[3:6] + [0],\ data[6:9] + [0],\ @@ -748,14 +748,14 @@ def process_next_chunk(file, previous_chunk, importedObjects, IMAGE_SEARCH): ''' ''' - contextMatrix_rot = Blender.Mathutils.Matrix(\ + contextMatrix_rot = Blender.mathutils.Matrix(\ data[:3] ,\ data[3:6],\ data[6:9]) ''' ''' - contextMatrix_rot = Blender.Mathutils.Matrix() + contextMatrix_rot = Blender.mathutils.Matrix() m = 0 for j in xrange(4): for i in xrange(3): @@ -773,7 +773,7 @@ def process_next_chunk(file, previous_chunk, importedObjects, IMAGE_SEARCH): #print contextMatrix_rot contextMatrix_rot.invert() #print contextMatrix_rot - #contextMatrix_tx = Blender.Mathutils.TranslationMatrix(0.5 * Blender.Mathutils.Vector(data[9:])) + #contextMatrix_tx = Blender.mathutils.TranslationMatrix(0.5 * Blender.mathutils.Vector(data[9:])) #contextMatrix_tx.invert() #tx.invert() @@ -946,8 +946,8 @@ def load_3ds(filename, context, IMPORT_CONSTRAIN_BOUNDS=10.0, IMAGE_SEARCH=True, SCALE/=10 # SCALE Matrix - SCALE_MAT = Mathutils.Matrix([SCALE,0,0,0],[0,SCALE,0,0],[0,0,SCALE,0],[0,0,0,1]) -# SCALE_MAT = Blender.Mathutils.Matrix([SCALE,0,0,0],[0,SCALE,0,0],[0,0,SCALE,0],[0,0,0,1]) + SCALE_MAT = mathutils.Matrix([SCALE,0,0,0],[0,SCALE,0,0],[0,0,SCALE,0],[0,0,0,1]) +# 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) diff --git a/release/scripts/io/import_scene_obj.py b/release/scripts/io/import_scene_obj.py index 9a147b06b07..736c8fa91c1 100644 --- a/release/scripts/io/import_scene_obj.py +++ b/release/scripts/io/import_scene_obj.py @@ -54,8 +54,8 @@ Note, This loads mesh objects and materials only, nurbs and curves are not suppo import os import time import bpy -import Mathutils -import Geometry +import mathutils +from geometry import PolyFill # from Blender import Mesh, Draw, Window, Texture, Material, sys # # import BPyMesh @@ -127,7 +127,7 @@ def BPyMesh_ngon(from_data, indices, PREF_FIX_LOOPS= True): if not set: # Need sets for this, otherwise do a normal fill. PREF_FIX_LOOPS= False - Vector= Mathutils.Vector + Vector= mathutils.Vector if not indices: return [] @@ -158,7 +158,7 @@ def BPyMesh_ngon(from_data, indices, PREF_FIX_LOOPS= True): if verts[i][1]==verts[i-1][0]: verts.pop(i-1) - fill= Geometry.PolyFill([verts]) + fill= PolyFill([verts]) else: ''' @@ -266,7 +266,7 @@ def BPyMesh_ngon(from_data, indices, PREF_FIX_LOOPS= True): vert_map[i+ii]= vert[2] ii+=len(verts) - fill= Geometry.PolyFill([ [v[0] for v in loop] for loop in loop_list ]) + fill= PolyFill([ [v[0] for v in loop] for loop in loop_list ]) #draw_loops(loop_list) #raise 'done loop' # map to original indicies diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index 16fac74b9d0..9f066677e5d 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -19,7 +19,7 @@ # <pep8 compliant> from _bpy import types as bpy_types -from Mathutils import Vector +from mathutils import Vector StructRNA = bpy_types.Struct.__bases__[0] # StructRNA = bpy_types.Struct @@ -236,7 +236,7 @@ class EditBone(StructRNA, _GenericBone): Transform the the bones head, tail, roll and envalope (when the matrix has a scale component). Expects a 4x4 or 3x3 matrix. """ - from Mathutils import Vector + from mathutils import Vector z_vec = self.matrix.rotation_part() * Vector(0.0, 0.0, 1.0) self.tail = matrix * self.tail self.head = matrix * self.head diff --git a/release/scripts/modules/rigify/__init__.py b/release/scripts/modules/rigify/__init__.py index ee6cc934c1b..8a9894c4380 100644 --- a/release/scripts/modules/rigify/__init__.py +++ b/release/scripts/modules/rigify/__init__.py @@ -19,7 +19,7 @@ # <pep8 compliant> import bpy -from Mathutils import Vector +from mathutils import Vector # TODO, have these in a more general module from rna_prop_ui import rna_idprop_ui_prop_get diff --git a/release/scripts/modules/rigify/arm_biped.py b/release/scripts/modules/rigify/arm_biped.py index 8568db66e5a..b75b26b5f2f 100644 --- a/release/scripts/modules/rigify/arm_biped.py +++ b/release/scripts/modules/rigify/arm_biped.py @@ -23,7 +23,7 @@ from math import radians, pi from rigify import RigifyError, ORG_PREFIX from rigify_utils import bone_class_instance, copy_bone_simple, add_pole_target_bone, add_stretch_to, blend_bone_list, get_side_name, get_base_name from rna_prop_ui import rna_idprop_ui_prop_get -from Mathutils import Vector +from mathutils import Vector METARIG_NAMES = "shoulder", "arm", "forearm", "hand" diff --git a/release/scripts/modules/rigify/eye_balls.py b/release/scripts/modules/rigify/eye_balls.py index 90e309bbc38..20bb08f39a8 100644 --- a/release/scripts/modules/rigify/eye_balls.py +++ b/release/scripts/modules/rigify/eye_balls.py @@ -20,7 +20,7 @@ import bpy from rna_prop_ui import rna_idprop_ui_prop_get -from Mathutils import Vector +from mathutils import Vector from rigify import RigifyError from rigify_utils import copy_bone_simple diff --git a/release/scripts/modules/rigify/eye_lid.py b/release/scripts/modules/rigify/eye_lid.py index dd9c953e97d..30492e4e138 100644 --- a/release/scripts/modules/rigify/eye_lid.py +++ b/release/scripts/modules/rigify/eye_lid.py @@ -21,7 +21,7 @@ import bpy from rna_prop_ui import rna_idprop_ui_prop_get from math import acos -from Mathutils import Vector +from mathutils import Vector from rigify import RigifyError from rigify_utils import copy_bone_simple diff --git a/release/scripts/modules/rigify/leg_biped.py b/release/scripts/modules/rigify/leg_biped.py index 862d44b653f..2ea217847d7 100644 --- a/release/scripts/modules/rigify/leg_biped.py +++ b/release/scripts/modules/rigify/leg_biped.py @@ -279,7 +279,7 @@ def ik(obj, bone_definition, base_names, options): def fk(obj, bone_definition, base_names, options): - from Mathutils import Vector + from mathutils import Vector arm = obj.data # these account for all bones in METARIG_NAMES diff --git a/release/scripts/modules/rigify/leg_quadruped.py b/release/scripts/modules/rigify/leg_quadruped.py index 701fe295aac..3ee9065af61 100644 --- a/release/scripts/modules/rigify/leg_quadruped.py +++ b/release/scripts/modules/rigify/leg_quadruped.py @@ -23,7 +23,7 @@ from rna_prop_ui import rna_idprop_ui_prop_get from math import pi from rigify import RigifyError from rigify_utils import bone_class_instance, copy_bone_simple, get_side_name, get_base_name -from Mathutils import Vector +from mathutils import Vector METARIG_NAMES = "hips", "thigh", "shin", "foot", "toe" diff --git a/release/scripts/modules/rigify/mouth.py b/release/scripts/modules/rigify/mouth.py index da03eb94b23..9d36c60eede 100644 --- a/release/scripts/modules/rigify/mouth.py +++ b/release/scripts/modules/rigify/mouth.py @@ -21,7 +21,7 @@ import bpy from rna_prop_ui import rna_idprop_ui_prop_get from math import acos, pi -from Mathutils import Vector +from mathutils import Vector from rigify import RigifyError from rigify_utils import copy_bone_simple diff --git a/release/scripts/modules/rigify/neck.py b/release/scripts/modules/rigify/neck.py index 747e8397710..7d220663256 100644 --- a/release/scripts/modules/rigify/neck.py +++ b/release/scripts/modules/rigify/neck.py @@ -119,7 +119,7 @@ def deform(obj, definitions, base_names, options): def main(obj, bone_definition, base_names, options): - from Mathutils import Vector + from mathutils import Vector arm = obj.data eb = obj.data.edit_bones diff --git a/release/scripts/modules/rigify/neck_flex.py b/release/scripts/modules/rigify/neck_flex.py index 555645ecd2a..514d443a1f9 100644 --- a/release/scripts/modules/rigify/neck_flex.py +++ b/release/scripts/modules/rigify/neck_flex.py @@ -125,7 +125,7 @@ def deform(obj, definitions, base_names, options): def main(obj, bone_definition, base_names, options): - from Mathutils import Vector + from mathutils import Vector arm = obj.data diff --git a/release/scripts/modules/rigify/palm_curl.py b/release/scripts/modules/rigify/palm_curl.py index 165bffad950..ed656cf2243 100644 --- a/release/scripts/modules/rigify/palm_curl.py +++ b/release/scripts/modules/rigify/palm_curl.py @@ -248,7 +248,7 @@ def main(obj, bone_definition, base_names, options): # NOTE: the direction of the Z rotation depends on which side the palm is on. # we could do a simple side-of-x test but better to work out the direction # the hand is facing. - from Mathutils import Vector + from mathutils import Vector from math import degrees child_pbone_01 = obj.pose.bones[children[0]].bone child_pbone_02 = obj.pose.bones[children[1]].bone diff --git a/release/scripts/modules/rigify/spine_pivot_flex.py b/release/scripts/modules/rigify/spine_pivot_flex.py index d67c066cdd5..025074490cb 100644 --- a/release/scripts/modules/rigify/spine_pivot_flex.py +++ b/release/scripts/modules/rigify/spine_pivot_flex.py @@ -147,7 +147,7 @@ def deform(obj, definitions, base_names, options): def main(obj, bone_definition, base_names, options): - from Mathutils import Vector, RotationMatrix + from mathutils import Vector, RotationMatrix from math import radians, pi arm = obj.data diff --git a/release/scripts/modules/rigify/tail_control.py b/release/scripts/modules/rigify/tail_control.py index 65d5c1d34dc..76eaf6dd4d9 100644 --- a/release/scripts/modules/rigify/tail_control.py +++ b/release/scripts/modules/rigify/tail_control.py @@ -22,7 +22,7 @@ import bpy from rigify import RigifyError from rigify_utils import bone_class_instance, copy_bone_simple from rna_prop_ui import rna_idprop_ui_prop_get -from Mathutils import Vector, RotationMatrix +from mathutils import Vector, RotationMatrix from math import radians, pi # not used, defined for completeness diff --git a/release/scripts/modules/rigify/tongue.py b/release/scripts/modules/rigify/tongue.py index 5e219309503..43a8c2125ce 100644 --- a/release/scripts/modules/rigify/tongue.py +++ b/release/scripts/modules/rigify/tongue.py @@ -128,7 +128,7 @@ def deform(obj, definitions, base_names, options): # TODO: rename all of the head/neck references to tongue def main(obj, bone_definition, base_names, options): - from Mathutils import Vector + from mathutils import Vector arm = obj.data diff --git a/release/scripts/modules/rigify_utils.py b/release/scripts/modules/rigify_utils.py index 6ed97ce0bf0..1d5768e7f22 100644 --- a/release/scripts/modules/rigify_utils.py +++ b/release/scripts/modules/rigify_utils.py @@ -26,7 +26,7 @@ # that a generic function would need to check for. import bpy -from Mathutils import Vector +from mathutils import Vector from rna_prop_ui import rna_idprop_ui_prop_get DELIMITER = '-._' diff --git a/release/scripts/op/add_armature_human.py b/release/scripts/op/add_armature_human.py index b00b735d16d..164bbfb100b 100644 --- a/release/scripts/op/add_armature_human.py +++ b/release/scripts/op/add_armature_human.py @@ -18,7 +18,7 @@ # <pep8-80 compliant> import bpy -import Mathutils +import mathutils from math import cos, sin, pi # could this be stored elsewhere? diff --git a/release/scripts/op/add_mesh_torus.py b/release/scripts/op/add_mesh_torus.py index 601cc712dda..183a122f513 100644 --- a/release/scripts/op/add_mesh_torus.py +++ b/release/scripts/op/add_mesh_torus.py @@ -18,13 +18,13 @@ # <pep8 compliant> import bpy -import Mathutils +import mathutils from math import cos, sin, pi def add_torus(major_rad, minor_rad, major_seg, minor_seg): - Vector = Mathutils.Vector - Quaternion = Mathutils.Quaternion + Vector = mathutils.Vector + Quaternion = mathutils.Quaternion PI_2 = pi * 2 z_axis = (0, 0, 1) diff --git a/release/scripts/op/console_python.py b/release/scripts/op/console_python.py index a9fa90ee6fa..6a235e118ce 100644 --- a/release/scripts/op/console_python.py +++ b/release/scripts/op/console_python.py @@ -190,7 +190,7 @@ def banner(context): add_scrollback("Execute: Enter", 'OUTPUT') add_scrollback("Autocomplete: Ctrl+Space", 'OUTPUT') add_scrollback("Ctrl +/- Wheel: Zoom", 'OUTPUT') - add_scrollback("Builtin Modules: bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, bgl, blf, Mathutils, Geometry", 'OUTPUT') + add_scrollback("Builtin Modules: bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, bgl, blf, mathutils, Geometry", 'OUTPUT') add_scrollback("", 'OUTPUT') add_scrollback(" WARNING!!! Blender 2.5 API is subject to change, see API reference for more info.", 'ERROR') add_scrollback("", 'OUTPUT') diff --git a/release/scripts/op/fcurve_euler_filter.py b/release/scripts/op/fcurve_euler_filter.py index 1c9e9a73312..bba4576ef73 100644 --- a/release/scripts/op/fcurve_euler_filter.py +++ b/release/scripts/op/fcurve_euler_filter.py @@ -1,6 +1,6 @@ from math import * import bpy -from Mathutils import * +from mathutils import * def main(context): def cleanupEulCurve(fcv): diff --git a/release/scripts/op/mesh.py b/release/scripts/op/mesh.py index 3989e51b6ca..78ca9a18cdc 100644 --- a/release/scripts/op/mesh.py +++ b/release/scripts/op/mesh.py @@ -76,7 +76,7 @@ class MeshMirrorUV(bpy.types.Operator): def execute(self, context): DIR = 1 # TODO, make an option - from Mathutils import Vector + from mathutils import Vector ob = context.active_object is_editmode = (ob.mode == 'EDIT') diff --git a/release/scripts/op/nla.py b/release/scripts/op/nla.py index 062d699ab88..8f775c6040a 100644 --- a/release/scripts/op/nla.py +++ b/release/scripts/op/nla.py @@ -22,7 +22,7 @@ import bpy def pose_info(): - from Mathutils import Matrix + from mathutils import Matrix info = {} diff --git a/release/scripts/op/object.py b/release/scripts/op/object.py index 026d4409272..0b8970ce798 100644 --- a/release/scripts/op/object.py +++ b/release/scripts/op/object.py @@ -235,8 +235,8 @@ class ShapeTransfer(bpy.types.Operator): ob.active_shape_key_index = len(me.shape_keys.keys) - 1 ob.shape_key_lock = True - from Geometry import BarycentricTransform - from Mathutils import Vector + from geometry import BarycentricTransform + from mathutils import Vector if use_clamp and mode == 'OFFSET': use_clamp = False @@ -452,7 +452,7 @@ class MakeDupliFace(bpy.types.Operator): return (obj and obj.type == 'MESH') def _main(self, context): - from Mathutils import Vector + from mathutils import Vector from math import sqrt SCALE_FAC = 0.01 diff --git a/release/scripts/op/object_align.py b/release/scripts/op/object_align.py index c5fcc3d2a32..8c0933b2518 100644 --- a/release/scripts/op/object_align.py +++ b/release/scripts/op/object_align.py @@ -19,7 +19,7 @@ # <pep8 compliant> import bpy -from Mathutils import Vector +from mathutils import Vector def align_objects(align_x, align_y, align_z, align_mode, relative_to): diff --git a/release/scripts/op/object_randomize_transform.py b/release/scripts/op/object_randomize_transform.py index 3d3feb66424..857f6d6c620 100644 --- a/release/scripts/op/object_randomize_transform.py +++ b/release/scripts/op/object_randomize_transform.py @@ -25,7 +25,7 @@ def randomize_selected(seed, loc, rot, scale, scale_even, scale_min): import random from random import uniform - from Mathutils import Vector + from mathutils import Vector random.seed(seed) diff --git a/release/scripts/op/uvcalc_smart_project.py b/release/scripts/op/uvcalc_smart_project.py index c88faae2818..230f2863a7f 100644 --- a/release/scripts/op/uvcalc_smart_project.py +++ b/release/scripts/op/uvcalc_smart_project.py @@ -22,10 +22,9 @@ # <pep8 compliant> -#from Blender import Object, Draw, Window, sys, Mesh, Geometry -from Mathutils import Matrix, Vector, RotationMatrix +from mathutils import Matrix, Vector, RotationMatrix import time -import Geometry +import geometry import bpy from math import cos, radians @@ -227,7 +226,7 @@ def islandIntersectUvIsland(source, target, SourceOffset): # Edge intersect test for ed in edgeLoopsSource: for seg in edgeLoopsTarget: - i = Geometry.LineIntersect2D(\ + i = geometry.LineIntersect2D(\ seg[0], seg[1], SourceOffset+ed[0], SourceOffset+ed[1]) if i: return 1 # LINE INTERSECTION @@ -741,7 +740,7 @@ def packIslands(islandList): #XXX Window.DrawProgressBar(0.7, 'Packing %i UV Islands...' % len(packBoxes) ) time1 = time.time() - packWidth, packHeight = Geometry.BoxPack2D(packBoxes) + packWidth, packHeight = geometry.BoxPack2D(packBoxes) # print 'Box Packing Time:', time.time() - time1 @@ -1056,7 +1055,7 @@ def main(context, island_margin, projection_limit): for f in faceProjectionGroupList[i]: f_uv = f.uv for j, v in enumerate(f.v): - # XXX - note, between Mathutils in 2.4 and 2.5 the order changed. + # XXX - note, between mathutils in 2.4 and 2.5 the order changed. f_uv[j][:] = (v.co * MatProj)[:2] diff --git a/release/scripts/op/vertexpaint_dirt.py b/release/scripts/op/vertexpaint_dirt.py index f2c2d5bd864..0b0d70c5e56 100644 --- a/release/scripts/op/vertexpaint_dirt.py +++ b/release/scripts/op/vertexpaint_dirt.py @@ -34,7 +34,7 @@ import bpy import math import time -from Mathutils import Vector +from mathutils import Vector from bpy.props import * diff --git a/release/scripts/templates/gamelogic.py b/release/scripts/templates/gamelogic.py index b4eac81b492..b31d5d95987 100644 --- a/release/scripts/templates/gamelogic.py +++ b/release/scripts/templates/gamelogic.py @@ -7,7 +7,7 @@ # import GameKeys # support for Vector(), Matrix() types and advanced functions like ScaleMatrix(...) and RotationMatrix(...) -# import Mathutils +# import mathutils # for functions like getWindowWidth(), getWindowHeight() # import Rasterizer |