Method to apply operator? 2004-02-15 - By Graham D Clark
Back > When I run this, it says that argument 1 ( "oPt1;oInt" ) is invalid. Its expecting object.pnt[#s array] and only constant strings part should be inside quotes, vars should be outside.
//piece of lightrig: var oLightRig = activesceneroot.addlightrig( "Spot.Preset", "Spot_Root"); oLightRig.light.posx = 5 oLightRig.light.posy = 5 oLightRig.light.posz = 5 var oCurve = createcurve( 1, 0, "(0,0,0),(5,5,5)", false )(0); oLightRig.addchild( oCurve ); logmessage(oCurve.activeprimitive.geometry.points(0).index); var cc = ApplyOp("ClusterCenter", oCurve+".pnt["+oCurve.activeprimitive.geometry.points(0).index+"];"+oLig htRig.light.interest , 3, siPersistentOperation,null); var cc2 = ApplyOp("ClusterCenter", oCurve+".pnt["+(oCurve.activeprimitive.geometry.points.count-1 (See http://unt-1.ora-code.com))+"];"+oLi ghtRig.light , 3, siPersistentOperation,null); //access and use egs: logmessage(cc(0).posy); logmessage(cc2(0).posy); SetKey(oLightRig.light.posx, 0, 10, null); SetKey(oLightRig.light.posx, 10, 20, null); -- ---- ---- ---- ---- ---- -- http://www.grahamdclark.com
> -- --Original Message-- -- > From: owner-xsi@(protected) > [mailto:owner-xsi@(protected)] On Behalf Of Bernard Lebel > Sent: February 15, 2004 5:51 PM > To: XSI@(protected) > Subject: Re: [Script] Method to apply operator? > > > Thanks for the advice. > > But I've messing around for an hour now and for the life of > me I can't seem to make it work. > I hoped for a simple solution but it doesn't look like so. > > Basically I have created a 2-point curve, and want to cluster > center constraint each points to a > spot and its interest. > > > > // Note: oInt is light interest > > // Get point of curve > var oPt1 = oCurve.activeprimitive.geometry.points[0]; > > // Apply Cluster Center deform operator > applyoperator( "ClusterCenter", "oPt1;oInt", 3 ); > > > > When I run this, it says that argument 1 ( "oPt1;oInt" ) is invalid. > I'm under the impression that I need to create the clusters > before running the command (as you > said), but again, reading through the docs I have a hard time > even creating a point cluster! > > Sorry this is the first time I script these things, I'm a bit lost.... > > > > Thanks > Bernard > > > -- -- Original Message -- -- > From: "Jaco" <raffaele.fragapane@(protected)> > To: <XSI@(protected)> > Sent: Sunday, February 15, 2004 5:05 PM > Subject: RE: [Script] Method to apply operator? > > > > if you mean doing it all by the object model rather then relying on > > command just create a function that will: > > > > A) create a cluster > > B) find the averaged center of the subelements cluster > > C) puts a null there > > D) creates a constrain to that null > > > > I always did it this way (I have my little helper lib where > i stuffed a > > few of these repetitive tasks). > > I don't think XSI has a separathe method from addcluster to > create one > > with a center, it prolly just does what I wrote above under > the hood, > > would love to stand corrected tho if I missed on something. > --- > Unsubscribe? Mail Majordomo@(protected) with the following > text in body: > unsubscribe xsi > > >
--- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|