Allows you to remove empty, invalid, or unused parts from the scene to reduce its size and complexity. You can perform a complete scene clean up, or you can choose to run individual optimizations.
Select File > Optimize Scene Size > and turn on or off the types of information to remove, or run individual types of optimizations.
A progress bar displays as Maya optimizes the scene. You can interrupt the operation by pressing . You get a report of all the results of the optimization in the Script Editor.
The following information explains the cleanup operations performed by the various options in the Optimize Scene Size Options window.
Deletes source animation clip and animation clip nodes that are not being used in the scene. An animation clip is considered unused when it is not associated with a character set in your scene, and when it is not connected to any other scene nodes. A source clip node is considered unused when there are no used animation clips in the scene linked to that source clip.
Deletes NURBS surfaces that are identical to their respective input NURBS surfaces. When a NURBS surface’s only input connection is to create, when the surface is input connected to another NURBS surface with the same parent, and when the surface is the same shape as its input, this operation will remove the NURBS surface. For example, if you rebuilt a NURBS sphere, but the settings of the rebuilt surface were identical to the original input surface, the rebuilt sphere would be deleted.
Note that in order for this operation to remove a NURBS surface, the surface cannot be locked, or from a referenced file.
Deletes all expression nodes which have no direct connections to their output attributes. An expression with a direct connection creates a relationship between an output attribute and input attribute in the scene. In other words, an expression that is part of a connected group of nodes not linked to the rest of the scene will be deleted, because the expression does not reference output attributes associated with the scene. Unit nodes with nothing on the other side are not evaluated, and therefore, are not deleted by this operation.
This operation only deletes expression nodes, and not dynExpressions, which are built into particle shapes.
Deletes all unused Rendering nodes. This procedure progresses through three stages:
Deletes empty shading groups, as well as shading groups that have no connected surface, volume, or displacement shaders.
Deletes all material nodes (surface, volume, displacement shaders) whose outputs are not connected to anything. Output connections from message attributes do not indicate that the node is in use, so nodes with only this type of output connection will be deleted. Note that this stage will delete shaders that were feeding into empty shading groups. Stage 1 deleted the shadingEngine node for empty shading groups, which leaves the materials that were feeding into empty shading groups disconnected. These disconnected materials will now be deleted.
Deletes all unused texture and utility nodes. Nodes are unused if they have no relevant output connections. Note that the textures and utilities feeding into the deleted materials from stage 2 will now be deleted.
Deletes locator objects that do not have connections to their shapes or to their transform nodes. If the locator has a parent with connections, or if the locator has a parent node with more than one child, the locator will not be deleted. Only locators that are not locked and not from referenced files will be removed by this procedure.
Deletes constraints that are not constraining any objects. In other words, this procedure removes constraints that are not driving anything, and that do not have any output connections. In order for a constraint to be deleted by this procedure, the constraint cannot be from a referenced file, and it cannot be locked.
Specifically, this procedure evaluates the following nodes in your scene to determine whether or not they should be removed:
Compares each shading network to the other shading networks in the scene, and collapses duplicate shading networks into one. Duplicate shading networks will be deleted in alphabetical order, based on shadingEngine node name. To collapse all duplicate networks into a particular network, rename that network so that it is last in the alphabetical ordering of shading networks in the scene.
Customizing the Optimize Scene Size Operation
You can edit the MEL script invoked by the Optimize Scene Size command to add your own cleanup operations to the Optimize Scene Size Options. The script is called cleanUpScene.mel, and you can find it in the /scripts/startup directory of Maya.
When you open the script, you will notice that there is a set functions defined near the end of the script to help you add and manage your own scene cleanup operations. These functions are as follows:
Viewing attributes of user-defined cleanup operations
Returns the name of the checkBox control group in the Optimize Scene Size Options dialog that is associated with the specified user cleanup operation. The state of this checkbox and the corresponding option variable (see userCleanUp_GetOptionVarName()) are synchronized when that dialog is created or destroyed.