PDA

View Full Version : Quick Weight Maps question


ExP
05-15-2008, 10:12 PM
Just getting a first taste of XSI. I'm playing around with dynamic Weight Maps etc..
Quick question: Is there a way to select components, like polys for example, from a Weight Map? Let's say I have an object with a weigh map, how do I select the equivalent polys the weigh map touches? I looked around a lot, but coun't find an answer.

Thanks.

mantom
05-16-2008, 04:30 PM
Just getting a first taste of XSI. I'm playing around with dynamic Weight Maps etc..
Quick question: Is there a way to select components, like polys for example, from a Weight Map? Let's say I have an object with a weigh map, how do I select the equivalent polys the weigh map touches? I looked around a lot, but coun't find an answer.

Thanks.


Weight maps can only be applied to point clusters. Therefore, find the cluster the weight map is attached, then use the available selection tools for the cluster (eg: ALT + RMB on the cluster in the explorer).

Matt

SebasProulx
05-16-2008, 04:43 PM
Try this:



'Select a WeightMap and run

Dim oWeightMap ,o3DObj ,oPointCollection ,oWMElements,aElementArray,i,item

set oWeightMap = selection(0)
set o3DObj = selection(0).Parent3DObject
set oPointCollection = createObject("xsi.collection")
set oWMElements = oWeightMap.Elements
aElementArray = oWMElements.Array
i = 0

for each item in aElementArray
if item <> 0 then
oPointCollection.add o3DObj.activeprimitive.geometry.points(i)
end if
i = i + 1
next

SelectObj oPointCollection

SebasProulx
05-16-2008, 04:56 PM
Like mantom said ,weight maps can only be applied to point clusters, but you can select the polygons the weight map touches anyway. Just add this line at the end :


SelectAdjacent , "Polygon", False