SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 11-08-2008, 11:21 AM   #1
pbman
Subscriber
 
pbman's Avatar
 
Join Date: Mar 2005
Location: London
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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 http://forum.simplymaya.com/showthre...threadid=20973
pbman is offline   Reply With Quote
Old 11-08-2008, 12:43 PM   #2
BennyK
Registered User
 
BennyK's Avatar
 
Join Date: Oct 2007
Location: IL
Posts: 738
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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)
BennyK is offline   Reply With Quote
Old 11-08-2008, 01:30 PM   #3
pbman
Subscriber
 
pbman's Avatar
 
Join Date: Mar 2005
Location: London
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 http://forum.simplymaya.com/showthre...threadid=20973
pbman is offline   Reply With Quote
Old 11-08-2008, 04:45 PM   #4
pbman
Subscriber
 
pbman's Avatar
 
Join Date: Mar 2005
Location: London
Posts: 1,135
Thanks: 0
Thanked 0 Times in 0 Posts
Default

fixed it now
__________________
Now at SMU doing BSc 3D Computer Animation so its hard to get on here
My wire render tut http://forum.simplymaya.com/showthre...threadid=20973
pbman is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

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

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.