General technical questions about v3 Moi's API

 From:  mkdm
8010.9 In reply to 8010.8 
Hi Michael,

Thank you for these clarifications.

> Hi Marco, for the single segment case you need to call .clone() on the parent curve object, not on the segment. Segments are not meant to exist outside of their parent curve, and so they don't respond to obj.clone() directly themselves.

You're right! I realised that i misunderstood your previous reply regarding the use of the .clone() method on a curve's segment.

I apprechiated the clean and educational style of the code that you posted in your last reply, but looking at it more deeply,
i noticed that is, more or less, what i already wrote in my previous post (http://moi3d.com/forum/index.php?webtag=MOI&msg=8010.7).

I simply used the 'separate' factory command not directly, but with the help of the "factory()" method defined inside the NodeEditor.

code:
// separate the multisegmented curve, using the NodeEditor's wrapper factory() method
// Just for info, it simply calls the Moi's createFactory() method as shown below :
// function factory( factoryname ) { var f = moi.command.createFactory( factoryname ); for ( var i = 1; i < arguments.length; i++ ) if (arguments[i] !==null) f.setInput( i - 1, arguments[i] ); var obj = f.calculate(); f.cancel(); return obj; }


And regarding the cloning of the objects, before putting them in the output ObjectList, this is implicitly done again by the "output" node of the NodeEditor.

Finally, after some tests, i confirm that calling the "separate" factory command directly on a curve's segment, generates an empty ObjectList .

Thank you again for all your technical clarifications and have a nice day!

Marco (mkdm).