View Full Version : Export with mesh name
designingpatrick 07-06-2010, 05:47 PM Is there a way to tell Max that the name of an exported file should default to the mesh's given name in the scene? There by saving the step of needing to specify a name on export- every single time!!!
|
|
ecarter
07-07-2010, 05:26 AM
Is there a way to tell Max that the name of an exported file should default to the mesh's given name in the scene? There by saving the step of needing to specify a name on export- every single time!!!
yep, i do that, is really usefull
try this
exportFile obj.name
or something like this, if you want to give the path to export
filetoexport = (path.text + "\\" + obj.name)
exportFile filetoexport
path.txt could be a dropdownlist or text input
designingpatrick
07-07-2010, 07:02 AM
Wow! Thanks.
designingpatrick
07-14-2010, 06:46 AM
I tried it out, but must be doing something wrong: "Unkown property: "name" in undefined"
Of course I tried entering the name of the object instead of "name" I used "midInset_mesh" or what have you.
zortech
07-14-2010, 10:22 AM
The error occured as the object has not been assigned to the variable "obj". With ".name" you access the name property of the object. Here's an example which however will only run if 1 object is selected. If you only want to export geometry, you should check the selection for that as well.
if selection.count == 1 do (
nNode = selection[1]
iType = 16 -- obj filetype
pDir = "C:\\EXPORT\\"
aClasses = exporterPlugin.classes
exportFile (pDir + nNode.name ) using:aClasses[iType]
)
Exporter classes (from maxR8), set by iType
3D_StudioExporterPlugin
Adobe_Illustrator
DWG_ExportExporterPlugin
DWG_Export
Wavefront_MaterialExporterPlugin
Lightscape_Layers
STL_Export
Lightscape_Material
FBXEXP
Lightscape_Preparation
IGES_Export
Lightscape_Parameter
Lightscape_Blocks
SW3D_Exp
nif_export_class
Wavefront_ObjectExporterPlugin
Lightscape_View
ExportHTR
JSR184Exporter
AsciiExp
VRBL_Export
DWF_Exporter
ecarter
07-14-2010, 04:26 PM
I tried it out, but must be doing something wrong: "Unkown property: "name" in undefined"
Of course I tried entering the name of the object instead of "name" I used "midInset_mesh" or what have you.
i work with the object name and the extension, like this
box.fbx
so
filetoexport = (path.text + "\\" + obj.name) -- obj.name need to have the extension
exportFile filetoexport
CGTalk Moderation
07-14-2010, 04:26 PM
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-2013, Jelsoft Enterprises Ltd.