Share

Interface: SceneConverter

This Core Interface exposes properties and methods for setting up the scene converter system and its rules. Available in in 3ds Max 2017 and higher.

Properties:

SceneConverter.visible : boolean : Read|Write

Get/set the visible state of the Scene Converter dialog.

Setting the property to True will open the dialog, setting it to False will close it.

Getting the property will indicate whether the dialog is open (True) or closed (False).

See also the Scene_Converter: GlobalUtilityPlugin class and its Actions MixinInterface which exposes a .show() method that can be used to open the dialog.

SceneConverter.OpenWhenNeededOnFileOpen : boolean : Read|Write

Get/set the state of the "Open Scene Converter on file open when missing plugins" checkbox.

When set to False (default), the Scene Converter will not be opened automatically when loading a scene with missing plugins.

When set to True, the Scene Converter will be opened automatically if missing plugins are detected.

SceneConverter.BackupOriginalFiles : boolean : Read|Write

Get/set whether to back up the original files before performing a conversion.

When set to True, a backup copy with the suffix "_backup" will be created.

SceneConverter.ConvertOnlySelectedObjects : boolean : Read|Write

Get/set the state of the "Apply only to selected objects" checkbox.

When set to False (default), the conversion will be applied to the whole scene.

When set to True, the conversion will only be applied to the selected objects.

SceneConverter.ApplyOnlySelectedRules : boolean : Read|Write

Get/set whether to apply all rules (False) or only the selected rules (True). The selected rules are the rules selected in the Scene Converter dialog, which requires the user to use the UI.

Default is False.

SceneConverter.FilterConversionTypesFromScene : boolean : Read|Write

Get/set the state of the "Only display types in the current scene" checkbox.

When set to False (default), all object types that can be converted will be listed in the Source list of the dialog.

When set to True, only the object types found in the current scene that can be converted will be listed in the Source list of the dialog.

SceneConverter.ScriptFolder : string : Read|Write

Get/set the Scene Converter Script Folder.

Default is "C:\Users\%USERNAME%\AppData\Local\Autodesk\3dsMax\[Max Version]\[Language]\Scene Converter".

This folder has two sub-folders:

"\ConversionScripts" containing the MAXScript files describing the conversion rules for individual object types,and

"\ConversionPresets" containing the MAXScript files describing the conversion presets for one renderer to another.

SceneConverter.BatchMode : enum : Read|Write

