nuke: python3 compatibility wip

This commit is contained in:
Jakub Jezek 2021-09-09 16:25:20 +02:00
parent fcd3df0615
commit 971844ed86
No known key found for this signature in database
GPG key ID: D8548FBF690B100A
5 changed files with 13 additions and 5 deletions

View file

@ -727,7 +727,7 @@ class WorkfileSettings(object):
log.error(msg)
nuke.message(msg)
log.warning(">> root_dict: {}".format(root_dict))
log.debug(">> root_dict: {}".format(root_dict))
# first set OCIO
if self._root_node["colorManagement"].value() \
@ -1277,6 +1277,7 @@ class ExporterReview:
def clean_nodes(self):
for node in self._temp_nodes:
nuke.delete(node)
self._temp_nodes = []
self.log.info("Deleted nodes...")
@ -1301,6 +1302,7 @@ class ExporterReviewLut(ExporterReview):
lut_style=None):
# initialize parent class
ExporterReview.__init__(self, klass, instance)
self._temp_nodes = []
# deal with now lut defined in viewer lut
if hasattr(klass, "viewer_lut_raw"):

View file

@ -2,6 +2,7 @@ import nuke
import pyblish.api
from avalon.nuke import maintained_selection
class CreateOutputNode(pyblish.api.ContextPlugin):
"""Adding output node for each ouput write node
So when latly user will want to Load .nk as LifeGroup or Precomp
@ -15,8 +16,8 @@ class CreateOutputNode(pyblish.api.ContextPlugin):
def process(self, context):
# capture selection state
with maintained_selection():
active_node = [node for inst in context[:]
for node in inst[:]
active_node = [node for inst in context
for node in inst
if "ak:family" in node.knobs()]
if active_node:

View file

@ -1,3 +1,4 @@
import sys
import os
import nuke
from avalon.nuke import lib as anlib
@ -5,6 +6,10 @@ import pyblish.api
import openpype
if sys.version_info[0] >= 3:
unicode = str
class ExtractThumbnail(openpype.api.Extractor):
"""Extracts movie and thumbnail with baked in luts

View file

@ -3,7 +3,6 @@ import pyblish.api
import os
import openpype.api as pype
from avalon.nuke import lib as anlib
reload(anlib)
class CollectWorkfile(pyblish.api.ContextPlugin):

View file

@ -69,7 +69,8 @@ def evaluate_filepath_new(k_value, k_eval, project_dir, first_frame):
frames = sorted(frames)
firstframe = frames[0]
lastframe = frames[len(frames) - 1]
if lastframe < 0:
if int(lastframe) < 0:
lastframe = firstframe
return filepath, firstframe, lastframe