Explicitly also check for endFrame + PEP08 and cosmetics

This commit is contained in:
Roy Nieterau 2018-12-08 19:39:27 +01:00
parent 7a39b50469
commit 8c09ada8cb

View file

@ -15,8 +15,8 @@ class CollectInstances(pyblish.api.ContextPlugin):
id (str): "pyblish.avalon.instance id (str): "pyblish.avalon.instance
Specific node: Specific node:
The specific node is important because it dictates in which way the subset The specific node is important because it dictates in which way the
is being exported. subset is being exported.
alembic: will export Alembic file which supports cascading attributes alembic: will export Alembic file which supports cascading attributes
like 'cbId' and 'path' like 'cbId' and 'path'
@ -53,11 +53,9 @@ class CollectInstances(pyblish.api.ContextPlugin):
data.update(self.get_frame_data(node)) data.update(self.get_frame_data(node))
# Create nice name # Create nice name if the instance has a frame range.
# All nodes in the Outputs graph have the 'Valid Frame Range'
# attribute, we check here if any frames are set
label = data.get("name", node.name()) label = data.get("name", node.name())
if "startFrame" in data: if "startFrame" in data and "endFrame" in data:
frames = "[{startFrame} - {endFrame}]".format(**data) frames = "[{startFrame} - {endFrame}]".format(**data)
label = "{} {}".format(label, frames) label = "{} {}".format(label, frames)