Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-09-03 11:26:27 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-09-03 11:26:27 +0400
commit3c4c1ed512c84ab06ec74fba5151b36062d639ec (patch)
treebd0599dd07048c31e015afe7b89a8de80c2e5513
parent722806d6731447273dc470fb1bf6e9bf280da658 (diff)
updates for changes in blender.
-rw-r--r--io_anim_camera.py4
-rw-r--r--io_export_directx_x.py30
-rw-r--r--io_export_unreal_psk_psa.py10
-rw-r--r--io_import_images_as_planes.py4
-rw-r--r--io_import_scene_mhx.py2
-rw-r--r--io_import_scene_unreal_psk.py2
6 files changed, 26 insertions, 26 deletions
diff --git a/io_anim_camera.py b/io_anim_camera.py
index 64c79d20..50951226 100644
--- a/io_anim_camera.py
+++ b/io_anim_camera.py
@@ -79,9 +79,9 @@ def writeCameras(context, filepath, frame_start, frame_end, only_selected=False)
for f in frame_range:
- scene.set_frame(f)
+ scene.frame_set(f)
fw("# new frame\n")
- fw("scene.set_frame(%d + frame)\n" % f)
+ fw("scene.frame_set(%d + frame)\n" % f)
for obj, obj_data in cameras:
fw("obj = cameras['%s']\n" % obj.name)
diff --git a/io_export_directx_x.py b/io_export_directx_x.py
index a4773dea..e32f542a 100644
--- a/io_export_directx_x.py
+++ b/io_export_directx_x.py
@@ -669,7 +669,7 @@ def WriteKeyedAnimationSet(Config):
if len(AllKeyframes):
Config.File.write("{}2;\n{}{};\n".format(" " * Config.Whitespace, " " * Config.Whitespace, len(AllKeyframes)))
for Keyframe in AllKeyframes:
- bpy.context.scene.set_frame(Keyframe)
+ bpy.context.scene.frame_set(Keyframe)
Position = Vector()
Position[0] = ((PositionFCurves[0][Keyframe] if Keyframe in PositionFCurves[0] else Object.location[0]) if PositionFCurves[0] else Object.location[0])
Position[1] = ((PositionFCurves[1][Keyframe] if Keyframe in PositionFCurves[1] else Object.location[1]) if PositionFCurves[1] else Object.location[1])
@@ -678,7 +678,7 @@ def WriteKeyedAnimationSet(Config):
Config.File.write("{}{}{:9f},{:9f},{:9f};;\n".format(" " * Config.Whitespace, (str(Keyframe - bpy.context.scene.frame_start) + ";3;").ljust(8), Position[0], Position[1], Position[2]))
else:
Config.File.write("{}2;\n{}1;\n".format(" " * Config.Whitespace, " " * Config.Whitespace))
- bpy.context.scene.set_frame(bpy.context.scene.frame_start)
+ bpy.context.scene.frame_set(bpy.context.scene.frame_start)
Position = Config.SystemMatrix * Object.location
Config.File.write("{}{}{:9f},{:9f},{:9f};;\n".format(" " * Config.Whitespace, ("0;3;").ljust(8), Position[0], Position[1], Position[2]))
Config.Whitespace -= 1
@@ -704,7 +704,7 @@ def WriteKeyedAnimationSet(Config):
if len(AllKeyframes):
Config.File.write("{}0;\n{}{};\n".format(" " * Config.Whitespace, " " * Config.Whitespace, len(AllKeyframes)))
for Keyframe in AllKeyframes:
- bpy.context.scene.set_frame(Keyframe)
+ bpy.context.scene.frame_set(Keyframe)
Rotation = Euler()
Rotation[0] = ((RotationFCurves[0][Keyframe] if Keyframe in RotationFCurves[0] else Object.rotation_euler[0]) if RotationFCurves[0] else Object.rotation_euler[0])
Rotation[1] = ((RotationFCurves[1][Keyframe] if Keyframe in RotationFCurves[1] else Object.rotation_euler[1]) if RotationFCurves[1] else Object.rotation_euler[1])
@@ -713,7 +713,7 @@ def WriteKeyedAnimationSet(Config):
Config.File.write("{}{}{:9f},{:9f},{:9f},{:9f};;\n".format(" " * Config.Whitespace, (str(Keyframe - bpy.context.scene.frame_start) + ";4;").ljust(8), - Rotation[0], Rotation[1], Rotation[2], Rotation[3]))
else:
Config.File.write("{}0;\n{}1;\n".format(" " * Config.Whitespace, " " * Config.Whitespace))
- bpy.context.scene.set_frame(bpy.context.scene.frame_start)
+ bpy.context.scene.frame_set(bpy.context.scene.frame_start)
Rotation = (Config.SystemMatrix * (Object.rotation_euler.to_matrix().to_4x4()) * Config.InverseSystemMatrix).to_quat()
Config.File.write("{}{}{:9f},{:9f},{:9f},{:9f};;\n".format(" " * Config.Whitespace, ("0;4;").ljust(8), -Rotation[0], Rotation[1], Rotation[2], Rotation[3]))
Config.Whitespace -= 1
@@ -739,7 +739,7 @@ def WriteKeyedAnimationSet(Config):
if len(AllKeyframes):
Config.File.write("{}1;\n{}{};\n".format(" " * Config.Whitespace, " " * Config.Whitespace, len(AllKeyframes)))
for Keyframe in AllKeyframes:
- bpy.context.scene.set_frame(Keyframe)
+ bpy.context.scene.frame_set(Keyframe)
Scale = Vector()
Scale[0] = ((ScaleFCurves[0][Keyframe] if Keyframe in ScaleFCurves[0] else Object.scale[0]) if ScaleFCurves[0] else Object.scale[0])
Scale[1] = ((ScaleFCurves[1][Keyframe] if Keyframe in ScaleFCurves[1] else Object.scale[1]) if ScaleFCurves[1] else Object.scale[1])
@@ -748,7 +748,7 @@ def WriteKeyedAnimationSet(Config):
Config.File.write("{}{}{:9f},{:9f},{:9f};;\n".format(" " * Config.Whitespace, (str(Keyframe - bpy.context.scene.frame_start) + ";3;").ljust(8), Scale[0], Scale[1], Scale[2]))
else:
Config.File.write("{}1;\n{}1;\n".format(" " * Config.Whitespace, " " * Config.Whitespace))
- bpy.context.scene.set_frame(bpy.context.scene.frame_start)
+ bpy.context.scene.frame_set(bpy.context.scene.frame_start)
Scale = Config.SystemMatrix * Object.scale
Config.File.write("{}{}{:9f},{:9f},{:9f};;\n".format(" " * Config.Whitespace, ("0;3;").ljust(8), Scale[0], Scale[1], Scale[2]))
Config.Whitespace -= 1
@@ -807,7 +807,7 @@ def WriteKeyedAnimationSet(Config):
AllKeyframes = [bpy.context.scene.frame_start]
Config.File.write("{}2;\n{}{};\n".format(" " * Config.Whitespace, " " * Config.Whitespace, len(AllKeyframes)))
for Keyframe in AllKeyframes:
- bpy.context.scene.set_frame(Keyframe)
+ bpy.context.scene.frame_set(Keyframe)
if Bone.parent:
PoseMatrix = (Bone.parent.matrix * Matrix.Rotation(radians(-90), 4, "X")).invert()
@@ -843,7 +843,7 @@ def WriteKeyedAnimationSet(Config):
AllKeyframes = [bpy.context.scene.frame_start]
Config.File.write("{}0;\n{}{};\n".format(" " * Config.Whitespace, " " * Config.Whitespace, len(AllKeyframes)))
for Keyframe in AllKeyframes:
- bpy.context.scene.set_frame(Keyframe)
+ bpy.context.scene.frame_set(Keyframe)
if Bone.parent:
PoseMatrix = (Bone.parent.matrix * Matrix.Rotation(radians(-90), 4, "X")).invert()
@@ -879,7 +879,7 @@ def WriteKeyedAnimationSet(Config):
AllKeyframes = [bpy.context.scene.frame_start]
Config.File.write("{}1;\n{}{};\n".format(" " * Config.Whitespace, " " * Config.Whitespace, len(AllKeyframes)))
for Keyframe in AllKeyframes:
- bpy.context.scene.set_frame(Keyframe)
+ bpy.context.scene.frame_set(Keyframe)
if Bone.parent:
PoseMatrix = (Bone.parent.matrix * Matrix.Rotation(radians(-90), 4, "X")).invert()
@@ -930,7 +930,7 @@ def WriteFullAnimationSet(Config):
Config.Whitespace += 1
Config.File.write("{}2;\n{}{};\n".format(" " * Config.Whitespace, " " * Config.Whitespace, KeyframeCount))
for Frame in range(0, KeyframeCount):
- bpy.context.scene.set_frame(Frame + bpy.context.scene.frame_start)
+ bpy.context.scene.frame_set(Frame + bpy.context.scene.frame_start)
Position = Config.SystemMatrix * Object.location
Config.File.write("{}{}{:9f},{:9f},{:9f};;\n".format(" " * Config.Whitespace, (str(Frame) + ";3;").ljust(8), Position[0], Position[1], Position[2]))
Config.Whitespace -= 1
@@ -945,7 +945,7 @@ def WriteFullAnimationSet(Config):
Config.Whitespace += 1
Config.File.write("{}0;\n{}{};\n".format(" " * Config.Whitespace, " " * Config.Whitespace, KeyframeCount))
for Frame in range(0, KeyframeCount):
- bpy.context.scene.set_frame(Frame + bpy.context.scene.frame_start)
+ bpy.context.scene.frame_set(Frame + bpy.context.scene.frame_start)
Rotation = Config.SystemQuaternion.cross(Object.rotation_euler.to_quat().cross(Config.InverseSystemQuaternion))
Config.File.write("{}{}{:9f},{:9f},{:9f},{:9f};;\n".format(" " * Config.Whitespace, (str(Frame) + ";4;").ljust(8), Rotation[0], Rotation[1], Rotation[2], Config.FlipZ * Rotation[3]))
Config.Whitespace -= 1
@@ -960,7 +960,7 @@ def WriteFullAnimationSet(Config):
Config.Whitespace += 1
Config.File.write("{}1;\n{}{};\n".format(" " * Config.Whitespace, " " * Config.Whitespace, KeyframeCount))
for Frame in range(0, KeyframeCount):
- bpy.context.scene.set_frame(Frame + bpy.context.scene.frame_start)
+ bpy.context.scene.frame_set(Frame + bpy.context.scene.frame_start)
Scale = Config.SystemMatrix * Object.scale
Config.File.write("{}{}{:9f},{:9f},{:9f};;\n".format(" " * Config.Whitespace, (str(Frame) + ";3;").ljust(8), Scale[0], Scale[1], Scale[2]))
Config.Whitespace -= 1
@@ -990,7 +990,7 @@ def WriteFullAnimationSet(Config):
Config.Whitespace += 1
Config.File.write("{}2;\n{}{};\n".format(" " * Config.Whitespace, " " * Config.Whitespace, KeyframeCount))
for Frame in range(0, KeyframeCount):
- bpy.context.scene.set_frame(Frame + bpy.context.scene.frame_start)
+ bpy.context.scene.frame_set(Frame + bpy.context.scene.frame_start)
if Bone.parent:
PoseMatrix = (Bone.parent.matrix * Matrix.Rotation(radians(-90), 4, "X")).invert()
@@ -1014,7 +1014,7 @@ def WriteFullAnimationSet(Config):
Config.Whitespace += 1
Config.File.write("{}0;\n{}{};\n".format(" " * Config.Whitespace, " " * Config.Whitespace, KeyframeCount))
for Frame in range(0, KeyframeCount):
- bpy.context.scene.set_frame(Frame + bpy.context.scene.frame_start)
+ bpy.context.scene.frame_set(Frame + bpy.context.scene.frame_start)
#Whew! I'm sure this could be simplified.
Rotation = Config.SystemQuaternion.cross(Matrix.Rotation(radians(90), 4, "X").to_quat().cross(Bone.rotation_quaternion.cross(Matrix.Rotation(radians(-90), 4, "X").to_quat().cross(Config.InverseSystemQuaternion))))
Config.File.write("{}{}{:9f},{:9f},{:9f},{:9f};;\n".format(" " * Config.Whitespace, (str(Frame) + ";4;").ljust(8), Rotation[0], Rotation[1], Rotation[2], Config.FlipZ * Rotation[3]))
@@ -1030,7 +1030,7 @@ def WriteFullAnimationSet(Config):
Config.Whitespace += 1
Config.File.write("{}1;\n{}{};\n".format(" " * Config.Whitespace, " " * Config.Whitespace, KeyframeCount))
for Frame in range(0, KeyframeCount):
- bpy.context.scene.set_frame(Frame + bpy.context.scene.frame_start)
+ bpy.context.scene.frame_set(Frame + bpy.context.scene.frame_start)
if Bone.parent:
PoseMatrix = (Bone.parent.matrix * Matrix.Rotation(radians(-90), 4, "X")).invert()
diff --git a/io_export_unreal_psk_psa.py b/io_export_unreal_psk_psa.py
index 819faa80..501912ad 100644
--- a/io_export_unreal_psk_psa.py
+++ b/io_export_unreal_psk_psa.py
@@ -1193,7 +1193,7 @@ def parse_animation(blender_scene, blender_armatures, psa_file):
#print "This Frame: %i, Next Frame: NONE" % frame
#frame start from 1 as number one from blender
- blender_scene.set_frame(frame)
+ blender_scene.frame_set(frame)
cur_frame_index = cur_frame_index + 1
for bone_data in ordered_bones:
@@ -1346,7 +1346,7 @@ def fs_callback(filename, context, user_setting):
print("//===============================")
parse_meshes(blender_meshes, psk)
except:
- context.scene.set_frame(cur_frame) #set frame back to original frame
+ context.scene.frame_set(cur_frame) #set frame back to original frame
print ("Exception during Mesh Parse")
raise
@@ -1361,7 +1361,7 @@ def fs_callback(filename, context, user_setting):
parse_armature(blender_armature, psk, psa)
except:
- context.scene.set_frame(cur_frame) #set frame back to original frame
+ context.scene.frame_set(cur_frame) #set frame back to original frame
print ("Exception during Armature Parse")
raise
@@ -1375,13 +1375,13 @@ def fs_callback(filename, context, user_setting):
parse_animation(current_scene, blender_armature, psa)
except:
- context.scene.set_frame(cur_frame) #set frame back to original frame
+ context.scene.frame_set(cur_frame) #set frame back to original frame
print ("Exception during Animation Parse")
raise
# reset current frame
- context.scene.set_frame(cur_frame) #set frame back to original frame
+ context.scene.frame_set(cur_frame) #set frame back to original frame
##########################
# FILE WRITE
diff --git a/io_import_images_as_planes.py b/io_import_images_as_planes.py
index fedd89da..61c88c46 100644
--- a/io_import_images_as_planes.py
+++ b/io_import_images_as_planes.py
@@ -327,7 +327,7 @@ def main(filePath, options, mapping, dimension):
plane = createPlaneObj(img, dimension)
# Assign Material
- plane.data.materials.link(mat)
+ plane.data.materials.append(mat)
# Put Image into UVTextureLayer
plane.data.uv_textures[0].data[0].image = img
@@ -356,7 +356,7 @@ def main(filePath, options, mapping, dimension):
plane = createPlaneObj(img, dimension)
# Assign Material
- plane.data.materials.link(mat)
+ plane.data.materials.append(mat)
# Put image into UVTextureLayer
plane.data.uv_textures[0].data[0].image = img
diff --git a/io_import_scene_mhx.py b/io_import_scene_mhx.py
index 9230f9c7..765ba0d9 100644
--- a/io_import_scene_mhx.py
+++ b/io_import_scene_mhx.py
@@ -1128,7 +1128,7 @@ def parseMesh (args, tokens):
parseShapeKeys(ob, me, val, sub)
elif key == 'Material':
try:
- me.materials.link(loadedData['Material'][val[0]])
+ me.materials.append(loadedData['Material'][val[0]])
except:
print("Could not add material", val[0])
else:
diff --git a/io_import_scene_unreal_psk.py b/io_import_scene_unreal_psk.py
index 5060156a..0c2e878b 100644
--- a/io_import_scene_unreal_psk.py
+++ b/io_import_scene_unreal_psk.py
@@ -540,7 +540,7 @@ def pskimport(infile):
#= make sure the list isnt too big
for material in materials:
#add material to the mesh list of materials
- me_ob.materials.link(material)
+ me_ob.materials.append(material)
#===================================================================================================
#
#===================================================================================================