RE: jscript: how to select points from a deformer weights?

Date : Thu, 29 Dec 2005 18:10:50 -0000
To : <XSI(at)Softimage.COM>
From : "kim aldis" <kim(at)cg-soup.com>
Subject : RE: jscript: how to select points from a deformer weights?
It's not only about learning, Oz. if you do it the right way once then you've proper code you can use later if you need it on other projects.
 
 


From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Oz Adi
Sent: 29-December-2005 17:04
To: XSI(at)Softimage.COM
Subject: Re: jscript: how to select points from a deformer weights?

thanks!
 
for the purpose of this specific script, my "not proper" way should work, because the script creates a new mesh, asigns it as an envelope with automatic
asignment at 1 (100%), then it needs to creates clusters of points from each deformer...
So I always get a clean envelope...
 
but for the sake of me learning how to do it right, I'll investigate the proper way :)
 
thanks again!
 
Oz.
 
----- Original Message -----
Sent: Thursday, December 29, 2005 6:51 PM
Subject: RE: jscript: how to select points from a deformer weights?

If you have a cluster that is complete then initially the indexes of the cluster and the geometry will be identical.  But if the geometry is changed, e.g. adding new points, then there is no guarantee that the cluster indexes will remain the same as the geometry indexes.  Thats why your script can appear to work but might not be fully correct!
 
-Andrew
-----Original Message-----
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM]On Behalf Of Oz Adi
Posted At: Thursday, December 29, 2005 11:05 AM
Posted To: xsi
Conversation: jscript: how to select points from a deformer weights?
Subject: Re: jscript: how to select points from a deformer weights?

Thanks! I'll check this up.
 
in the meantime, I tried selecting the points geometry indexes, by the index number of the returned array -
if  weightArray[5] is at 100, I selected point number 5 on the geometry..
 
it seems to work... maybe I missed something , and it's wrong..?
 
Thanks Again, I will try figuring it up the proper way,  tommorow!
 
cheers,
 
Oz Adi
 
 
 
----- Original Message -----
Sent: Thursday, December 29, 2005 5:17 PM
Subject: RE: jscript: how to select points from a deformer weights?

You can build a jscript array with all the indexes of the points that have non-zero weights for a particular point.
Be sure that you determine the real geometry indexes, not the index of the point within a cluster.
 
The mapping infromation is available via the Cluster associated with the ClusterProperty that stores the deformation data.
Check out examples in the reference to learn more about that.
 
When you have the array of indexes you can call Geometry.CreateCluster. 
 
To Select the points build a string similar to the string that gets logged when to select some points,
e.g. objname.pnt[1,2,3]
The JScript array.join method is useful for turning an array into a comma separated string.
 
-Andrew
-----Original Message-----
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM]On Behalf Of Oz Adi
Posted At: Tuesday, December 27, 2005 10:38 AM
Posted To: xsi
Conversation: jscript: how to select points from a deformer weights?
Subject: jscript: how to select points from a deformer weights?

let's say I got an envelope with two bones, all weights are set 100% to the closest bone.
 
I am trying to select through scripting, the points that are  assigned to each deformer.
 
I can access the weights using the GetDeformerWeights method,
but I just cant find a way to, then select those points, or make a point cluster of them.
 
I am still studying Jscript, so I am just a begginer.. so I've spent over 10 hours trying to figure it out.. and no success :)
 
any tip or direction would be greatly appreciated..
 
cheers,
 
Oz Adi
 

Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.