Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 31-10-2009, 03:14 PM   #1
Jeremy2112
Registered User
 
Join Date: Feb 2009
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Strobe light

I'm guessing the best way to go about making a strobe would be by using an expression. Problem is, i cant come up with what the "if" statement should be.:headbang:

I need to be a really fast strobe, like every other frame, or there abouts. I do hope I wont need to rwrite an if statement for each frame in the animation.

Or maybe an SDK would be a better way to go? I havent even begun how to do it that way, so if anyone has a clue, one way or the other, I would much appreciate it.:bow:
Jeremy2112 is offline   Reply With Quote
Old 31-10-2009, 07:22 PM   #2
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,371
Thanks: 74
Thanked 709 Times in 642 Posts
Default

don't know the syntax, but something like:

if frame is even, on, frame odd, off

so if frame/2 == int(frame/2), then on, else off
stwert is offline   Reply With Quote
Old 01-11-2009, 01:08 AM   #3
Chirone
Subscriber
 
Chirone's Avatar
 
Join Date: Dec 2007
Location: NZ
Posts: 3,124
Thanks: 11
Thanked 147 Times in 143 Posts
Default Re: Strobe light

the psuedocode you'd be looking for is something like

Code:
if ( frame is even ) 
then light.intensity = 1;
else light.intensity = 0;
to tell if the frame is even or not you could use the modulus operator (that's the %)

alternatively you can keyframe the light intensity and make the animation cycle in the graph editor

Originally posted by Jeremy2112
Or maybe an SDK would be a better way to go? I havent even begun how to do it that way, so if anyone has a clue, one way or the other, I would much appreciate it.:bow:
what? doesn't the SDK come with maya? that's why you can use it in Maya...
__________________


that's a "Ch" pronounced as a "K"

Computer skills I should have:
Objective C, C#, Java, MEL. Python, C++, XML, JavaScript, XSLT, HTML, SQL, CSS, FXScript, Clips, SOAR, ActionScript, OpenGL, DirectX
Maya, XSI, Photoshop, AfterEffects, Motion, Illustrator, Flash, Swift3D
Chirone is offline   Reply With Quote
Old 01-11-2009, 06:57 AM   #4
Jeremy2112
Registered User
 
Join Date: Feb 2009
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oh, my bad, by SDK I was referring to a Set Driven Key. I could have been more clear about that.

As for the bit of code there, it all makes sense, but I can't quite get the syntax right. also if you could explain the modulus operator a little.

I might go ahead and explain that this is basically the first time I am trying to use expressions, outside of copy/pasting snippets of code from various tutorials.

Edit:

I got it working with this little bit here :
pointLightShape1.intensity=time%2; :attn:

Which brings me to the next step:

I need this to drive the visibility if an object. The issue now is, I already have the visibility of the geometry being controlled by an expression, so in this case I will be need it to be a set driven key. Problem is, I cant figure out how to get the pointLightShape to load as the driver. I can only get the pointLight itself, which does not have an intensity attribute.

Supposing I could alter the expression to be on the pointLight visibility, rather than the pointLightShape?

I suppose this would be a good time to explain exactly what I am trying to do here, which is the muzzle-flash of a Gatling Gun. I have a group of Nurbs that serves as the actual glow/flame of the muzzle-flash. I have the expression for visibility on that set, so that it is only visible when the barrels are rotating. I now need for it to flash on and off it time with the pointLight.

Last edited by Jeremy2112 : 01-11-2009 at 07:28 AM.
Jeremy2112 is offline   Reply With Quote
Old 01-11-2009, 05:57 PM   #5
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,371
Thanks: 74
Thanked 709 Times in 642 Posts
Default

Try using the connection editor instead of a driven key... might work for you.

I think you could connect the intensity of the light to the visibility of the object.
stwert is offline   Reply With Quote
Old 01-11-2009, 08:21 PM   #6
Jeremy2112
Registered User
 
Join Date: Feb 2009
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That is a feature I have never used... I'll have to look into it. Thanks.
Jeremy2112 is offline   Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
glass se7enhedd Lighting & Rendering 18 10-12-2010 02:27 AM
Open Challenge -Jerry Can Texturing honestdom Battle Arena 77 03-12-2010 01:20 PM

Thread Tools





A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.