I’m working on a script that exports the position of vertices in predefined key frames of a simple animation. Here’s the code:
import Blender import math import sys import os import string import array from Blender import NMesh, Object from array import array frame = Blender.Get('curframe') eframe = Blender.Get('endframe') object = Object.GetSelected() objname = object.name meshname = object.data.name mesh = NMesh.GetRaw(meshname) planefile = open(("D:/Blender/b_.csv"), 'w') iteration = 0 times = 0 sele = Blender.link sframes = array('h', [0, 16, 32, 56, 72, 76, 92, 108, 124, 140, 156]) for vertex in mesh.verts: iteration = iteration + 1 planefile.write(',,Number: %s,Section: Brass, Set,Step,Left - Right,Visitor - Home, ' % iteration) times = 0 for frame in sframes: times = times + 1 sele = sframes # the line below Blender.Get('curframe') = sele # the line above sele = sframes if frame == eframe: break
The script continues, but I don’t think there’s a problem with it ('cept that it’s got too many ‘elifs’ to count ). Well, it seems to get hung up on me trying to tell it what frame to put Blender on. Any ideas?
P.S. I’m pretty sure I have to use the script link buttons in Blender. I just don’t know how.