Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

Post Reply
User avatar
Víctor Paredes
Posts: 4946
Joined: Wed Jan 26, 2005 12:18 am
Location: Ireland/Chile


Post by Víctor Paredes » Thu Mar 12, 2020 3:50 pm

Do you know if something like wind could be done by a layer script?
I'm imagining having chains of bones reacting to wind. Something very similar to Dynamics, but having an external force pushing them instead of the body movement.
I'm thinking about this concept:

- In a bone layer, there are some bone chains with dynamics activated
- In the same layer, a bone called 'source1.wind' (or another name), defines the direction and strength of the wind
- The strength is defined by the bone Scale (so it can also be animated)
- The direction is defined by the angle of the bone
- Maybe the position of the bone can also play a role (as everything behind the bone won't be affected by the wind)
- I'm still thinking about how to control the spreading angle (angle constraints could be an option, but it's not an animated value animated)

I remember some very old posts from Heyvern playing with physics in version 5, maybe. So I'm thinking there is a chance something like this could be done.
What do you think?
Víctor Paredes
Former Moho Product Manager
Rigger and animator in Cartoon Saloon
My Youtube Channel - My webinars
Posts: 2193
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Wind?

Post by hayasidist » Sat Mar 14, 2020 1:27 pm

first reaction to this is that "wind" is not a point source (so no Spread as such) unlike a fan (which obviously does).

so for a wind simulation (rather than a fan), I'd address "spread" (and turbulence) by having many "source" bones that can operate independently (for turbulence) or in unison; and I'd (probably??) have them placed off screen and oriented such that their length and rotation is a vector with {x,y} components that map to {x,z} wind strengths (i.e. a bone as you've illustrated has an "across the screen component" and a "from behind the screen" component). Typically these bones will be set up as a set of (initially) parallel bones from bottom to top of the "target" area. Keeping life easy, (and to make the "fan" work as below) I'd not try to use z at this time!! (and, therefore, the bone chains don't scale to simulate motion in z) and all the wind bones are parallel to the x axis.

For a "fan" simulation (e.g. helicopter rotors; blast from a jet engine; ...) much the same model; but the bones are "at the source" and (rather than spread out and parallel) are positioned to define the spread. e.g. 3 bones all at the same origin {x,y} the outer bones have minimal length and are oriented to define the spread; the centre bone defines the direction and intensity as you've suggested.

Next is to take into account that some objects will significantly reduce the intensity of the force felt by objects behind them wrt the wind, others won't (e.g. a tree is a better windbreak than a reed).

then it's a "just" a question of deciding which bone in each bone chain to rotate by how much and when (e.g. if a "wind bone" has a keyframe - if this "reactive bone" is inside the "blast envelope" - rotate it...)
User avatar
Posts: 3369
Joined: Fri Oct 29, 2004 2:13 pm
Location: UK

Re: Wind?

Post by jahnocli » Sat Mar 14, 2020 2:30 pm

It sounds easy when you put it like that...
You can't have everything. Where would you put it?
Post Reply