MEL scripts

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  11 November 2016
rand rotation change every frame.

hi all.

look for simple expression. i want to choose my rotation when the particle hit the floor with a little bit of random.

like : rotationPP = rand (95,120); but with this the particle keep changing every frame between 95,120.
i tried to : rotationPP = 95 && 120; but doesnt work.

hope its clear .

  11 November 2016
Ok, so what you want to do is have a switch which activates every time the particle collides. To do this - add a new attribute to the particle called "hit" Make it a float, perparticle attribute. got it?

Now, you want to add a little checker to your runtime before dynamics that compares the "eventCount[0]" attribute to the "hit" attribute. "EventCount[0]" automatically increases every time a particle collides - so by default the particle knows its own collision counter.

$count = eventCount[0];
if ($count != $hit){$rotation = $newValue; $hit = $count;}

One more thing to add is that you may want to add a condition that skips this process if the particle is resting on the ground. To do that you can add somehting like this;

$velocity = velocity;
$tolerance = 0.1;

if ($velocity > $tolerace){
$count = eventCount[0];
if ($count != $hit){$rotation = $newValue; $hit = $count;}
  02 February 2017
Toggle Convert Selectinon To...

Hey. I had the idea to combine 3 standard commands in one toggle.


Originally selected face. When you press one key is too much between the outer vertices, edges, and a return to the inner face or the face group.

I think it's quite simple to implement with the help of programming and it will be a useful tool. I am hope for your help. Thank you!
  03 March 2017
resize image in layout

How do mimic the image resizing behavior of Maya's image preview pane in the file browser?

i.e. how do I tell maya to dynamically resize an image to fit within its parent? Right now I'm using formLayout, should I be using something else?
  09 September 2017
Hi Guys,

I am a newbie and having trouble running this script.Can you guys please help me with this script, When I run the exe file, it is giving me an error
reply share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 02:27 AM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.