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 Tools Display Modes
  02 February 2013
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 https://dl.dropbox.com/u/88155050/BF3/Venice1pSke01.txt
Thank you very much guys
  02 February 2013
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
  02 February 2013
Swordslayer you are my Hero!!!

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

Thank you so much!!!
  02 February 2013
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 ;]
  02 February 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 06:35 AM.

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