General technical questions about v3 Moi's API

 From:  mkdm
8010.5 In reply to 8010.4 
Hi Michael,

please help! I think that i spoke too soon (:

In order to fill the output of the node that i'm writing, i'm doing something like this (in pseudo-code) :

code:
var output = moi.geometryDatabase.createObjectList();
...
some filtering logic
...

... all inside the main for loop....

var subObjs = <current curve object>.getSubObjects();

for ( var i2 = 0; i2 < subObjs.length; i2++ ) {
	var addSegCurve = false;

	if (segCurves.item(i2) "passes the filtering criteria") {
		addSegCurve = true;
	}
	
	if (addSegCurve) {
		output.addObject(subObjs.item(i2));
	}
}



The problem is that the line "output.addObject(subObjs.item(i2));" seems to add an incompatible object to the output ObjectList.

What i'm doing wrong ?

It's "<current curve object>.getSubObjects().item(<index>)" a valid curve object ?

That is....Should i convert a CurveSegment object into a Curve object ? If so, how to do that ?

Marco (mkdm).