hi.
To use 2d trackers from syntheyes in blender you have to create ‘supervised trackers’ (here is a tutorial: http://www.ssontech.com/content/closup.htm) inside syntheyes for the features you want to track. Then export from syntheyes with the ‘All Tracker Paths’ option.
I made this simple script to import the trackers data inside blender:
#!BPY
"""
Name: 'Syntheyes Trackers...'
Blender: 245
Group: 'Import'
Tooltip: 'Import Tracker paths from Syntheyes'
"""
__author__= ['Victor Barberan']
__url__ = (' ')
__version__= '0.1'
__bpydoc__= '''
Import Trackers from Syntheyes export.
'''
# ***** BEGIN GPL LICENSE BLOCK *****
#
# Script copyright (C) macouno 2006
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
import Blender, bpy, math
from Blender import *
#cross size
cs = .08
def cross(name):
me = bpy.data.meshes.new(name)
coords = [ [-cs,0,cs],[cs,0,-cs],[cs,0,cs],[-cs,0,-cs] ]
edges = [ [0,1],[2,3] ]
me.verts.extend(coords)
me.edges.extend(edges)
scn = bpy.data.scenes.active
ob = scn.objects.new(me, name)
return ob
def load_trackers(filepath):
maxframe = 1
minframe = 99999
#get current scene
scn = bpy.data.scenes.active
cont = scn.getRenderingContext()
#adjust camera and resolution
resx = cont.imageSizeX()
resy = cont.imageSizeY()
obcam = scn.objects.camera
cam = obcam.getData()
cam.type = 'ortho'
cam.scale = 1
obcam.setLocation(cam.scale/2,-5,((resy * cam.scale) / resx)/2)
obcam.RotX = math.pi/2
obcam.RotY = 0
obcam.RotZ = 0
#open file to import
file = open(filepath).read().splitlines()
for line in file:
if 'Tracker' in line:
#get tracknum
tracknum = int(line.strip('Tracker'))
#create empty
empty = cross('Tracker_'+str(tracknum))
empty.setLocation(0,0,0)
empty.size = (0.1,0.1,0.1)
#create ipo and assign it
ipo = Ipo.New('Object', 'Tracker'+str(tracknum)+'Ipo')
empty.setIpo(ipo)
#adding ipocurves
lx = ipo.addCurve('LocX')
ly = ipo.addCurve('LocZ')
else:
#get frame an coordinates
frame = int(line.split(' ')[0])+1
locx = (float(line.split(' ')[1]) / resx) * cam.scale
locy = (float(line.split(' ')[2]) / resy) * ((resy * cam.scale) / resx)
#print line.split(' ')[1]
#print float(line.split(' ')[1]) /resx
#print (float(line.split(' ')[1]) /resx) * cam.scale
#put new coordinate in ipo curves
lx.append((frame, locx))
lx.update()
ly.append((frame, locy))
ly.update()
#get max and min frames
if maxframe < frame: maxframe = frame
if minframe > frame: minframe = frame
#set start and end frame
if minframe == 99999:
cont.startFrame(1)
else:
cont.startFrame(minframe)
cont.endFrame(maxframe)
Blender.Set('curframe', minframe)
Redraw()
if __name__=='__main__':
Window.FileSelector(load_trackers, 'Import Trackers', '*.txt')
Put this script in your blender scripts dir, and you will find it under file=> import=> Syntheyes Trackers…
a few limitations of the script:
-you have to set the render resolution to the same resolution of your tracked shot.
-it converts your camera to orthographic and relocates it to match the resolution of your shot.
i recommend you to set the tracked shot as background image in blender to see if your tracking went well.
maybe this helps a little.
saludos
vico