ScriptSpot

Forum topic · General Scripting

export selected via maxscript

By kredka · 2013-12-04

Description

super simple question but I have no idea and don't found anything in max help.
I want export to obj selected objects from scene to file for specified name.Is it possible at all via maxscript?

The only thing I found is:
actionMan.executeAction 0 "40373" -- File: Export Selected
but there is no access to name, extension, etc.

Comments (4)

work

kredka · 2013-12-04

ok I found this

for anyone looking for exporting selected objects:

sceneName = maxFilePath + "objectName.obj"
exportfile sceneName #noPrompt selectedOnly:true

kredka · 2013-12-04

thanks for link,I have seen it already before your reply and like I said, there is nothing about exporting selected objects, I check it with noses:

sceneName = maxFilePath + "objectName.obj"
for o in selection do
(
saveNodes o sceneName
)

but don't work

barigazy · 2013-12-04

You are making me angry.

-- to export selection to *.obj
if selection.count != 0 do
(
theClasses = exporterPlugin.classes
_objIdx = findItem theClasses ObjExp
-- with *.OBJ export dialog
exportFile (GetDir #scene + "/exportTest" ) selectedOnly:on using:theClasses[_objIdx]
-- without *.OBJ export dialog
--exportFile (GetDir #scene + "/exportTest" ) #noprompt selectedOnly:on using:theClasses[_objIdx]
)