[Closed] pftrack ASCII tracker text file to max
ok im not sure if i understand the problem or what you are trying to do
try this :
if PFtrackimport != undefined do (destroyDialog PFtrackimport)
global
–reaction manager veriables—
FD_trackFile = ()
FD_mergeFile = ()
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
)
)
)
)
rollout PFtrackimport “PFtrack import” width:136 height:40
(
button FD_btn_import_PFtrack “Import PFtrack Data” pos:[8,8] width:112 height:16
on FD_btn_import_PFtrack pressed do
(
try
(
FD_trackFile = getopenFileName caption:"PFtrack tracking data File" types:"pfteack (*.txt)|*.txt|All Files (*.*)|*.*|"
(
importPFTrack2D (FD_trackFile)
)
FD_layer = layermanager.newLayerFromName "FD_Tracking Data" -- creates a new layer with name
select $tracker*
for helper in selection do FD_layer.addNode helper
) catch ()
)
)
createdialog PFtrackimport
copy and paste the text in the maxscript editor window (maxscript,new script)
run the script , a window with a button should open .
press on the button , find the file you want to import ( has to be a save file from pftrack from the user track node).
the data should open in max as points with x and y animation baked on them .
i hope it helps you
Thanks a lot Splinter !!
great
it’s running. i have a problem with offset position.
i exported camera from pftrack as fbx and export user track .
i think that i need to open help pftrack for using one user track with solver camera. …
grea,t thanks again
regards