Question about custom attribute in rig

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  09 September 2013
Question about custom attribute in rig

hi, i add a custom attribute in my controller, and my question is how can i make it to do automatic animation like, the one in metal fly rig, when i change the value of the fly controller to 1-10 his fly automatically move. how can i do something like that. thanks
 
  09 September 2013
Hi
Do u mean the flap of a wing connected to an attribute?
you can do by connecting the attribute to a multiply/divide node input 1x and the time (u will get it when you open DAG nodes) to input 2x. Finally connect the output x to the Rotation axis of the fly's wing. Result play the time line you can see it. The attribute value will have the control on the speed of the wing flap.
Rgds,
__________________
Prem
Download Vehicle Rig
Blog
 
  09 September 2013
Hi ffpc123,

for me the easiest way to achieve that kind of control is to use Maya "sine" function.
To do this you have to do 2 things, add some custom Attributes and set an expression on the wing rotation. Try it on some cubes first, so create 3 cubes, one at the center and name it "body" and one on each side of the "body" cube and name them wing_right and wing_left.

Now add custom attributes to your "body" cube: amplitude, frequency, offset and rotOffset. Then open the expression editor (Window-->Animation Editors-->expression editor) and write this simple expression.

$amplitude = body.amplitude;
$frequency = body.frequency;
$offset = body.offset;
$rotationOffset = body.rotOffset;

wing_right.rotateZ = (sin((time*$frequency)+$offset)*$amplitude)+$rotat  ionOffset;
wing_left.rotateZ = -1*(sin((time*$frequency)+$offset)*$amplitude)+($ro  tationOffset*-1);

the first part is only to collect the values of custom parameters added on the body and to make easier to write the expression for the two wings.

the second part is the expression that drives wings rotations. Aplitude is used to set how much the wings flaps, frequency sets how fast, offset is to offset the flap in time and rotationOffset is used to make them flap higher or lower.

note that on left wing i multiply the expression by "-1" and be sure that objects and attributes names in the expression and in the scene are the same.

on the link below you can find an example file, hope you can find it of some help.

Wings.mb


cheers,
Giulio
 
  09 September 2013
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
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 08:21 PM.


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