PDA

View Full Version : polycount?


ginodauri
09-19-2008, 04:35 PM
How to get polycount?

I dont understand.When i want to declare variable is must be array , like:

int $polygonCount[] =` polyEvaluate -f `

size of this array is 1.

I need just int variable of polycount.

greatPumpkin
09-19-2008, 05:46 PM
the size of the array is not the number of faces,

int $polygonCount[] =` polyEvaluate -f `;

so your array size is one.. but your actual face count is:

print $polygonCount[0];

maya does this because you can pass multiple flags to polyEvalute, so if you pass -f -v, your first array item will be number of faces, and your second item will be number of verts.

ginodauri
09-20-2008, 03:24 AM
Ok that is clear.

I have some problem with this code,like infinite loop.

Someone please tell me what provlem is.

It is for random extrude poligons of poligonal object.

int $polygonCount[] =` polyEvaluate -f `;

int $currentCount = $polygonCount[0];

int $randomFace;
float $extrudeFace1;
int $counter;

string $selection [] = `ls -sl';

for ($each in $selection)
{

for ($counter=0; $counter<$currentCount; $counter++)
{
int $randomFace = `rand $currentCount`;

float $extrudeFace1 = $randomFace/10.0;


polyExtrudeFacet -kft false -ltz $extrudeFace1 $each.f[$randomFace];
}
}

Robert Bateman
09-22-2008, 10:44 AM
I have some problem with this code,like infinite loop.

When you say "like infinite loop", do you mean "doesn't run at all"?


polyExtrudeFacet -kft false -ltz $extrudeFace1 ($each+".f["+$randomFace+"]");

If you do mean "infinite loop", it makes me think you're putting this in an expression? which is bad news! don't create new nodes inside an expression node - since it changes the DG during evaluation, which will only make things go very wrong indeed....

CGTalk Moderation
09-22-2008, 10:44 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.