PDA

View Full Version : xml Ouput


Deadalus
06-09-2006, 02:30 PM
hello all i'm looking for a script that would output a list of all the object under the xml format.
In other word i have a template XML and i wish to fill the hole with the name of the scene object like
<body listname="Scene_object" >
<object name="object01"/>
<object name="object02"/>
</body>


so if someone already made a script like this or have an idea of where to start i would be very thankful to know it .
im sorry if this look like a way of asking for someone else to do it but i dont have much time at work and i need it as soon as possible. Plus i'm not the more advanced user of maxscript thus i'm asking for help.

thank all
edit; while searching Max innard i found the xmlIO by ravi karra(discreet) .helpful but way to complicated for what i'm looking for.
still searching. Btw i already look at scriptspot...

Jeff_hanna
06-09-2006, 02:58 PM
Here's a script that will out put the formatted information to a file named "SceneObjects.xml" on your c:\ drive. Edit the first line as necessary to change the filename or put it elsewhere.

ssXML = createFile "c:\\SceneObjects.xml"

if ssXML != undefined then (
format "<body listname =\"SceneObject\" >\r\n" to:ssXML

for obj in objects do (
format "\t<object name=\"%\"/>\r\n" obj.name to:ssXML
)

format "</body>" to:ssXML

close ssXML
)

Deadalus
06-09-2006, 03:46 PM
wow fast and clean ! thank a lot !

Deadalus
06-12-2006, 01:47 PM
just a question .
what the \n \r \t mean? i think \n mean its an output? but what mean the other? or at least under wich section can i found info in the help?

Jeff_hanna
06-12-2006, 03:03 PM
just a question .
what the \n \r \t mean? i think \n mean its an output? but what mean the other? or at least under wich section can i found info in the help?

They're escape characters used inside of strings (text within double quotes)

\n - newline
\r - return
\t - tab
\\ - \
\" - "

The last one is a bit confusing. But, if you don't escape a quote you want in the string then MaxScript will interpret it as the end of the string instead.

"And then Jeff said, "this is incorrect."" <-- this won't work like you expect
"And then Jeff said, \"this is correct.\"" <--- this will work properly.

CGTalk Moderation
06-12-2006, 03:03 PM
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.