Merged in bugfix/PYPE-681-nuke-stop-log.error-to-be-messa (pull request #454)

removing annoying message window

Approved-by: Milan Kolar <milan@orbi.tools>
This commit is contained in:
Jakub Ježek 2020-01-29 00:21:47 +00:00 committed by Milan Kolar
commit db02aed384
13 changed files with 136 additions and 93 deletions

View file

@ -35,8 +35,10 @@ class CreateBackdrop(Creator):
return instance
else:
nuke.message("Please select nodes you "
"wish to add to a container")
msg = "Please select nodes you "
"wish to add to a container"
self.log.error(msg)
nuke.message(msg)
return
else:
bckd_node = autoBackdrop()

View file

@ -36,8 +36,10 @@ class CreateGizmo(Creator):
node["tile_color"].setValue(int(self.node_color, 16))
return anlib.imprint(node, self.data)
else:
nuke.message("Please select a group node "
"you wish to publish as the gizmo")
msg = ("Please select a group node "
"you wish to publish as the gizmo")
self.log.error(msg)
nuke.message(msg)
if len(nodes) >= 2:
anlib.select_nodes(nodes)
@ -58,8 +60,10 @@ class CreateGizmo(Creator):
return anlib.imprint(gizmo_node, self.data)
else:
nuke.message("Please select nodes you "
"wish to add to the gizmo")
msg = ("Please select nodes you "
"wish to add to the gizmo")
self.log.error(msg)
nuke.message(msg)
return
else:
with anlib.maintained_selection():

View file

@ -34,7 +34,9 @@ class CrateRead(avalon.nuke.Creator):
nodes = self.nodes
if not nodes or len(nodes) == 0:
nuke.message('Please select Read node')
msg = "Please select Read node"
self.log.error(msg)
nuke.message(msg)
else:
count_reads = 0
for node in nodes:
@ -46,7 +48,9 @@ class CrateRead(avalon.nuke.Creator):
count_reads += 1
if count_reads < 1:
nuke.message('Please select Read node')
msg = "Please select Read node"
self.log.error(msg)
nuke.message(msg)
return
def change_read_node(self, name, node, data):

View file

@ -41,9 +41,11 @@ class CreateWriteRender(plugin.PypeCreator):
if (self.options or {}).get("useSelection"):
nodes = self.nodes
assert len(nodes) < 2, self.log.error(
"Select only one node. The node you want to connect to, "
"or tick off `Use selection`")
if not (len(nodes) < 2):
msg = ("Select only one node. The node you want to connect to, "
"or tick off `Use selection`")
log.error(msg)
nuke.message(msg)
selected_node = nodes[0]
inputs = [selected_node]
@ -134,7 +136,11 @@ class CreateWritePrerender(plugin.PypeCreator):
if (self.options or {}).get("useSelection"):
nodes = self.nodes
assert len(nodes) < 2, self.log.error("Select only one node. The node you want to connect to, or tick off `Use selection`")
if not (len(nodes) < 2):
msg = ("Select only one node. The node you want to connect to, "
"or tick off `Use selection`")
self.log.error(msg)
nuke.message(msg)
selected_node = nodes[0]
inputs = [selected_node]

View file

@ -256,8 +256,11 @@ class LoadBackdropNodes(api.Loader):
if len(viewer) > 0:
viewer = viewer[0]
else:
self.log.error("Please create Viewer node before you "
"run this action again")
if not (len(nodes) < 2):
msg = "Please create Viewer node before you "
"run this action again"
self.log.error(msg)
nuke.message(msg)
return None
# get coordinates of Viewer1

View file

@ -176,8 +176,10 @@ class LoadGizmoInputProcess(api.Loader):
if len(viewer) > 0:
viewer = viewer[0]
else:
self.log.error("Please create Viewer node before you "
"run this action again")
msg = "Please create Viewer node before you "
"run this action again"
self.log.error(msg)
nuke.message(msg)
return None
# get coordinates of Viewer1

View file

@ -276,7 +276,10 @@ class LoadLutsInputProcess(api.Loader):
if len(viewer) > 0:
viewer = viewer[0]
else:
self.log.error("Please create Viewer node before you run this action again")
msg = "Please create Viewer node before you "
"run this action again"
self.log.error(msg)
nuke.message(msg)
return None
# get coordinates of Viewer1

View file

@ -1,4 +1,5 @@
from avalon import api
import nuke
class MatchmoveLoader(api.Loader):
@ -19,6 +20,8 @@ class MatchmoveLoader(api.Loader):
exec(open(self.fname).read())
else:
self.log.error("Unsupported script type")
msg = "Unsupported script type"
self.log.error(msg)
nuke.message(msg)
return True

View file

@ -41,7 +41,7 @@ class ExtractReviewDataLut(pype.api.Extractor):
with anlib.maintained_selection():
exporter = pnlib.ExporterReviewLut(
self, instance
)
)
data = exporter.generate_lut()
# assign to representations

View file

@ -41,7 +41,7 @@ class ValidateRenderedFrames(pyblish.api.InstancePlugin):
if not repre.get('files'):
msg = ("no frames were collected, "
"you need to render them")
self.log.warning(msg)
self.log.error(msg)
raise ValidationException(msg)
collections, remainder = clique.assemble(repre["files"])
@ -75,7 +75,7 @@ class ValidateRenderedFrames(pyblish.api.InstancePlugin):
self.log.info(
'len(collection.indexes): {}'.format(collected_frames_len)
)
if "slate" in instance.data["families"]:
collected_frames_len -= 1