Documentation - Maxscript
Documentation about the maxscript commands of SmartRefs.
You can use the maxscript interface smartrefs to access several commands and properties of the SmartRefs plugin, having the following commands:
Methods
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.
Prompts the Add SmartRef Dialog Box.
Returns the total number of top-level SmartRefs in the scene.
Returns the SmartRef corresponding to the indexed SmartRef in the SmartRefs dialog.
Returns an array with all the SmartRefs in the scene.
Removes all the SmartRefs in the scene.
Reloads the SmartRefs specified in the index array.
Removes the SmartRefs specified in the index array and all of their objects from the scene.
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.
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.
Merges the SmartRefs specified in the index array. That means all the nodes of the references become normal nodes and are not referenced anymore.
Available in 1.01.00 and higher.
Executes the advanced reset with the data provided.
selection: Can use one of the following values:
1 - Reset Selected References.
2 - Reset Selected Nodes.
category: Specify with a bitArray the categories to be reset :
1 - Geometry.
2 - Shapes.
3 - Lights.
4 - Cameras.
5 - Helpers.
6 - Space Warps.
7 - Particle Systems.
8 - Bone Objects.
parameters: Specify with a bitArray the parameters to be reset :
1 - Base Object.
2 - Modifiers.
3 - Transform.
4 - Material.
5 - Object Properties.
6 - Parenting.
7 - Name.
8 - Layer.
9 - Deleted Nodes.
references: Specify with an array of indices the references to be reset (selection and nodes parameters will be ignored)
nodes: Specify with an array of nodes the nodes to be reset (selection parameter will be ignored)
smartrefs.advancedReset selection:1 categories:#{3,4} parameters:#{1,3,6}
In the example above the base object, transform and parenting overrides of the lights and cameras of the selected references will be reset.
Opens the SmartRefs manager dialog box.
Closes the SmartRefs manager dialog box.
Returns true if the SmartRefs manager dialog box is open, returns false otherwise.
Properties
If true everytime a file with nodes with duplicated names is referenced a warning message will be prompted.
If true all the references will be saved as merged everytime the master scene is saved.
Methods by individual SmartRef
Use the method smartrefs.getSmartRef to get the individual reference in order to use the following methods and properties.
Reloads the SmartRef.
Unloads the SmartRef and all of its objects.
Merges the SmartRef. That means all the nodes of the reference become normal nodes and are not referenced anymore.
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.
The same as reset, but in this case the reference is not reloaded, it's just unloaded.
Available in 1.01.00 and higher.
Overwrites the SmartRef. That means the reference with all the modifications made in the master scene is saved over the source file of the reference.
Available in 1.01.00 and higher.
Saves the SmartRef with the specified filename. The reference with all the modifications made in the master scene is saved in the specified file name.
Returns an array with all the nodes loaded by this reference.
Displays the duplicated names dialog box if the reference has duplicated names.
Properties by individual SmartRef
If false the reference won't be loaded in the scene.
The file name of the SmartRef. If this property is changed the reference will be reloaded with the specified file.
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.
If true the proxy file will be loaded instead of the main file in the viewport.
If true the proxy file will be loaded instead of the main file at render time.
If true all the names of the referenced nodes, materials and layers will have the name of the reference as prefix.
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.
With this property you can select how the reference is reloaded at Scene Load. This takes effect only if persistRef is on. It can be one of the following values:
0 - Reload Always
1 - Reload if file has changed
2 - Reload Manually
If true the reference wont load when nested.