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
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
x 1.0
y 0.0
z 0.0
x -0.0
y 1.0
z 0.0
x 0.0
y -0.0
z 1.0
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
Thank you very much guys
Old 02-17-2013, 10:52 AM   #2
isKindOf Artist
Swordslayer's Avatar
Vojtech Cada
3D generalist
Czech Republic
Join Date: Jun 2006
Posts: 456
Send a message via ICQ to Swordslayer
What about something like this:

( 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 )
Scripts :: linkedin
Old 02-17-2013, 08:36 PM   #3
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
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
CGTalk Forum Leader
Join Date: Sep 2003
Posts: 1,066,478
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 02:49 PM.

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