Monday, February 19, 2024
HomeMotion GraphicsChoose Random Faces in Maya with Mel Script

Choose Random Faces in Maya with Mel Script


Choose random faces in Maya is a really helpful mel script software. Since Maya doesn’t have any built-in instruments for that goal. This mel script goes to avoid wasting us loads of time.

The Creator of the script is Byterunner. Sadly, I haven’t discovered every other info, or hyperlinks so as to add to his/her work.

So as an alternative of choosing randomly all of the faces in a geometry in Maya, and shedding loads of time, particularly if we’re engaged on a high-polygon mesh, we may use this mel script.

Choose random faces in Maya (mel script):

What mainly does is randomly choose a proportion of faces we specify of an object in Maya. Every time we run the script, the faces that will likely be chosen will likely be random, each time, which is cool.

With a view to use it, we now have to choose an object or extra and run the script in Maya from the Script Editor within the correct code language (mel).

Word: The share collection of faces is per object, for example. If we choose two or extra objects and run the choose random faces mel script, the share choice will likely be per object and never for our total choice objects.

Yow will discover the mel script beneath:

Now we have one parament we will change relying on our aim, and that’s the proportion of face choice. Which is the second line of the above script (float $selectPercent = 0.10;).

0 means there will likely be no face choice in any respect and 1 means all of the faces will likely be chosen. By default, the script is ready at 0.10 which implies 10% of faces will likely be chosen for the chosen object(s) in Maya.

Moreover, it’s a good suggestion, for ease of entry, to put the script on a shelf in Maya to reuse it while you want it.

You could have an interest within the beneath mel scripts in Maya as nicely:

Let’s check out this mel script in Maya, to see it in motion, with a easy polygonal sphere geometry.

Choose random faces in Maya:

Choose the sphere mesh and open up the Script Editor by going to Home windows – Normal Editors – Script Editor. Navigate to a mel script tab, and paste the above mel script.

On this instance, we’ll set the share to 0.35 (roughly 1/3 faces of our object). Spotlight the entire mel script and hit ctrl + enter to execute the script.

select random faces in Maya, run the script
the mel script has selected all the faces in out sphere in Maya

As we will see, our choose random faces in Maya mel script have chosen roughly 1/3 of the faces of our sphere.

Lastly, we will mix this mel script with the method to add randomness to our geometry in Maya. In that approach, we will solely add randomness to a proportion of faces in our geometry, and never in the entire mesh.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments