mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
Updated render_local.py to not only process the first instance
Moved the __hasRun to render_once() so the check only happens with the rendering. Currently only the first render node gets the representations added
This commit is contained in:
parent
227f1402fe
commit
de15f1bc3a
1 changed files with 10 additions and 8 deletions
|
|
@ -18,15 +18,9 @@ class Fusionlocal(pyblish.api.InstancePlugin):
|
|||
|
||||
def process(self, instance):
|
||||
|
||||
# This plug-in runs only once and thus assumes all instances
|
||||
# currently will render the same frame range
|
||||
context = instance.context
|
||||
key = f"__hasRun{self.__class__.__name__}"
|
||||
if context.data.get(key, False):
|
||||
return
|
||||
|
||||
context.data[key] = True
|
||||
|
||||
|
||||
# Start render
|
||||
self.render_once(context)
|
||||
|
||||
frame_start = context.data["frameStartHandle"]
|
||||
|
|
@ -60,6 +54,14 @@ class Fusionlocal(pyblish.api.InstancePlugin):
|
|||
|
||||
def render_once(self, context):
|
||||
"""Render context comp only once, even with more render instances"""
|
||||
|
||||
# This plug-in assumes all render nodes get rendered at the same time
|
||||
# to speed up the rendering. The check below makes sure that we only
|
||||
# execute the rendering once and not for each instance.
|
||||
key = f"__hasRun{self.__class__.__name__}"
|
||||
if context.data.get(key, False):
|
||||
return
|
||||
context.data[key] = True
|
||||
|
||||
current_comp = context.data["currentComp"]
|
||||
frame_start = context.data["frameStartHandle"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue