Expression for windshield wipers

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 2012
Expression for windshield wipers

hello my fellow artists!!!

guys i am stuck with a car rig i am doing, everything is working good so far, but i can't figure a way out to fix the WIND SHIELD wipers. i tried using an expression and even some other expressions, but it keeps going inside the window(wind shield)... and how can i limit its rotations,

by the way, i have already freezed T,R,S of the wipers object, and i am thinking that is the reason why this expression is not working.

This is the expression i have tried on so far:

Wiper_left01.rotateZ = (sin (5 * time) * 50) + 325

i did try blendshapes as well, but that is a PAIN IN THE NECK!!!

Any tips? help?
  11 November 2012
I dont know much about your particular setup, but if I had to set this up, I'd do it with Set Driven Keys.

Basically I'd create an attribute, say 'Wipe', as float between -1 and 1. I'd set a driven key between Wipe and my wipers Z and X axes (or whatever they rotate along) so that when Wipe = -1 the wipers are in idle position (horizontal), and at 1 they'd be at their maximum rotation (vertical). Maybe I'd set a key somewhere inbetween those to values too. Then I'd go into the graph editor and edit the resulting curves so that the wipers travel as accurately as possible over the windshield without penetrating.
After that, write an expression to control the Wipe attribute (sin shoud give you nice values between -1 and 1).
  11 November 2012
that sounds like a method of doing it man...

ok i will try that, in the end will make switch for it, i will update you once i have results.

by the way just to let you know, i am rigging a mini cooper austin.

thanks again
  11 November 2012
dear nyro

thanks for the tip man... i did what you suggested me to do, so far there is no problem, but i can't figure a way to write the expression without any problems.

this is the expression i wrote:

// wind shield wipers

if(TopControl_mini01.wipers == 1){

Wiper_right01.wiperright = TopControl_mini01.wipers (sin * time);

}else if(TopControl_mini01.wipers == 0){

Wiper_left01.wiperleft = TopControl_mini01.wipers (sin *time);


TopControl_mini01.wipers is the attribute that i have added for controlling the wiper movement. i hid and freezed the translation and scaling of both wipers, made an attirbute on both of them. which means i made a new attribute on the wipers itself to control the rotation axis and i named it as wiperright wiperleft.

but i can't set a condition where if the main controller is set to 1, the wiperleft and wiper right starts rotating the wipers.

it did work once, but the wiper was in the middle of the place!!!

  11 November 2012
I'm a bit confused at your explanation, I'll be honest, but I believe you didn't actually use Set Driven Keys, did you?
  11 November 2012
yes i did use set driven keys, for instance if the geometry is named wiper_left01, i added the new attribute to the wiper_left01, which means the driver and driven are both in the same geometry attribute channel. so the whole set of attribute channel for wiper_left01 is as follows:

Rotate X
Rotate Y
Rotate Z
Wiper: which controls all the rotation axis

i hope this time is more clear..

thanks for following up on me.
  11 November 2012
hey man

i finally fixed it... thanks a lot for the earlier tips, it is working like a charm with an on/off switch. i will soon upload a feature presentation of the car rig.

this is the final expression:

// wipers

if(TopControl_mini01.wipers_on_off == 0){

Wiper_right01.wiperright = 0 * (cos (9.5 * time));
Wiper_left01.wiperleft = 0 * (cos (9.5 * time));

}else if(TopControl_mini01.wipers_on_off == 1){

Wiper_right01.wiperright = -1 * (cos (9.5 * time));
Wiper_left01.wiperleft = -1 * (cos (9.5 * time));
  11 November 2012
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed 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 09:55 PM.

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