Jump to: Board index » General » Fusion

The problem of calling Python script by node group button

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline

moore_wang

  • Posts: 21
  • Joined: Mon Sep 17, 2018 1:47 am
  • Real Name: wangjian

The problem of calling Python script by node group button

PostTue Dec 18, 2018 7:36 am

I add a button to the node group to trigger the python script I need to run, but there is a chance that the button will not respond. I add a log to my Python script and find that the button did not call my Python script at all.

It's a probabilistic problem. It's not always working.

The script uses a free version of fusion

I want to know what is the cause of this, and what can I do to solve this problem?

Button = {
INP_MaxAllowed = 1000000,
INP_Integer = false,
INPID_InputControl = "ButtonControl",
BTNCS_Execute = "comp:RunScript(\"Script path\")",
INP_MaxScale = 1,
INP_MinScale = 0,
INP_MinAllowed = -1000000,
LINKID_DataType = "Number",
LINKS_Name = "button",
}
Offline

moore_wang

  • Posts: 21
  • Joined: Mon Sep 17, 2018 1:47 am
  • Real Name: wangjian

Re: The problem of calling Python script by node group butto

PostFri Dec 28, 2018 9:56 am

The probability of recent emergence is getting higher and higher. Is there no solution?
Offline
User avatar

Bryan Ray

  • Posts: 2491
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: The problem of calling Python script by node group butto

PostFri Dec 28, 2018 10:28 pm

Is your script on a path that might be slow to respond? A drive that goes to sleep or a network path that isn't automatically reconnected?
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

moore_wang

  • Posts: 21
  • Joined: Mon Sep 17, 2018 1:47 am
  • Real Name: wangjian

Re: The problem of calling Python script by node group butto

PostSat Dec 29, 2018 6:14 am

Bryan Ray wrote:Is your script on a path that might be slow to respond? A drive that goes to sleep or a network path that isn't automatically reconnected?


My path is: C:\ProgramData\Blackmagic Design\Fusion\Scripts. In the new folder under this level directory. This is to prevent unnecessary files from being known to users.
Offline
User avatar

Bryan Ray

  • Posts: 2491
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: The problem of calling Python script by node group butto

PostSat Dec 29, 2018 3:21 pm

That is very strange. The only reason I can think of that it would fail intermittently is if the path to the file isn't found, but if you were having problems with C: I think you'd notice that in other situations.

Do you see any errors in the console when it fails to run? Does it ever fail if you try to run a Lua script instead?

I don't know much about Python, but is there any possibility that the Python environment is somehow faulty?
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

moore_wang

  • Posts: 21
  • Joined: Mon Sep 17, 2018 1:47 am
  • Real Name: wangjian

Re: The problem of calling Python script by node group butto

PostFri Jan 04, 2019 1:17 am

Bryan Ray wrote:That is very strange. The only reason I can think of that it would fail intermittently is if the path to the file isn't found, but if you were having problems with C: I think you'd notice that in other situations.

Do you see any errors in the console when it fails to run? Does it ever fail if you try to run a Lua script instead?

I don't know much about Python, but is there any possibility that the Python environment is somehow faulty?


In case of failure, I use the Lua function called by this button to execute on the console, and find that it can run. Does this mean that it is caused by the button? Do I change this button directly in the file information, such as changing the name of this button, which will affect it?
Offline
User avatar

Chad Capeland

  • Posts: 3025
  • Joined: Mon Nov 10, 2014 9:40 pm

Re: The problem of calling Python script by node group butto

PostFri Jan 04, 2019 1:23 am

Wonder what would happen if you created a function in the scriptlib that ran the script and had the button just call the function.

Or what would happen if you just put whatever is in the script file into the scriptlib function so you didn't do any IO at all when the button was pressed.
Chad Capeland
Indicated, LLC
www.floweffects.com
Offline

moore_wang

  • Posts: 21
  • Joined: Mon Sep 17, 2018 1:47 am
  • Real Name: wangjian

Re: The problem of calling Python script by node group butto

PostFri Jan 04, 2019 7:23 am

Chad Capeland wrote:Wonder what would happen if you created a function in the scriptlib that ran the script and had the button just call the function.

Or what would happen if you just put whatever is in the script file into the scriptlib function so you didn't do any IO at all when the button was pressed.


As described in my question, I hide the name of the button and the path of the script, which is the path of a python file. When the button failed, I used the Lua function called by the button in the fusion console and found that the function could be executed. And the other buttons of the node group can be run. Do I change the name and some information of this button directly by using the editor? Is this likely to affect this button?
Offline

moore_wang

  • Posts: 21
  • Joined: Mon Sep 17, 2018 1:47 am
  • Real Name: wangjian

Re: The problem of calling Python script by node group butto

PostFri Jan 04, 2019 9:00 am

My node group has seven buttons that trigger scripts. Then I found that if I delete two script buttons, the invalid button can be used. Is there a limit on fusion? Limit the free version to only use 5 buttons to use scripts? And the extra buttons are uncertain?

Return to Fusion

Who is online

Users browsing this forum: Bing [Bot] and 50 guests