Module for precomp import related functionality.
[Graph ]
|
precompImport(filePathOrPrecompModule,
destinationPath,
passDestinationPath="",
layerDestinationPath="",
multiStream=True,
singleCompImport=False,
singleCompTemplateFilePath="",
missingImageCb=None,
missingTemplateCb=None,
useDefaultTemplate=True,
compUpdateCb=None)
Precomp import from either a PrecompModule instance or from a file path. |
|
|
PrecompModule
|
|
[Graph ]
|
importScene(scene,
destinationPath,
multiStream=True,
singleCompImport=False,
singleCompTemplateFilePath="",
passDestinationPath="",
layerDestinationPath="",
missingImageCb=None,
missingTemplateCb=None,
useDefaultTemplate=True,
compUpdateCb=None)
Creates or updates the compositions associated with each set of
render cameras selected for import in the given scene. |
|
|
tuple of Graph and
bool
|
importRenderCameras(cameras,
destinationPath,
multiStream=True,
singleCompImport=False,
singleCompTemplateFilePath="",
passDestinationPath="",
layerDestinationPath="",
missingImageCb=None,
missingTemplateCb=None,
useDefaultTemplate=True,
compUpdateCb=None)
Creates or updates the composition associated with the given set of
render camera views (RenderCamera instances). |
|
|
tuple of Graph and
bool
|
importRenderLayers(layers,
destinationPath,
multiStream=True,
passDestinationPath="",
missingImageCb=None,
missingTemplateCb=None,
useDefaultTemplate=True,
compUpdateCb=None)
Creates or updates the composition associated with the given render
layers (RenderLayer instances). |
|
|
tuple of Graph and
bool
|
importRenderPasses(passes,
destinationPath,
missingImageCb=None,
compUpdateCb=None)
Creates or updates the composition associated with the given render
passes. |
|
|
str
|
|
tuple
|
|
tuple
|
getPrecompAnchors(node,
precompClasses)
Returns:
A tuple of precomp anchors on the given node for the
specified list of precomp object classes. |
|
|
|
setPrecompAnchor(node,
precompClass,
anchor)
Sets the precomp anchor on the given node for the specified precomp
class, overwriting the previous one if it existed. |
|
|
|
setPrecompAnchorFromObject(node,
precompObject)
Sets the precomp anchor on the given node for the specified precomp
object, overwriting the previous one if it existed. |
|
|
|
removePrecompAnchors(node,
precompClass)
Removes all precomp anchors for the specified precomp object type
from the given node. |
|
|
|
removeAllPrecompAnchors(node,
exclude=[])
Removes all precomp anchors of any type (pass, layer, camera, etc)
from the given node. |
|
|
bool
|
hasPrecompAnchor(node)
Returns:
True if the given node has any precomp anchor set on it. |
|
|
tuple
|
|
|
setLinkNodeOutputPrecompAnchors(linkNode)
This function sets the same anchors on the link node's output
boundary nodes as the ones found on their respective linked output. |
|
|
dict
|
findPrecompLinkNodes(compOrVersion,
precompClasses,
onlyAtTopLevel=False)
Finds all precomp link nodes for the specified precomp object class
in the given Graph or Composition . |
|
|
|
refreshPrecompLinkNodes(anchorsToLinkNodes)
Forces a refresh of the given precomp link nodes. |
|
|
|
findAndRefreshPrecompLinkNodes(compOrVersion,
precompClasses)
Forces a refresh of all precomp link nodes for the specified precomp
object class in the given Graph or Composition . |
|
|
LinkNode
|
initPrecompLinkNode(linkNode,
precompClassesAndAnchors,
nodeName=None)
Takes a link node and makes it a precomp link node based on the given
precomp anchors. |
|
|
LinkNode
|
createPrecompLinkNode(compOrVersionOrGroup,
precompClassesAndAnchors,
nodeName=None)
Adds a link node to the given composition/version/group and sets its
precomp information according to the initPrecompLinkNode() function. |
|
|
|
resetPrecompLinkNode(linkNode,
precompClassesAndAnchors,
nodeName=None,
preserveOutputAnchors=True,
preserveCameraAnchor=True)
Takes an existing precomp link node and resets it based on the given
given precomp anchors. |
|
|
LinkNode
|
|
bool
|
|
tuple
|
analysePrecompGraph(comp,
precompLinkClasses)
Splits the top level nodes of the given Graph or Composition, into
three categories and returns a tuple . |
|
|
Composition
|
instantiatePrecompTemplate(templatePath,
compPath,
multiStream,
backupVersion,
precompObjects,
precompLinkClasses,
cameras=[])
Creates a new precomp composition based on the specified precomp
template composition templatePath. |
|
|
|
createPrecompOutputNodes(compVersion,
cameras)
For each of the given RenderCamera instances, this function creates an
output node in the given composition with the camera anchor set on
it. |
|
|
tuple
|
processPrecompLinkNodes(compVersion,
precompLinkClasses,
anchorsToPrecompObjects,
anchorsToLinkedCompVersion,
anchorsToLinkNodes,
rebuildLinkNodes=False)
Adds missing precomp link nodes and rebuilds the existing ones in the
given composition version compVersion. |
|
|
|
stackRenderLayers(cameraCompVersion,
layerAnchorToLinkNodes,
layerAnchorToLayers,
cameraAnchorToCamera,
multiStream=True,
stackGroupNodeName=None)
Stacks the render layers in a chain of Blend&Comp nodes according
to the render layers compositing order and blend mode. |
|
|
tuple
|
cleanupPrecompTemplate(comp,
precompLinkClasses)
Cleans up the given template composition 'comp' to prepare it for
instantiation. |
|
|
|
cleanupPrecompLinkNodes(anchorsToLinkNodes,
precompLinkClasses,
preserveCameraAnchors=True)
Cleans up the the given precomp link nodes to prepare the ground for
their update. |
|
|
|
|
dict
|
getLayerStackInfo(compPath)
Gets the information about the stack of render layers from the
precomp settings of the camera composition. |
|
|
|
setLayerStackInfo(compPath,
layerSets)
Sets the information about the stack of render layers in the camera
composition precomp setting. |
|
|
|
updateLayerStackInfo(compPath,
layerSets)
Updates the information about the stack of render layers in the
camera composition precomp setting. |
|
|
bool
|
hasLayerStackInfo(compPath)
Returns:
True if the composition has precomp settings that store
information about a stack of render layers. |
|
|
dict
|
getPassLinksInfo(compPath)
Gets the information about links to render passes in the composition
precomp settings. |
|
|
|
setPassLinksInfo(compPath,
passSets)
Sets the information about the imported passes in the composition
precomp settings. |
|
|
|
updatePassLinksInfo(compPath,
passSets)
Updates the information about the imported passes in the composition
precomp settings. |
|
|
bool
|
hasPassLinksInfo(compPath)
Returns:
True if the composition has precomp settings that store
information about links to render passes. |
|
|
dict
|
getPassInfo(compPath)
Gets the information about the passes in the render pass composition
precomp setting. |
|
|
|
setPassInfo(compPath,
passes)
Sets the information about the imported passes in the render pass
composition precomp setting. |
|
|
|
writePrecompInfo(compPath,
settingKey,
infos)
Writes the given (*)Info instances to the composition precomp
setting. |
|
|
set
|
|
|
|
tuple
|
|
|
setRate(compOrVersion,
scene)
Sets the rate of the given composition/version based on the rate of
the 3D scene. |
|
|
|
setStartEnd(compOrVersion,
start,
end,
outputName=None)
Sets the start/end of the given composition/version output. |
|
|
|
setFormat(compOrVersion,
precompObject,
outputName=None)
Sets the image format and pixel format of the given
composition/version based on the format of the given PrecompObject
derived instance (Scene, RenderLayer or RenderPass). |
|
|
str
|
getPrecompTemplatePath(path,
precompObject,
missingTemplateCb=None,
useDefaultTemplate=True)
Checks whether the given template file path exists. |
|
|
str
|
|
|
|
tuple
|
getPrecompCompositionPath(destinationPath,
compName,
compUpdateCb,
precompClass)
Determines the precomp composition path, handling the update mode if
needed or throwing a RuntimeError if the conflict cannot be resolved. |
|
|
callable
|
wrapCompUpdateCb(compUpdateCb)
Wraps the compUpdateCb parameter to provide the default
behavior when the parameter is not callable. |
|
|
str
|
sanitizeName(name)
Replaces invalid characters from the given name with Composite's
default replacement character ('_'). |
|
|
|
|
str
|
|
|
setTraceCallback(traceCb)
Sets a callback invoked by the functions in this module to provide
information about what it's doing. |
|
|
|
setWarningCallback(warningCb)
Sets a callback invoked by the functions in this module to show a
warning. |
|
|
bool
|
|
str
|
getProjectRelativePath(path)
Returns:
A path (str ) relative to the current project root folder
or the path itself if it's not under the project root. |
|
|
tuple
|
getRenderCameraAnchor(obj)
Functor to get the render camera anchor of a Composite node or of a
precomp object. |
|
|
tuple
|
getSchematicPosition(node)
Returns:
The position of a node in the schematic as an (x, y)
float tuple . |
|
|
|
|