Wave hello, wave goodbye

Hi chaps and chapettes. I am trying to create a script or some code that makes use of the sine function. Predictably, I am trying to create an oscilating action with position, rotation or combinations of both. The most obvious action would be to automate and animate objects in a snake like way, but I am more interested in the code that needs to be written in order to create an oscillating action. I have seen there are tentacle scripts that make use of this, but most are wrapped up in formats that do not give access to the source code. Any pointers to fundamental useage would be appreciated.

I have done this in MEL, but am porting to Maxscript so the syntax is a little harder to grasp. The Maxscript macro recorder is not very helpful and the documentation is a little splintered.

Thanks

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture
br0t's picture

I once created an oscillating

I once created an oscillating rotational object to animate a swimming whale. It used an expression controller in the corresponding y-rotation-animation-track and two custom attributes (amplitude and frequency) that were linked to sliders for control.

The expression controllers script for the rotation value was like this:
sin((F+2)*Freq)/Amp
with F as the starting constant, and Freq & Amp selfexplaining.

You could look in the MXS help for "expression controllers" and "custom attributes" maybe that can help to get you started. I myself dont really remember if I createdthe expression by script or just manually.

cheers

Never get low & slow & out of ideas

AutonomyTD's picture

helpful

Cheers guys, I will look into it. I guess I was looking more for a way to script it rather than go in and do it manually, but I am still getting to grips with the way max handles things. It just seems so much easier to do this kind of thing in MEL but again, lack of Maxscript experience is what is stopping me from doing that. I have to admit though, finding out how its done is just as much fun (even if I do have "moments" of unbridled confusion)

Si ne tentare quomodo scis?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.