BatchMode enums: {#XRefs|#File|#Folder}

Get/set the state of the "Batch Conversions" radio buttons under the "Options" tab of the dialog.

Possible values are:

  • 0 - #XRefs (default) – "Convert Reference Files" mode, will convert all external references of the scene.
  • 1 - #File – "Convert File" mode, will convert the specified file.
  • 2 - #Folder – "Convert Folder" mode, will convert the scene files in the specified folder.

The integers 0, 1 and 2 can be used in place of the enums, but getting the property will always return the enum names.

sceneconverter.AutoRemoveMissingLegacyAssets : boolean : Read|Write

Available in 3ds Max 2018.4 and higher: Gets or sets the state of the "Automatically remove missing legacy assets on file open" checkbox in the Scene Converter dialog. Note: Setting this to true will remove all missing legacy assets each time a file is opened or merged without the Scene Converter dialog appearing.

Methods:

<integer>SceneConverter.ConvertScene()

Equivalent to pressing the "Convert Scene" button in the dialog.

Performs the conversion of the current scene according to the set rules.

<void>SceneConverter.CancelConversion()

Equivalent to pressing the "Cancel" button in the dialog.

Cancels an ongoing scene conversion process.

Applies to all possible conversion processes, including current scene, other MAX file, XRefs, or Batch conversion.

<void>SceneConverter.SaveSceneMaterialLibrary <filename>LibraryFullPathFilename

Saves a .MAT Material Library with the scene materials.

The argument is the full filename and path of the Material Library.

<void>SceneConverter.OverwriteFromMaterialLibrary <filename>LibraryFullPathFilename

Replaces the scene materials and maps with material and maps with the same names from the specified .MAT Material Library.

The argument is the full filename and path of the Material Library.

<boolean>SceneConverter.ConvertAllReferencedFiles()

Performs conversion of all XRef files without converting the current scene.

Returns True on success, False on failure.

<boolean>SceneConverter.ConvertMaxFile <filename>MaxFullpathFilename

Performs conversion of the specified .MAX file.

Returns True on success, False on failure.

<boolean>SceneConverter.ConvertFolder <string>Folder

Performs conversion of the .MAX files in the specified folder and its sub-folders.

Returns True on success, False on failure.

<boolean>SceneConverter.LoadConversionPreset <filename>presetFilename

Loads the specified conversion preset.

The argument is the fully qualified file name and path of the preset script file.

Existing presets can be found by looking in the ConversionPresets subfolder of the SceneConverter.ScriptFolder folder and getting all .MS files using getFiles().

FOR EXAMPLE

thePresets = getFiles (SceneConverter.ScriptFolder + @"ConversionPresets\*.ms") --get all preset files
if thePresets.count > 0 then
  SceneConverter.LoadConversionPreset thePresets[1] --load the first preset found, if any
else
  format "--No Presets Found!\n"
<string array>GetMissingLegacyAssetsName()
      GetMissingLegacyAssetsName - no automatic redraw after invoked

Available in 3ds Max 2018.4 and higher: Returns a tab of strings, which is the list of missing assets.

Note:

This function will return missing assets for any plug-in, whether it is a legacy plug-in or not.

<void>RemoveMissingLegacyAssetsFromScene <&string array>TabString_MissingLegacyAssetsNames
       RemoveMissingLegacyAssetsFromScene - no automatic redraw after invoked
       TabString_MissingLegacyAssetsNames is In and Out parameter

Available in 3ds Max 2018.4 and higher: Takes a tab of strings, which are the missing assets to remove from the scene. Passing an empty string array will remove all the missing assets in the scene.

Note:

This function will return missing assets for any plug-in, whether it is a legacy plug-in or not.

    <boolean>AddSilentClassID <integer64 array>classIDAs2IntegersInATab
       AddSilentClassID - no automatic redraw after invoked

Adds a class ID to the Scene Converter for which you want to stop generating "missing dll" and other warning messages. This can be useful for scenes that contain a lot of missing or removed scene elements, such as those related to MentalRay.

For example, to prevent MentalRay mr Area Spot light objects from generating warnings:

SceneConverter.AddSilentClassID #(0x0001b669L, 0x000875c2L) --mental ray: mr Area Spot
Tip:

You can use SceneMissingPlugIns.GetMissingPlugInClassID on an open scene to find missing objects, for example:

for i = 1 to SceneMissingPlugIns.GetMissingPlugInCount() do
   (
       -- Get class id of plugin data
       theClassID = SceneMissingPlugIns.GetMissingPlugInClassID i
   )
    <void>ClearSilentClassIDs()
       ClearSilentClassIDs - no automatic redraw after invoked

Clears any class IDs set to be "silent" (ie not generate warnings) with AddSilentClassID().

    <boolean>IsSilentClassID <integer64 array>classIDAs2IntegersInATab
       IsSilentClassID - no automatic redraw after invoke

Returns true if the object class ID specified by classIDAs2IntegersInATab is registered as "silent" (ie not generate warnings).

The following methods expose functionality that is meant for internal use only:

<void>SceneConverter.ClearInvalidClassIDs()

For Internal use only.

<integer>SceneConverter.GetNumInvalidClassIDs <enum>classIDType

For Internal use only.

<int by value array>SceneConverter.GetInvalidClassIDs <enum>classIDType <integer>index

For Internal use only.

<boolean>SceneConverter.AddInvalidClassID <enum>classIDType <Integer64 array>classIDAs2IntegersInATab
    classIDType enums: {#eLight|#eMaterial|#eMap|#eGeometry|#eCamera|#eExposureControl|#eRenderEffect|#eRenderElement|#eOther} 
     

For Internal use only.

<boolean>SceneConverter.RemoveInvalidClassID <enum>classIDType <integer>index
    classIDType enums: {#eLight|#eMaterial|#eMap|#eGeometry|#eCamera|#eExposureControl|#eRenderEffect|#eRenderElement|#eOther}

For Internal use only.

<void>SceneConverter.AddLoadedStandinRef <maxObject>standin <string>name <integer>isMentalRay

For Internal use only.

<boolean>SceneConverter.AddConversionRule <Integer64 array>sourceClassID <Integer64 array>destinationClassID scriptID:<string> sourceAutodeskMaterialBaseType:<string> destinationAutodeskMaterialBaseType:<string>
   scriptID default value: "" 
      sourceAutodeskMaterialBaseType default value: "" 
      destinationAutodeskMaterialBaseType default value: ""

For Internal use only.

<boolean>SceneConverter.RemoveFromScene <Integer64 array>sourceClassID sourceAutodeskMaterialBaseType:<string>
   sourceAutodeskMaterialBaseType default value: ""

For Internal use only.

<boolean>SceneConverter.DoNotConvert <Integer64 array>sourceClassID sourceAutodeskMaterialBaseType:<string>
   sourceAutodeskMaterialBaseType default value: "" 
     

For Internal use only.

Actions:

Was this information helpful?