Scripting BLEND

 From:  Michael Gibson
6955.11 In reply to 6955.8 
Hi Brian, try the attached version in place of the last .htm file you posted above.

Basically once you have grabbed out the orientation list and changed the one flip value in it, then you want to re-use that same orientation list that was just modified rather than trying to build a completely new one. You can't build a new one right now because scripts don't have any way to create an IMoiCurveOrientation object so you have to re-use the one that was grabbed out from the factory.

Check a diff utility to see the changes but basically don't do this:

code:
				// TRY to make a new orientations list with the name orientlist.
				var orientlist = concat(orient1.flipped, seamvalue1.seam, orient2.flipped, seamvalue2.seam ); 


That will make a list but it won't contain IMoiCurveOrientation objects in it, it will be a list with 4 items in the list: boolean, double, boolean, double. It resembles the orientation list, but the what the orientation list is here is a list of 2 CurveOrientation objects with each of those objects having 2 properties. Yes both of these constructs have 4 properties total in it, but the system is expecting CurveOrientation objects in this case and so just individual properties in the list without them actually belonging to a CurveOrientation object won't do the trick here.


So then when you do the blend, just use the orientlist that was sucked out from the factory previously like this:

code:
              var blendCurve = factory( 'blend', curvelist, orientlist , 'G3', 1.18 );



Hope this helps!

Sorry this stuff is so tricky currently, in V4 I'll be trying to make a lot more direct methods for constructing various things rather than only being able to do all creation stuff through the generic factory mechanism.

- Michael
Attachments: