[SOLVED] Is there any way to reference the node that emitted a signal?
algovincian
Posts: 2,610
I saved a figure/prop asset after setting up some node data which runs a specified script when the asset is loaded. This script sets up a connection using the callback manager that causes a second script to run when a certain signal is emitted. So far so good - all working up to this point.
My question is this:
In the second script that executes when the signal has been emitted, is there a simple way to reference the node that emitted the signal in the first place?
I feel like I must be overlooking something simple - doh!
- Greg
Post edited by algovincian on
Comments
There is a function in the callback to get the sender http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/callback_dz
First of all, thanks for taking the time to respond - it's much appreciated.
The problem I was having was that the second script that executes when the signal has been emitted didn't have access to the return value when the first script called oCallBackMgr.createCallBack() , so there was no way to call getSender().
Or so I thought . . .
After doing some more searching, I came accross this:
http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/elements/callback_property_current_value_changed_renderer/start
The relevant excerpt of the script on that page:
// 'CallBack' is a global transient variable, available when this script is executed by a DzCallBack
I was not aware of this global variable. Thanks again for the reply.
- Greg
It is also mentioned here, in the detailed escription http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/callbackmgr_dz