(function () { var datapop = moi.filesystem.openFileStream('c:\\temp\\datapop.txt', 'w'); function PointDetails() { this.boxcolor = "#F05"; this.addInput("Pts", "pointarray"); this.addOutput("", "pointarray"); } PointDetails.title = "PointDetails"; PointDetails.prototype.onExecute = function () { if (!this.isInputConnected(0)) { this.local.errMsg = 'No Data Connection!'; this.boxcolor = "#F05" return; }; this.boxcolor = "#0F5" var ptArray = new pointArray(false); var i = 0, pt = 0, inp = this.getInputData(0, new pointArray()); for (i = 0; i < inp.getLength(); i++) { pt = inp.getElement(i); x1 = pt.data[0]; y1 = pt.data[1]; z1 = pt.data[2]; datapop.writeLine("X " + x1 +" Y " + y1 +" Z " + z1); ptArray.push(x1, y1, z1, 0, 0, 0, 1); } this.setOutputData(0, ptArray); } LiteGraph.registerNodeType("WidgetSample/PointDetails", PointDetails) })();
Attachments:
_PointDetails.js