batch exporter-help wanted !


#1

I got a scene with many objets.I need to export each of them individualy in W3D with the name they got in the scene.
(exemple: box1, box2 of the scene will do box1.w3d and box2.w3d)

I only found a script that batch export with the max file name
and I don’t speak any words from the planet maxscipt !<://
waiting for your good advices !

Loran


#2

try this:

outputPath = getSavePath “Save to:”
if (outputPath != undefined) do for obj in objects do exportFile (outputPath + “\” + obj.name + “.w3d”) #noPrompt


#3

It seam to not work ://
here’s where I am:
this work. I unhide object one by one and i just press the “créer un W3d” and its ok!!
Now, I’d like to automate the process that it export each object in the scene alone!

utility massexport “FOREGE Xporter”
(
bitmap logo filename:“forege.bmp”
button doit “créer un W3d”
on doit pressed do
(
filename = getopenfilename types:“MAX(.max)|.max”
max hide inv --hide unselected obj

	--objName = selection.obj.name
	for ob in selection do
	(
		objName = ob.name
		exportfile ((getfilenamepath filename) + (objName) + ".w3d") #noPrompt
	)
)

)


#4

oh, sorry, i just forgot that exportFile exports the complete scene, so you should put a ‘Select ob’ before the exportFile in your loop and add the parameter ‘selectedOnly:TRUE’ to the exportFile command. this should do it, and then there is no need to hide/unhide the objects anymore… i hope i haven’t overseen something else :wink:


#5

just tested this, seems to work correctly…

outputpath = getSavePath “Save to:”

if (outputPath != undefined) do
(
objList = getCurrentSelection()
for o=1 to objList.count do
(
exportName = outputPath + “\” + objList[o].name + “.w3d”
select objList[o]
exportfile exportName #noPrompt selectedOnly:TRUE
)
)


#6

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.