Hi Mo, something like this for a script to find the node editor object from script running outside of the node editor dialog.
code:
var uipanels = moi.ui.getUIPanels();
for ( var i = 0; i < uipanels.length; ++i )
{
var uipanel = uipanels.item(i);
// uipanel is the HTML window object that holds global variables.
// Find the one that has "nodeeditor" somewhere in it's URL:
moi.ui.alert( uipanel.document.URL );
}
If there is a global variable on the node editor dialog named LiteGraph then you should be able to do uipanel.LiteGraph.editor
- Michael
|