Documentation - Maxscript

Documentation about the maxscript commands of SmartRefs.


Methods

smartrefs.addSmartRef <filename_string> [proxyFileName:<string>] [load:<boolean>] [active:<boolean>] [proxyViewport:<boolean>] [proxyRender:<boolean>]

Adds a new SmartRef to the scene with the specified file name, the SmartRef is returned as value. If load:<string> is specified as false, the reference is not loaded until the user request it. Use the reload() method to load the reference.

smartrefs.numSmartRefs()

Returns the total number of top-level SmartRefs in the scene.

smartrefs.getSmartRef <index>

Returns the SmartRef corresponding to the indexed SmartRef in the SmartRefs dialog.

smartrefs.getAllSmartRefs()

Returns an array with all the SmartRefs in the scene.

smartrefs.removeAllSmartRefs()

Removes all the SmartRefs in the scene.

smartrefs.reloadSmartRefs <index array>

Reloads the SmartRefs specified in the index array.

smartrefs.removeSmartRefs <index array>

Removes the SmartRefs specified in the index array and all of their objects from the scene.

smartrefs.resetSmartRefs <index array>

Resets the SmartRefs specified in the index array. That means all the modifications made to the objects of those references in the master scene are dismissed and the references are reloaded.

smartrefs.duplicateSmartRefs <index array>

Duplicates the SmartRefs specified in the index array, all the modifications made in the objects of the references will be preserved. If several references are going to be duplicated it's better to do so at the same time with only one call to this function, so that connections between the objects of different references can be preserved.

smartrefs.mergeSmartRefs <index array>

Merges the SmartRefs specified in the index array. That means all the nodes of the references become normal nodes and are not referenced anymore.

smartrefs.openManager()

Opens the SmartRefs manager dialog box.

smartrefs.closeManager()

Closes the SmartRefs manager dialog box.

smartrefs.isManagerOpen()

Returns true if the SmartRefs manager dialog box is open, returns false otherwise.


Properties

<smartref>.showDuplicatedNamesWarnings Boolean default: true

If true everytime a file with nodes with duplicated names is referenced a warning message will be prompted.

<smartref>.saveSmartRefsAsMerged Boolean default: false

If true all the references will be saved as merged everytime the master scene is saved.


Methods by individual SmartRef

<smartref>.reload()

Reloads the SmartRef.

<smartref>.unload()

Unloads the SmartRef and all of its objects.

<smartref>.merge()

Merges the SmartRef. That means all the nodes of the reference become normal nodes and are not referenced anymore.

<smartref>.reset()

Resets the SmartRef. That means all the modifications made to the objects of that reference in the master scene are dismissed and the reference is reloaded.

<smartref>.dismiss()

The same as reset, but in this case the reference is not reloaded, it's just unloaded.


Properties by individual SmartRef

<smartref>.active Boolean default: true

If false the reference won't be loaded in the scene.

<smartref>.fileName Filename

The file name of the SmartRef. If this property is changed the reference will be reloaded with the specified file.

<smartref>.proxyFileName Filename

The file name of the proxy of the SmartRef. If this property is changed and useProxyInViewport is on the reference will be reloaded with the specified file.

<smartref>.useProxyInViewport Boolean default: false

If true the proxy file will be loaded instead of the main file in the viewport.

<smartref>.useProxyInRender Boolean default: false

If true the proxy file will be loaded instead of the main file at render time.

<smartref>.useNamePrefix Boolean default: false

If true all the names of the referenced nodes, materials and layers will have the name of the reference as prefix.

<smartref>.persistRef Boolean default: false

If true the reference will be persisted in the scene. That means all the data of the current loaded nodes will be saved in the scene, and the references will load the next time the master scene is loaded even if the referenced file is not present. This makes the master scene bigger and slower to save.

<smartref>.reloadIfChanged Boolean default: false

If true the reference will reload when the master scene is loaded only if the reference file has changed. This takes effect only if persistRef is on.

<smartref>.overlay Boolean default: false

If true the reference wont load when nested.