PDA

View Full Version : Exporting file whose the filename is the mesh's name


MagicToy
02-03-2006, 01:18 AM
Hi there.

I would like to export some meshes automatically, and it would be nice to pass the mesh's name as the name for the exported file...

Suppose I have a mesh called "YellowCar" (it is a editable mesh). Would anyone know, for example, how to export the mesh as a "YellowCar.3ds" using MaxScript?

Any help would be very appreciated.

Thanks in advance

Note: I don't want to create a new exporter... I just want to use an exporter from 3dsmax (.3ds, .dxf, .ase, etc...).

mobeen
02-03-2006, 04:32 AM
Assuming that the mesh is already selected use

exportFile ($.name+".3ds") #noprompt

Have a look at the docs fo its details.
[edited]
One more thing, by default if you don't specify the path, the file will be exported to the meshes folder.

Hope it helps
Mobeen

MagicToy
02-03-2006, 03:37 PM
Assuming that the mesh is already selected use

exportFile ($.name+".3ds") #noprompt

Have a look at the docs fo its details.
[edited]
One more thing, by default if you don't specify the path, the file will be exported to the meshes folder.

Hope it helps
Mobeen

Thanks mobeen!
Actually, I'm exporting meshes as .x files (with Panda plugin). The script works fine... The only little problem is that, when I have a texture mapped on the mesh, the .x file is exported to the correct folder, but the texture always is exported to the folder where is the .max file (independently on the specification of the file path).
Thanks again.

vScourge
02-05-2006, 12:53 AM
Sounds like a bug or "feature" in the Panda exporter. You could follow that export command with a copyFile then a deleteFile to relocate the texture. Something like this:

myDir = "C:\\exportFiles\\"
exportFile (myDir + $.name+".x") #noprompt
copyFile (maxFilePath + $.name + ".tga") (myDir + $.name + ".tga")
deleteFile (maxFilePath + $.name + ".tga")

... or something along those lines. Swapping ".tga" with whatever texture extension the Panda exporter uses.

CGTalk Moderation
02-05-2006, 12:53 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.