SimplyMaya Forums

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

 Register FAQ Members List Calendar Mark Forums Read

 31-10-2009, 02:14 PM #1 Jeremy2112 Registered User   Join Date: Feb 2009 Posts: 11 Thanks: 0 Thanked 0 Times in 0 Posts 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:
 31-10-2009, 06:22 PM #2 stwert EduSciVis-er   Join Date: Dec 2005 Location: Toronto Posts: 3,373 Thanks: 74 Thanked 710 Times in 642 Posts 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 Website - Blog - YouTube - Vimeo - Facebook - Twitter -->How to Effectively Ask Questions on Forums<--
01-11-2009, 01:08 AM   #3
Chirone
Subscriber

Join Date: Dec 2007
Location: NZ
Posts: 3,125
Thanks: 11
Thanked 147 Times in 143 Posts
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

Quote:
 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

 01-11-2009, 05:57 AM #4 Jeremy2112 Registered User   Join Date: Feb 2009 Posts: 11 Thanks: 0 Thanked 0 Times in 0 Posts 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 06:28 AM.
 01-11-2009, 04:57 PM #5 stwert EduSciVis-er   Join Date: Dec 2005 Location: Toronto Posts: 3,373 Thanks: 74 Thanked 710 Times in 642 Posts 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 Website - Blog - YouTube - Vimeo - Facebook - Twitter -->How to Effectively Ask Questions on Forums<--
 01-11-2009, 07:21 PM #6 Jeremy2112 Registered User   Join Date: Feb 2009 Posts: 11 Thanks: 0 Thanked 0 Times in 0 Posts That is a feature I have never used... I'll have to look into it. Thanks.

 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

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

\$34

Month-to-month billing

\$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.

\$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.