Share

Interface: DwfExportPreferences

The DwfExportPreferences Core Interface exposes the settings of the DWF Export Dialog to MAXScript.

Available in 3ds Max 2014 and higher.

Interface: DwfExportPreferences

Properties:

.groupBy : enum : Read|Write 
groupBy enums: {#ByObject|#ByLayer}

Get/set the state of the "Grouping Options" radio buttons.

You can either use the enums or 0-based integers.

Possible values are:

0 - #ByObject - Group By Object

1 - #ByLayer - Group By Layer

.exportProperties : boolean : Read|Write

Get/set the state of the "Publish Object Properties" checkbox.

Default is True.

.exportMaterials : boolean : Read|Write

Get/set the state of the "Publish Materials" checkbox.

Default is True.

.selectedOnly : boolean : Read|Write

Get/set the state of the "Publish Selected Objects Only" checkbox.

Default is False.

.exportHidden : boolean : Read|Write

Get/set the state of the "Publish Hidden Objects" checkbox.

Default is False.

.showViewer : boolean : Read|Write

Get/set the state of the "Show DWF In Viewer" checkbox.

Default is False.

.rescaleTextures : boolean : Read|Write

Get/set the state of the "Rescale Bitmaps" checkbox.

Default is True.

.maxTextureSize : integer : Read|Write

Get/set the value of the "Max.Resolution (pixels)" spinner used when DwfExportPreferences.rescaleTextures is set to True.

Default value is 512.

.defaultDwfLights : boolean : Read|Write

Get/set the state of the "Use Default DWF Lights" checkbox.

Default is True.

.writeLogFile : boolean : Read|Write

Get/set the state of the "Save Log File" checkbox.

Default is False.

.logFileName : filename : Read|Write

Get/set the file name of the log file used when DwfExportPreferences.writeLogFile is set to True.

Default value is "C:\Users\\AppData\Local\Autodesk\3dsMax\ - 64bit\ENU\en-US\plugcfg\DWF_export.log" where <UserName> is the name of the user and <MaxVersion> is the 3ds Max version number, for example, "2014".

Methods:

<void>ResetDefaultPreferences()

Resets all parameters to the default settings.

<void>SavePreferences()

Saves the current settings as preferences.

The saved settings can be recalled at a later point by calling the following method:

<boolean>LoadPreferences()

Restores the previously saved settings.

EXAMPLE

   --Reset to defaults, then print them to Listener:
   DwfExportPreferences.ResetDefaultPreferences() 
   for p in getPropNames DwfExportPreferences do 
     format "%=%\n" p (getProperty DwfExportPreferences p)

OUTPUT

   OK
   #writeLogFile=false
   #exportMaterials=true
   #selectedOnly=false
   #showViewer=false
   #rescaleTextures=true
   #defaultDwfLights=true
   #exportHidden=false
   #LogFilename=C:\Users\MyUserName\AppData\Local\Autodesk\3dsMax\2014 - 64bit\ENU\en-US\plugcfg\DWF_export.log
   #groupBy=#ByObject
   #maxTextureSize=512
   #exportProperties=true
   OK

EXAMPLE

   --Let's change a few settings - Export Hidden to True and Group By to #ByLayer:
   DwfExportPreferences.exportHidden=true
   DwfExportPreferences.groupBy=#ByLayer
   --Now let's store these settings for future use and print the current values:
   DwfExportPreferences.SavePreferences()
   for p in getPropNames DwfExportPreferences do 
     format "%=%\n" p (getProperty DwfExportPreferences p)

OUTPUT

   true
   #ByLayer
   OK
   #writeLogFile=false
   #exportMaterials=true
   #selectedOnly=false
   #showViewer=false
   #rescaleTextures=true
   #defaultDwfLights=true
   #exportHidden=true
   #LogFilename=C:\Users\MyUserName\AppData\Local\Autodesk\3dsMax\2014 - 64bit\ENU\en-US\plugcfg\DWF_export.log
   #groupBy=#ByLayer
   #maxTextureSize=512
   #exportProperties=true
   OK

EXAMPLE

   --let's reset the settings to defaults - as expected, we will get the original values
   DwfExportPreferences.ResetDefaultPreferences()  
   for p in getPropNames DwfExportPreferences do 
     format "%=%\n" p (getProperty DwfExportPreferences p)

OUTPUT

   OK
   #writeLogFile=false
   #exportMaterials=true
   #selectedOnly=false
   #showViewer=false
   #rescaleTextures=true
   #defaultDwfLights=true
   #exportHidden=false
   #LogFilename=C:\Users\MyUserName\AppData\Local\Autodesk\3dsMax\2014 - 64bit\ENU\en-US\plugcfg\DWF_export.log
   #groupBy=#ByObject
   #maxTextureSize=512
   #exportProperties=true
   OK

EXAMPLE

   --Let's load the previously saved settings - 
   --the #exportHidden will be back to True and #groupBy will be back to #ByLayer!
   DwfExportPreferences.LoadPreferences()
   for p in getPropNames DwfExportPreferences do 
     format "%=%\n" p (getProperty DwfExportPreferences p)

OUTPUT

   true
   #writeLogFile=false
   #exportMaterials=true
   #selectedOnly=false
   #showViewer=false
   #rescaleTextures=true
   #defaultDwfLights=true
   #exportHidden=true
   #LogFilename=C:\Users\MyUserName\AppData\Local\Autodesk\3dsMax\2014 - 64bit\ENU\en-US\plugcfg\DWF_export.log
   #groupBy=#ByLayer
   #maxTextureSize=512
   #exportProperties=true
   OK

EXAMPLE

   --To export using these settings without showing the Dialog, simply call
   exportMaxFile (GetDir #export + "\\someFile.dwf") #noPrompt

Was this information helpful?