Hello Polycounters,
I am in need of some assistance. I have a script that at the moment gathers the faces you have selected and stores them in an array so that you can cycle through the face selection array and randomly select faces from it.
The issue I am having is that at first run the array is set up fine, but when you go to select a face at random the array seems to be reset to only contain the one face even though the line that gathers the faces is only called at the very beginning?
I am not sure why this is happening as I am storing the faces at the very beginning or is the array dependent on what is selected at that point in time?
fn gatherInfo =
(
for i in selection do
(
obj = i
)
faceList = obj.selectedFaces
)
fn pickFace =
(
select faceList[random 1 faceList.count]
faceVerts = polyop.getVertsUsingFace obj faceList
vertPos= for v in faceVerts collect(polyop.getVert obj v)
)
Replies
So to answer your question, you'd have to cast the obj.selectedFaces to array or bitarray first.
Thanks for the heads up Swordslayer, this is purely the base of the tool I am working at at the moment and I was trying to get a couple of things working before moving on. The function is indeed suppose to return the positions of the verts and such