small modification needed with this anton script for object export

hi,, i would like to have this script to modification,, little bit,, like while the export should make the object export with the file name instead of the object name in the max, also if possible,, i want to export 6 object defined names which i want to export to specified folder, which should include the path in the script to define,, can anybody help.,,

i will specify the 6 objects with names and the output path in the script,, and it should just export the objects with the file name not with the object name

******************************************************************************
--this script is made by Anton Berg at os3d.se
--anton[at]os3d.se

rollout ExportObj "Export as separate files" width:232 height:107
(
global theClasses
global outPath
local debug = true
edittext edt1 "filename" pos:[8,83] width:152 height:16 readOnly:false
button btn1 "Export" pos:[168,59] width:56 height:40
checkbox chk1 "Prefix of the file:" pos:[9,62] width:120 height:16 checked:true toolTip:"if this is checked then the prefix text will be used to name the file"
dropdownList ddl2 "FileType" pos:[9,6] width:152 height:40
checkbox chk2 "Debug" pos:[168,29] width:56 height:16 checked:true tooltip:"This will show error messages"

fn NewfileName inputPath objName ischecked nr= (
if ischecked == true then
(
--set the filename to this prefix
np = inputPath + "\\" + objName + "_"+ nr as string --+".obj"
if debug then print np
)

else
(
--set the filename to the object filename
np = inputPath + "\\" + objName --e+ ".obj"
if debug then print np
)
return np
)

on ExportObj open do
(
theClasses = exporterPlugin.classes
theClassesNames = #()
for exptyp in theClasses do
(
append theClassesNames (exptyp as string)
)
ddl2.items = theClassesNames
)
on btn1 pressed do
(
theClasses = exporterPlugin.classes
if outPath == undefined then outPath = ""
outPath = getSavePath initialDir:outpath
if outPath != undefined then
(
selArray = selection as array
sceneObjs =#()

for item in selArray do
(
try (explodeGroup item)
catch()
)

selArray = selection as array
for item in selArray do
(
if (isKindOf item GeometryClass) then append sceneObjs item
)

for i = 1 to sceneObjs.count do
(
oname = (if chk1.state then edt1.text else sceneObjs[i].name)

if i == 1 then
(
select sceneObjs[i]
newName = NewfileName outPath oname chk1.state i

result = (exportFile newName using:(theClasses[ddl2.selection]) selectedOnly: true)

if result != true then (
if chk2.state == true then (messageBox "OS3D debug INFO:\nYou have a selected a filformat that doesn´t except the selected only state..")
result = (exportFile newName using:(theClasses[ddl2.selection]) selectedOnly: false)
)

)

if i > 1 then
(
select sceneObjs[i]
newName = NewfileName outPath oname chk1.state i

result = (exportFile newName #noPrompt using:(theClasses[ddl2.selection]) selectedOnly: true)
if result != true then (
--messageBox "You have a selected a filformat that doesn´t except the selected only state.."
result = (exportFile newName using:(theClasses[ddl2.selection]) selectedOnly: false)
)
)

)
select sceneObjs
)
else
(
messagebox "No output path selected"
)
)
on chk1 changed theState do
(
if theState then edt1.readOnly = false else edt1.readOnly = true
)
)
createdialog ExportObj

*******************************************************************************

Cananybody help this out,,, ???

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anton Berg's picture

I just did some

I just did some modifications to this script today for another user but unfortunally it is not a solution to what you want.

Could you just describe a bit more what you want? Preferebly via examples.

Do you want all outputfiles to have the same name? But end up in a unique folder or?

just give som examples of:
1. what would the input look like. My guess is - theMaxFileName
2. what do you mean by: i want to export 6 object defined names which i want to export to specified folder

do you mean that you have 6object in your scene that you want to export all of them to a separate folder but with the same filename?
/object1/maxfileName.obj
/object2/maxfileName.obj
/object3/maxfileName.obj
/object4/maxfileName.obj

3. What fileformat do you want to export to?

OgmaSoul3D
Anton Berg
anton[at]os3d.se

OgmaSoul3D
Anton Berg
anton[at]os3d.se

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.