Maya 2020 fundamentals - modelling the real world
Get halfway through a model and find it's an unworkable mess? Can't add edge loops where you need them? Can't subdivide a mesh properly? If any of this sounds familiar check this course out.
# 1 11-08-2008 , 11:21 AM
pbman's Avatar
Subscriber
Join Date: Mar 2005
Location: London
Posts: 1,135

particle Emission

hey

i want to emit a particle every time an object rotates 90 in the Z axis.

float $Value = "getAttr frontGunGroup.rz";//gets the .rz
//value and assigns it to a variable

if(($Value % 90) == 0)
setAttr bulletEmitter.rate = 25;
//% is modular(?sp) so i am asking it if $Value divides by
//90 and has a remainder of zero it sets value of 25

i dont know if im barking up the wrong tree as i cant get it to work.
i think i need an else command in there as well


Now at SMU doing BSc 3D Computer Animation so its hard to get on here
My wire render tut https://forum.simplymaya.com/showthre...threadid=20973
# 2 11-08-2008 , 12:43 PM
BennyK's Avatar
Registered User
Join Date: Oct 2007
Location: IL
Posts: 738
I'm not really familiar with MEL but didn't you say 'every time'?
I think you need to reset it later, otherwise bulletEmitter.rate will be equal 25 from the first 90 degrees and forth.
Benny


When in doubt, delete history and freeze transformations.

My latest snake game
(Requires DirectX9 SDK and Framework)
# 3 11-08-2008 , 01:30 PM
pbman's Avatar
Subscriber
Join Date: Mar 2005
Location: London
Posts: 1,135
yes ur right i need an else statement

i used this
bulletEmitter.rate = (frontGunGroup.rotateZ % 90) ? 0 : 25;
//code to make emit on 90 degree intervals

however it emits with a rotate value of 0
i need to omit this value any ideas how


Now at SMU doing BSc 3D Computer Animation so its hard to get on here
My wire render tut https://forum.simplymaya.com/showthre...threadid=20973
# 4 11-08-2008 , 04:45 PM
pbman's Avatar
Subscriber
Join Date: Mar 2005
Location: London
Posts: 1,135
fixed it now


Now at SMU doing BSc 3D Computer Animation so its hard to get on here
My wire render tut https://forum.simplymaya.com/showthre...threadid=20973
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads