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 02-17-2013, 01:48 AM   #1
dainiuxxx
Veteran
portfolio
Dainius G
London, United Kingdom
 
Join Date: Apr 2007
Posts: 68
Text to Point helper cluster

Well the maxscript does say it is even for ppl with no scripting experience, but what seems to be a simple tasks at first now look like I would have to crunch down dozens of terms, syntaxes and many other thing that I have not a single clue about.

So I ask you kind sirs to help me out with this please.

I have a text file that contains text and numbers. I would need the script to open and skip the file contents until it finds a line "member::LinearTransform" then create a Point helper at coordinates that follows below the line
member::LinearTransform
right::Vec3
x 1.0
y 0.0
z 0.0
up::Vec3
x -0.0
y 1.0
z 0.0
forward::Vec3
x 0.0
y -0.0
z 1.0
trans::Vec3
x 2.0
y 0.9
z 0.5

Then go to next line create a point helper at line coordinates, and so on.

If someone could give me at least a base idea for the code so I can try to refine it myself. But I do need a base to to start from.

Full text file https://dl.dropbox.com/u/88155050/BF3/Venice1pSke01.txt
Thank you very much guys
 
Old 02-17-2013, 10:52 AM   #2
Swordslayer
isKindOf Artist
 
Swordslayer's Avatar
portfolio
Vojtech Cada
3D generalist
Czech Republic
 
Join Date: Jun 2006
Posts: 371
Send a message via ICQ to Swordslayer
What about something like this:

Code:
( fn nextFloat stream = (trimLeft (readLine stream) " xyz") as float fn getVector stream type = ( skipToString stream type skipToNextLine stream Point3 (nextFloat stream) (nextFloat stream) (nextFloat stream) ) fn getNextMatrix stream = if skipToString stream "member::LinearTransform" != undefined do matrix3 (getVector stream "right::Vec3") \ (getVector stream "up::Vec3") \ (getVector stream "forward::Vec3") \ (getVector stream "trans::Vec3") local file = openFile "C:\\TEMP\\Venice1pSke01.txt" while (local matrix = getNextMatrix file) != undefined do Point transform:matrix size:.5 )
__________________
Blog :: LinkedIn profile
 
Old 02-17-2013, 08:36 PM   #3
dainiuxxx
Veteran
portfolio
Dainius G
London, United Kingdom
 
Join Date: Apr 2007
Posts: 68
Swordslayer you are my Hero!!!

Your script works like a charm, I`ll send you a box of finest cookies.


Thank you so much!!!
 
Old 02-23-2013, 03:11 PM   #4
dainiuxxx
Veteran
portfolio
Dainius G
London, United Kingdom
 
Join Date: Apr 2007
Posts: 68
The script works great, but I keep failing on finding a correct function to name the created pointers according to the "BoneName::Array" (.txt file in attachment)

So instead of naming created: "Pointer01" it would be named "Reference", then instead of "Pointer02" name "AITrajectory", and follow the rest of the list...


Anyone any tips?

Thanks ;]
 
Old 02-23-2013, 03:11 PM   #5
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,480
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:46 PM.


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