Make a signal persistant
matew
Posts: 20
Hello! I have this script:
// Global variable to hold the connectiong_oProp = null;(function(){ function myFunc(){ MessageBox.information("ok", "message", "ok"); // Additional functionality return true; } var oNode = Scene.getPrimarySelection(); if (oNode) { g_oProp = oNode.findProperty("XRotate"); if (g_oProp) { connect(g_oProp, "currentValueChanged()", myFunc); } } g_oProp.setValue(1); //raises currentValueChanged() successfully})();/*...currentValueChanged() stops working after finishing the script.*/
The signal works what I change the property inside the code, but it stops working after finishing the script. Is the any way to make it persistant?
Comments
This section of the APUI reference shows what you need
http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/start#post-load_data_items
and here are some samples using the technique
http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/start#post-load_callbacks
I don't beleive so, no.