CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 06-11-2013, 06:38 AM   #1
pashash
New Member
portfolio
Pasha
san carlos, USA
 
Join Date: Jan 2008
Posts: 5
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:
https://www.dropbox.com/s/2n7j5zp88...Ftrack-Test.txt


Similar problem is described in following post form 2011
http://forums.cgsociety.org/archive...p/t-988155.html
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-12-2013 at 07:05 AM.
 
Old 06-14-2013, 09:35 AM   #2
guplik
New Member
portfolio
Neal Corbett
Senior Technical Artist
Rockstar Leeds
Leeds, United Kingdom
 
Join Date: Apr 2008
Posts: 11
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)
 
Old 06-14-2013, 09:42 AM   #3
pashash
New Member
portfolio
Pasha
san carlos, USA
 
Join Date: Jan 2008
Posts: 5
Here is full error:

-- Error occurred in anonymous codeblock; filename: C:\Dropbox\fx\pasha\testtr4.ms; 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\testtr4.ms>
>> MAXScript FileIn Exception: -- Runtime error: No method found which matched argument list <<
 
Old 06-14-2013, 11:41 AM   #4
guplik
New Member
portfolio
Neal Corbett
Senior Technical Artist
Rockstar Leeds
Leeds, United Kingdom
 
Join Date: Apr 2008
Posts: 11
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?
 
Old 06-17-2013, 06:11 AM   #5
pashash
New Member
portfolio
Pasha
san carlos, USA
 
Join Date: Jan 2008
Posts: 5
Really appreciate you looking in to this,
Here is the script:

https://www.dropbox.com/s/o54n3eyzwj8o2z6/testtr4.ms


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

https://www.dropbox.com/s/i90dfyhqpo34gqr/testt2r.ms

Now the error i got on that one is:

-- Error occurred in anonymous codeblock; filename: C:\Dropbox\fx\pasha\testt2r.ms; position: 258; line: 8
-- Frame:
-- _pt: $
-- frameCount: undefined
-- Error occurred during fileIn in <File:C:\Dropbox\fx\pasha\testt2r.ms>
>> MAXScript FileIn Exception: -- Runtime error: Read past end of file <<
 
Old 06-17-2013, 10:00 AM   #6
guplik
New Member
portfolio
Neal Corbett
Senior Technical Artist
Rockstar Leeds
Leeds, United Kingdom
 
Join Date: Apr 2008
Posts: 11
Try using the second script from that thread, that's the one that worked for me:

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


Code:
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 "") 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
 
Old 06-17-2013, 09:34 PM   #7
pashash
New Member
portfolio
Pasha
san carlos, USA
 
Join Date: Jan 2008
Posts: 5
WORKS!
guplik, thank you so much.
 
Old 06-17-2013, 09:34 PM   #8
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 01:25 AM.


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