ASCII 2D tracking data to max

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  06 June 2013
ASCII 2D tracking data to max

I have 2D tracking data from PFtrack as .txt file.
I need a MAXscript what would create Point helper for each tracker in Max and would animate in on X/Y axis according to the data in the file for each frame.

Example of the txt file here:

Similar problem is described in following post form 2011
however script offered as a solution in that thread doesn't work for me:

--Runtime error: No method found which matched argument list.

Thanks .

Last edited by pashash : 06 June 2013 at 07:05 AM.
  06 June 2013
Could you give us the full error-print from your Listener, with the line-numbers etc?

I just tried that script on your data, and it worked fine for me

(although all the points default to [0,0,0] for frame 0, but that'd be easy enough to fix)
  06 June 2013
Here is full error:

-- Error occurred in anonymous codeblock; filename: C:\Dropbox\fx\pasha\; position: 164; line: 3
-- Frame:
-- quot: undefined
-- obj: undefined
-- allLines: undefined
-- space: undefined
-- frames: undefined
-- pos: undefined
-- fname: undefined
-- Error occurred during fileIn in <File:C:\Dropbox\fx\pasha\>
>> MAXScript FileIn Exception: -- Runtime error: No method found which matched argument list <<
  06 June 2013
Could you post the script too, or a link to it?

The line-number for the error you give there (line 3) doesn't appear to match up with anything untoward in the script splinterD posted at the end of that thread - did you copy/paste it correctly?
  06 June 2013
Really appreciate you looking in to this,
Here is the script:

Here is another script what i found what is also suppose to parse this tracking data:

Now the error i got on that one is:

-- Error occurred in anonymous codeblock; filename: C:\Dropbox\fx\pasha\; position: 258; line: 8
-- Frame:
-- _pt: $
-- frameCount: undefined
-- Error occurred during fileIn in <File:C:\Dropbox\fx\pasha\>
>> MAXScript FileIn Exception: -- Runtime error: Read past end of file <<
  06 June 2013
Try using the second script from that thread, that's the one that worked for me:

Originally Posted by splinterD: ok im not sure if i understand the problem or what you are trying to do
try this :

if PFtrackimport != undefined do (destroyDialog PFtrackimport)

--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 "")
			local frames = allLines[pos] as integer
			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] 

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
			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
  06 June 2013
guplik, thank you so much.
  06 June 2013
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 03:14 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.