View Full Version : looking for script to save multiple selected obj separately.
Anyone knows script that can save objects that I selected in scene as separate max files with name of the object?
|
|
f97ao
06-11-2007, 09:04 AM
Anyone knows script that can save objects that I selected in scene as separate max files with name of the object?
A sketch, may need some minor changes:
output="C:\"
for obj in $selection do
(
saveNodes obj (fileOutputPath+obj.name+".max") quiet:true
)
/Andreas
davestewart
06-11-2007, 09:06 AM
for obj in geometry do saveNodes obj ("c:\\temp\\" +obj.name+ ".max") quiet:true
EDIT: Sorry Andreas, posted at the same time!
magicm
06-11-2007, 09:09 AM
<bool>saveNodes <node_collection> <filename_string> [quiet:<bool>]
Creates a new .max scene file with the given name and stores the node collection to it. The <node_collection> argument can be a single node, an array of nodes you gathered, a wild-card path name, one of the built-in objects sets such as selection or lights, or a <node>.children array. If no filename extension is specified, ".max" is automatically appended to the filename.
For details on the quiet: option which was added to this method in 3ds Max 8, please see Quiet Mode
The method will return true on success or false if the saving failed (for example if attempting to overwrite an existing read-only file) in 3ds Max 8 and higher.
A couple of things to keep in mind:
- This function will overwrite existing files without prompting.
- I'm pretty sure this function will not automatically include dependent objects. So for example if you want to save a group, you'll need to collect its children yourself.
Hope this helps,
Martijn
EDIT: Sorry Dave, posted at the same time!
mrapelje
06-11-2007, 08:20 PM
I wrote a script that exports each selected object, should be able to modify it to save each...
JeeWiz (Just-Export-Each-WIZard) -- Dumps all the selected objects into the default export folder.
http://www.polyleaf.com/mattrapelje_jeewiz.zip
It is also bundeled into this handy little set of exporting tools.
http://www.scriptspot.com/3ds-max/export-prep
thanks guys but I managed to figure it out earlier, here's mine: it also reset position of each object:
macroScript savingSelected category: "lukxScripts"
(
for obj in selection do
(
tempPos = obj.position
obj.position = [0,0,0]
saveNodes obj ("c:/temp/" + obj.name + ".max")
obj.position = tempPos
)
)
CGTalk Moderation
06-15-2007, 08:07 AM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.