Follow Points Script Idea

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
DK
Posts: 2856
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Follow Points Script Idea

Post by DK »

Is this possible? A script that will make slave points/bones follow or trail behind a lead point/ bone? If it were possible it would be great to be able to control the trail speed of the slaves.

Many times I've come across a situation where this would be extremely usefull, ie animating a whip, rope, tentacle, snake etc . Is there something out there already that can do this?

Cheers
D.K
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

I was thinking the EXACT same thing when working on my physics script for bones. One of my examples does what you described, a whip like elastic springy rope... thingy, however it uses bones. I would very much like to apply that "physics" concept to POINTS instead of bones if possible.

I am positive it could be done however it is more difficult than applying this behavior to bones. I really should give it a shot one of these days. Having physics applied to points as well as bones could have enormous advantages.

Point groups have some issues but I think bones could be used to create "pseudo" point groups. Binding points to a named bone would be identical to assigning a group of points a name.

It's on my list. ;)

-vern
User avatar
DK
Posts: 2856
Joined: Mon Aug 09, 2004 6:06 am
Location: Australia

Post by DK »

Binding points to a named bone would be identical to assigning a group of points a name.
Yes this would be extremely useful even for doing things like schools of fish or flocks of birds. Is it more difficult to make several vector layers follow a lead layer or group layer? (I'm not a scripter so just guessing here), but I imagine it would be the same as scripting for bone layers without the extra complexity of bone data.

Cheers
D.K
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

It's all "easy" I suppose. The problem with me is I've spent so much scripting time focused on bones. I'm too "specialized". ;) Learning to apply the same things to points and layers will mean focusing on it more.

Bones do have advantages because they are a bit more simple to script. Since one bone can control any number of points it's easier to script the behavior of one bone than it is to track bunches of individual points. Point groups have problems because they can "vanish" or "change" when copying and pasting, adding or deleting points.

My thought would be to use bones to "group" points only for scripting purposes. The points would still be animated as points but binding to bones keeps them in groups better. One of the things that intrigued me with the physics stuff was a Flash Actionscript that created "rubbery" bouncy objects. In AS this would be best handled with point level scripted animation, otherwise you would need a bone for each point. The bone could define the point group and then the "rubbery" physics could be applied to the points controlled by that bone.

Same thing in this case. A group of points that represents a "whip" would be bound to a bone with a specific name so the script can easily access it and the point groups are easy to maintain... at least in my opinion anyway. I think to a way could be devised to determine the direction of points based on location. So a whip or rope could follow gravity based on the location of each point rather than the ID.

When I get inspired again I will give this a shot.

-vern
Post Reply