Go to: Synopsis. Return value. Keywords. Related. Flags. Python examples.
bakePartialHistory([allShapes=boolean], [postSmooth=boolean], [preCache=boolean], [preDeformers=boolean], [prePostDeformers=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
bakePartialHistory is undoable, queryable, and editable.
This command is used to bake sections of the construction history of a shape node when possible. A typical usage would be on a shape that has both modelling operations and deformers in its history. Using this command with the -prePostDeformers flag will bake the modeling portions of the graph, so that only the deformers remain.Note that not all modeling operations can be baked such that they create exactly the same effect after baking. For example, imagine the history contains a skinning operation followed by a smooth. Before baking, the smooth operation is performed each time the skin deforms, so it will smooth differently depending on the output of the skin. When the smooth operation is baked into the skinning, the skin will be reweighted based on the smooth points to attempt to approximate the original behavior. However, the skin node does not perform the smooth operation, it merely performs skinning with the newly calculated weights and the result will not be identical to before the bake.
In general, modeling operations that occur before deformers can be baked precisely. Those which occur after can only be approximated. The -pre and -post flags allow you to control whether only the operations before or after the deformers are baked.
When the command is used on an object with no deformers, the entire history will be deleted.
| string | name of shapes that were baked |
In query mode, return type is based on queried flag.
| Long name (short name) | Argument types | Properties | ||
|---|---|---|---|---|
allShapes(all)
|
boolean
|
|
||
|
||||
postSmooth(nps)
|
boolean
|
|
||
|
||||
preCache(pc)
|
boolean
|
|
||
|
||||
preDeformers(pre)
|
boolean
|
|
||
|
||||
prePostDeformers(ppt)
|
boolean
|
|
||
|
||||
import maya.cmds as cmds # create a cylinder with history to use as an example # cyl = cmds.polyCylinder() cmds.polySmooth() cmds.cluster() cmds.select( cyl[0],r=True ) cmds.polyTriangulate() # query what will be baked # cmds.bakePartialHistory( cyl[0],query=True,prePostDeformers=True ) # perform the bake, baking history from before and after the # deformer # cmds.bakePartialHistory( cyl[0],prePostDeformers=True ) # Bake the history before the geometry cache on the cylinder. # To actually demo, add a geometry cache before executing the command # below. # cmds.select( cyl[0],r=True ) cmds.bakePartialHistory( cyl[0],preCache=True )