Hey Guys,
I am trying to execute functions from inside a string on click of buttons.I was able to execute whole snippet,but not able to setup the callback for calling specific functions by pressing specific buttons.Please note that it`s not an HDA,it`s working fine with HDAs using hou.hdaModule,but I want to call these functions on a node.Posted Images should give you a better Idea of my issue.
I have also attached the hip file
Python Callback issue
2647 3 2- MarXindia
- Member
- 34 posts
- Joined: 9月 2013
- Offline
- Enivob
- Member
- 2625 posts
- Joined: 6月 2008
- Offline
- MarXindia
- Member
- 34 posts
- Joined: 9月 2013
- Offline
Enivob
Try specifying the function after the eval, basically running another line of code within a single click.exec(kwargs['node'].parm('code').eval());printB()
Yay it works .I did find a workaround though, that looks like below,
exec('{}\nB()'.format(kwargs.parm,('code').eval()))
your solution seems pretty straight forward and convenient,Thankyou Enivob
- AdrianG001
- Member
- 8 posts
- Joined: 8月 2018
- Offline
Duplicate callback outputs
In the callback for output(s): layout.children Output 0 (layout.children) is already in use. Any given output can only have one callback that sets it. To resolve this situation, try combining these into one callback function, distinguishing the trigger by using dash.callback_context if necessary.
In the callback for output(s): layout.children Output 0 (layout.children) is already in use. Any given output can only have one callback that sets it. To resolve this situation, try combining these into one callback function, distinguishing the trigger by using dash.callback_context if necessary.
-
- Quick Links