Avoid SetValue() when possible. Use the object model instead: c.Name = "Test"
On Fri, Oct 4, 2013 at 3:43 PM, Sergio Mucino <sergio.muc...@modusfx.com>wrote: > Never mind... found it. I found that SetValue expects strings for its > arguments, so changing cName to: > cName = str(c)+".Name" > did the trick. > Cheers! > > > *Sergio Mucino* > Lead Rigger > Modus FX > > On 04/10/2013 3:40 PM, Sergio Mucino wrote: > > Okay. I'm trying to write my first SI script (using Python)... and I > actually got kinda lucky, because I found what I need already scripted (ah, > the joys of Googleland). I need to create a cluster per each selected > polygon on an object, and then constraint Nulls to these clusters. This > script works perfectly... > > > http://xsisupport.com/2012/03/17/python-example-constraining-nulls-to-components/ > > I'm now trying to extend the script snippet to be a little more friendly > to my needs. The first thing I'd like to do is specify the name for the > clusters created. So, I modified the loop to read like this... > > for i in si.Selection(0).SubElements: > c = o.ActivePrimitive.Geometry.AddCluster( clusterType, "", [i] ) > cName = c.Name > si.SetValue(cName, "Test", "") > n = si.ActiveSceneRoot.AddNull() > n.Kinematics.AddConstraint( "ObjectToCluster", c ) > > ... but SI is barfing on the SetValue line. It claims that "the parameter > is incorrect". I know the problem is in the cName reference I'm using, but > I can't figure out how I need to feed it properly. I know that cName's type > is 'instance', so I'm not sure how to reference it correctly. If anyone has > any pointers into how to get this working right, I'll be quite grateful. > The noob thanks you in advance. > > -- > *Sergio Mucino* > Lead Rigger > Modus FX > > > -------------------------- > To unsubscribe: mail softimage-requ...@listproc.autodesk.com with subject > "unsubscribe" and reply to the confirmation email. > > > -------------------------- > To unsubscribe: mail softimage-requ...@listproc.autodesk.com with subject > "unsubscribe" and reply to the confirmation email. >
-------------------------- To unsubscribe: mail softimage-requ...@listproc.autodesk.com with subject "unsubscribe" and reply to the confirmation email.