[Closed] pftrack ASCII tracker text file to max
hey guys
im trying to get 2d tracking data from pftrack 2011
to 3dsmax
the only way i can find for now to export the data fast
is by exporting it to ascii text file
i cant import into max or after
is it posible to do it vie max script ???
or is there another way?
here is a sample of a file:
“Name”
clipNumber
frameCount
frame, xpos, ypos, similarity
“Null_001”
1
924
0 192.000000 510.750000 1.000000
1 192.000000 510.750000 -1.000000
2 190.747025 508.957520 -1.000000
3 190.710312 508.697418 -1.000000
4 190.808624 508.255066 -1.000000
5 191.121292 508.484161 -1.000000
6 191.931137 508.433838 -1.000000
7 191.155853 508.437500 0.936175
8 190.832977 509.182068 -1.000000
9 190.746475 509.122803 -1.000000
10 190.645721 509.392761 -1.000000
11 190.671677 509.316772 -1.000000
12 190.638367 509.636078 -1.000000
13 190.457062 510.084320 -1.000000
14 190.396042 510.148041 -1.000000
15 190.374603 510.218750 0.920438
16 190.383316 510.290100 -1.000000
17 190.386795 510.239838 -1.000000
18 190.396088 510.262604 -1.000000
19 190.432693 510.103455 -1.000000
20 190.427826 509.829803 -1.000000
21 190.465027 509.706207 -1.000000
22 190.624603 509.625000 0.920398
really hope u guys can help
In your text file there is only X & Y position data and no Z… what should happen?
edit: sorry, you said you were after 2D tracking data.
What is the relevance of the similarity parameter for each frame?
ignoring the similarity parameter, this seems to work, but I will need you to upload an actual file with more than one object to test.
Also keep in mind there is no error handling, this is just a quick flimsy solution.
fn importPFTrack2D fName =
(
local allLines = for l in ((dotNetClass "System.IO.File").readAllLines fName) where l[1]!="#" and l.count>0 collect l
local pos = 1
while pos < allLines.count do
(
with animate on
(
local obj = point name:(substituteString allLines[pos] "\"" "")
pos+=2
local frames = allLines[pos] as integer
pos+=1
for i = 1 to frames do
(
local vals = filterString allLines[pos] " "
at time (vals[1] as integer) obj.pos = [vals[2] as float, vals[3] as float, 0]
pos+=1
)
)
)
)
Wow thanks man , I didn’t except to get a reply so soon!
As soon as I get to th office I’ll upload the file.
That is super helpful , thanks alot !
You’re quite the early bird…
fn importPFTrack2D fName =
(
local allLines = for l in ((dotNetClass "System.IO.File").readAllLines fName) where l[1]!="#" and l.count>0 collect l
local pos = 1
local quot = "\""
local space = " "
while pos < allLines.count do
(
with animate on
(
local obj = point name:(substituteString allLines[pos] quot "")
pos+=2
local frames = allLines[pos] as integer
pos+=1
for i = 1 to frames do
(
local vals = filterString allLines[pos] space
at time (vals[1] as integer) obj.pos = [vals[2] as float, vals[3] as float, 0]
pos+=1
)
)
)
)
usage:
importPFTrack2D @"C: est.txt"
The function seems to work fine for me, have you tried it?
Hello IO, helloSplinter.
i’m looking at your exchange. great great.
but i’m junior about scipt.
and i tried t your script for import x.y position from pftrack to an object in 3dsmax.
when i running your sricp i get an error message on the line ” usage”.
a factor is atteming(waiting) ?
how to for apply the script to my object ?
regards
sorry for my english…
I m sorry but i don’t see my request for this thread. posted 3 hours ago i m trying by this post to understand.