fix(nuke): dealing with Qt.py

This commit is contained in:
Jakub Jezek 2019-05-20 22:14:26 +02:00
parent f7691b4121
commit 8445e4cb9a
2 changed files with 30 additions and 31 deletions

View file

@ -109,12 +109,6 @@ def install():
# api.set_avalon_workdir()
# reload_config()
# import sys
# for path in sys.path:
# if path.startswith("C:\\Users\\Public"):
# sys.path.remove(path)
log.info("Registering Nuke plug-ins..")
pyblish.register_plugin_path(PUBLISH_PATH)
avalon.register_plugin_path(avalon.Loader, LOAD_PATH)

View file

@ -3,7 +3,6 @@ import sys
import os
from collections import OrderedDict
from pprint import pprint
from avalon.vendor.Qt import QtGui
from avalon import api, io, lib
import avalon.nuke
import pype.api as pype
@ -20,6 +19,12 @@ self = sys.modules[__name__]
self._project = None
for path in sys.path:
log.info(os.path.normpath(path))
if "C:\\Users\\Public" in os.path.normpath(path):
log.info("_ removing from sys.path: `{}`".format(path))
sys.path.remove(path)
def onScriptLoad():
if nuke.env['LINUX']:
nuke.tcl('load ffmpegReader')
@ -472,30 +477,30 @@ def update_frame_range(start, end, root=None):
else:
nuke.root()[key].setValue(value)
def get_additional_data(container):
"""Get Nuke's related data for the container
Args:
container(dict): the container found by the ls() function
Returns:
dict
"""
node = container["_tool"]
tile_color = node['tile_color'].value()
if tile_color is None:
return {}
hex = '%08x' % tile_color
rgba = [
float(int(hex[0:2], 16)) / 255.0,
float(int(hex[2:4], 16)) / 255.0,
float(int(hex[4:6], 16)) / 255.0
]
return {"color": QtGui.QColor().fromRgbF(rgba[0], rgba[1], rgba[2])}
#
# def get_additional_data(container):
# """Get Nuke's related data for the container
#
# Args:
# container(dict): the container found by the ls() function
#
# Returns:
# dict
# """
#
# node = container["_tool"]
# tile_color = node['tile_color'].value()
# if tile_color is None:
# return {}
#
# hex = '%08x' % tile_color
# rgba = [
# float(int(hex[0:2], 16)) / 255.0,
# float(int(hex[2:4], 16)) / 255.0,
# float(int(hex[4:6], 16)) / 255.0
# ]
#
# return {"color": Qt.QtGui.QColor().fromRgbF(rgba[0], rgba[1], rgba[2])}
def get_write_node_template_attr(node):