无法在NUKE 11.3v4中创建旧的“文本”节点

时间:2019-05-06 16:06:48

标签: python nuke

我在macOS Mojave上使用NUKE 11.3v4。这是一个问题:我不能使用新的class2节点Text2。每次选择它–我的应用程序都会退出。我仅在macOS上有这种行为。在Windows和Linux上,它运行良好。因此,我写了一个小脚本来解决这个问题(我想使用旧的Text节点而不是新的Text2节点)。但是我的脚本不起作用。为什么?

menu.py文件中的代码:

import os
import sys
import nuke

toolbar = nuke.menu('Nodes')

if os.name == 'posix' and sys.platform == 'darwin':
    toolbar.addCommand('Draw/Text', 'nuke.createNode("Text")', 'crtl+alt+shift+t', icon='Text.png')
    nuke.message("Oops! Only Text1 node is accessible.")
else:
    toolbar.addCommand('Draw/Text', 'nuke.createNode("Text2")', 'crtl+alt+shift+t', icon='Text.png')
    nuke.message("Fine! Text2 node's ready for use.")

1 个答案:

答案 0 :(得分:0)

我解决了这个问题。 这只是我的代码中的typo

'crtl+alt+shift+t'

代替:

'ctrl+alt+shift+t'

这是调用Text节点的快捷方式:

Ctrl - Alt - Shift - T

  

现在我的脚本工作正常!

import os
import sys
import nuke

toolbar = nuke.menu('Nodes')

if os.name == 'posix' and sys.platform == 'darwin':
    toolbar.addCommand('Draw/Text', 'nuke.createNode("Text")', 'ctrl+alt+shift+t', icon='Text.png')
    nuke.message("Oops! Only Text1 node is accessible.")
else:
    toolbar.addCommand('Draw/Text', 'nuke.createNode("Text2")', 'ctrl+alt+shift+t', icon='Text.png')
    nuke.message("Fine! Text2 node's ready for use.")

希望这会有所帮助。