Feedback

What's your question?

By: Asked

Exporting 2D Tracking Data from Nuke to Shake

Hey guys, My first question here.

It would be useful to know how to export tracking data from a Nuke tracker into shake tracking data which can be loaded into a stabilize node.

At current, I save the tracker as a seperate script and then send it through the extremely useful tracksperanto service. (http://tracksperanto.guerilla-di.org/) Though I would really like to know if there are any reliable plugins or code I can run to do this without having to rely on an external web service.

Thanks, Matt

Add comment viewed 1,021 times Latest activity 11 months ago

or Cancel

3 answers

  • 3

vfxoverflow_99

try this

#! /usr/bin/env python

## Use the script to help get tracker information from Nuke to Shake.  It will alter data written out
## of Nuke and re-format it to be read by Shake.
## Justin Ball
## 20090506

import sys, os.path, string



if len(sys.argv) <= 1:
    print "Please attach a file path to the Nuke tracker file when running the script"
    nukeFile = raw_input("Please provide a path to the file now: ")
    if nukeFile == "":
        print "\nNo File, we will now exit.\n"
        sys.exit(0)

if isfile(sys.argv[1]):
    nukeFile = sys.argv[1]

lineNumber = "1"
incr = "1"
correlationValue = '1.000'




baseName = os.path.basename(nukeFile)

dirName = os.path.dirname(nukeFile)

nukeFileName = []
nukeFileName = string.split(baseName, '.')

outFile = nukeFileName[0] + "_shake" + ".txt"

outFile = os.path.join(dirName, outFile)
print outFile
readFile = open(nukeFile, 'r').readlines()



write = open(outFile, 'w')
write.write("TrackName track1\n")
write.write("   Frame \t X \t Y \t Correlation\n")

for line in readFile:
    values = string.split(line, " ")
    values1 = string.strip(values[1], "\n")


    newLineNumber = str(lineNumber) + ".00" 


    newLine = ("   " + str(newLineNumber) + "    " + str(values[0]) + "    " + str(values1) + "    " + correlationValue + "\n")
    print newLine
    write.write(newLine)
    lineNumber = int(lineNumber) + 1



print "Done"
or Cancel
  • 4

julik [ Editor ]

You can install Tracksperanto on your computer and not have to upload anything, I've written it in 4 places but it still gets lost in translation somehow.

If you are on a mac, go to your Terminal and issue the following command

 sudo gem install tracksperanto

Then you will have a program that you can run like so

 tracksperanto -w 1920 -h 1080 /Drag/Your/Nuke/Script/Into/The/Terminal/Here.nk --only ShakeText

If you are on Winblowz try the Ruby one-click installer (check that you want rubygems), then you can basically use the same commands. On Linux, install ruby and rubygems from your distro's favorite distribution system (yum or apt).

To see how to operate it type

tracksperanto --help

Also, you don't need to save your tracker separately since Tracksperanto will just ignore the rest of the script.

NN comments
julian
-

Nice! Can it export to a 3d camera? If the focal length was given, and you make the assumption that the camera translation is fixed and only rotation changes…

julik
-

Nope, tracksperanto doesn’t solve anything (you would need a nodal solver for this).

or Cancel
  • 0

imgn

check out IXIR 2D Track Editor, some features u may get useful,

http://vimeo.com/channels/154218

http://www.ixirdigital.com/products.php

Export Files

3D Equalizer v4 2d Track File, PFTrack v5 2d Track File, Boujou 2d Track File, SynthEyes 2d Track File, MatchMover/Movimento 2d Track File, Maya Live 2d Track File *.txt

2D Software Files

Nuke 2d Track Files, Nuke RotoPaint Files, Nuke Camera Files *.txt, *.nk, Shake 2d Track Files, Shake RotoShape Files *.txt, *.ssf, Fusion 2d Track Files, Fusion Mask Files *.dfmo, *.comp, After Effects 2d Track Files, After Effects Mask Files Clip Board

Combustion 2d Track Files, Combustion GMask Files *.ascii, *.GMask

or Cancel