我试图将我用Python编写的一段代码翻译成Lua.我在合成包Blackmagic Fusion中使用此代码.
任何帮助将不胜感激!
Python脚本(工作):
try:
comp.ActiveTool() # checks if a tool is selected
except:
print("nothing selected")
comp.AddTool("PolylineMask", -32768, -32768) # adds a tool if nothing's selected
Run Code Online (Sandbox Code Playgroud)
Lua脚本(仍然没有工作和错误):
if pcall (comp:ActiveTool()) then
print "Node Selected"
else
comp:AddTool("PolylineMask", -32768, -32768)
end
Run Code Online (Sandbox Code Playgroud)