Text to Point helper cluster

Become a member of the CGSociety

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

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 02 February 2013   #1
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 February 2013   #2
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 February 2013   #3
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 February 2013   #4
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 February 2013   #5
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
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 10:38 PM.


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