Changed targets for family, changed to instance plugin, added safety to run only onces

This commit is contained in:
aardschok 2018-02-21 14:36:04 +01:00
parent 5e4ed0a9e4
commit dcf1de53dc

View file

@ -1,7 +1,7 @@
import pyblish.api
class ExtractImageSequence(pyblish.api.Extractor):
class ExtractImageSequence(pyblish.api.InstancePlugin):
"""Extract result of saver by starting a comp render
This will run the local render of Fusion.
@ -11,9 +11,18 @@ class ExtractImageSequence(pyblish.api.Extractor):
order = pyblish.api.ExtractorOrder
label = "Render Local"
hosts = ["fusion"]
targets = ["renderlocal"]
families = ["colorbleed.saver.renderlocal"]
def process(self, context):
def process(self, instance):
# This should be a ContextPlugin, but this is a workaround
# for a bug in pyblish to run once for a family: issue #250
context = instance.context
key = "__hasRun{}".format(self.__class__.__name__)
if context.data.get(key, False):
return
else:
context.data[key] = True
current_comp = context.data["currentComp"]
start_frame = current_comp.GetAttrs("COMPN_RenderStart")