Squash&Stretch Ball in Blender???

Hi,

I am trying to make a rig in Blender of famous Squash&Stretch Bouncing Ball. This is the old school rig to start practising animation. I suppose everyone knows AnimationMenor videos :slight_smile:

But as this should be piece of cake I am just hitting my head by keyboard. In Blender it is quite tricky and really hard.

The rig and controls should enable this:

  • Move and Rotate the ball. Ball should not be moved directly but by handle!
  • Squash and Stretch BUT INDEPENDENTLY on ball rotation. See pictures hereunder. Seems unsolvable in Blender because Stretch to constraint cannot influence the target in relative space.
  • Ball should correctly roll in when moved. This possibility may be possible to switch off when animator for example throw (i.e. move through air) the ball forward but rotate it independently (do you play football :slight_smile:
  • it should be possible to move the centre of Squash and Stretch (in real life the ball stretches one way when flying in air and other way when hits the ground)
  • all animation keys should be on rig or other controls not on the mesh itself (as this is the standard for animation)

EDIT 25. 4. 2008: Afters weeks of hard work I may say EUREKA. Final all featured released rig is available here:
http://blenderartists.org/forum/showthread.php?p=1102785#post1102785

I found excellent SOFTIMAGE example on the web - http://www.highend3d.com/xsi/downloads/character_rigs/Bouncing-Ball-for-XSI-4955.html
It is said to be based on Jason Schleiferā€™s Bouncing Ball Rig (animator of Golum if I am right :slight_smile:

http://static.highend3d.com/downloadsimages/4955/screen1.jpg

I would welcome any help. Maybe new python constraints (SVN) might help. But at this moment I am really frustrated and quite disappointed Blender is not ready and able to set up such a rig which is ā€œmustā€ for animation practising and training :slight_smile:

Iā€™ll see what I can come up with. Itā€™s been a while since Iā€™ve done much rigging. :slight_smile:

Aligorith

Lattices come to mind at first glance.

This was also my first tip. But did not succeeded. I am using SVN build.
My WIP so war was:

  • make UV spehre, assign material to see clearly orientation of this Ball
  • make a lattice (LatticeDeform)
  • UV sphere is deformed by LattticeDefrom
  • make a second lattice (LatticeDriver)
  • make an empty (whatever) as a Stertch to constraint driver (StretcDriver)
  • LatticeDriver is Stretch to constraint to StretchDriver empty
  • to each vertex of LatticeDriver vertex parent Empties
  • use Emtpies (that are vertex parented to LatticeDriver as Hooks for each vertices of LatticeDeform

But Ball rotation is not independent concerning it rotation even though it should. This also does not provide solution to move SquashStretch centre relating to the ball (you need it to be on the side of the ball when hitting the ground but in the centre of the ball when flying through the air).

Thank you for any information regarding your tests.

OK, try the following rig:http://aligorith.googlepages.com/bouncing_ball_rig.blend

WARNING: the file is 4mb, and will only work in SVN versions

This is just an initial rig. There are still some problems to resolve (i.e. auto-rotate feature isnā€™t working yet, there isnā€™t any way to control which way ā€˜squashes/stretchesā€™ more), bone shapes could be added, and the controls could be made more intuitive/simpler.

Aligorith

I have download it and just tested it for couple of minutes. There are some same problems that I was also facing with my approach described hereabove.

I am quite pleased that it is just you Aligorith who finds it interesting to participate in this ā€œultimate entry level animator rigā€ :slight_smile:

Stretch to script seems better approach then standard stretch constraint. But it seems quite tricky to which parameters of the ball it should be mapper. May be it would be better to map influence to the lattice. Because lattice in object mode should be transferable (i.e. rotated) without influencing the targeted object (ball).

In your rig is also one problem that I have already noticed in Blender earlier. When you rotate your Rotate bone it works OK along X.
But Y and Z rotates it other direction BUT WHAT IS STRANGE:

  • when I rotate Rotate bone using Y (green manipulator) it is in fact Z according to Transform manipulator panel (but Y according to header info line)
    when I rotate Rotate bone using Z (blue manipulator) it is in fact Y according to Transform manipulator panel (but Z according to header info line)
    I am not sure which parameter is right and evaluated by Constraints. (Maybe it has something common with gimble mode???)

Here I my actual WIP state as mentioned above - http://rapidshare.com/files/90632589/SSBouncingBall.blend
There should be activated Stretch to constraint Driven by StretchToDriver empty. But when it is activate it ā€œruinsā€ the concept :-/ It deforms not only the Lattice cage but rotates also the ball. Also this does not enable future step which is to rotate StretchToDriver. Because the Stretch to constraint evaluates its world axes not local ones which is quite a pity.

I know very little about scripting which would definitely help. Maybe it would be enough to apply volume preserve script driven (scale of other two axes = 1/ square scale of third axe that is changing its scale) by lattice scaling?

I have made a ball rig before. I hope it would help you.

Red: location, rotation and size
Blue: Squetch
Yellow: Floating control
Green: Rolling along X axis
http://blenderartists.org/forum/showthread.php?t=102744

JiriH: I have yet to figure out a way to do a decent squash&stretch ball rig in Blender. Itā€™s ironic that we can do some fairly advanced rigs for Peach, but something as simple as a squash & stretch ball eludes me. Blender certainly doesnā€™t make it easy. In both XSI and Maya these things were (fairly) trivial.

Perhaps after Peach Iā€™ll give it another try.

squash and stretch can be shape keys on the lattice, driven by custom control shapes.

Iā€™ve only ever rolled balls by recording the BGE animation curve.

:yes::yes::yes: - on your website are excellent examples of super animations and what the result should be
http://www.cessen.com/portfolio/animation/mechanics/obstacle_course.mp4
http://www.cessen.com/portfolio/index.php?section=animation&item=mechanics
But Maya or XSI was used for this :wink:

But I can see the light at the end of the black tunnel.

Here is first pyConstranit that helps you to move the pivot - http://www.alienhelpdesk.com/python_scripts/pivot_constraint . I did not tried and test it but this may influence the centre of squashing. To rotate squash/stretch axes independently of ball rotation is still tricky. Standard Stretch to constraint also involves some rotation possibilities and influences to the constrained object which is pity.

Rolling of the ball can be solved by another pyConstraint (or even python expression for IPO). We just need to use ball axes and use expression y=2pir (for y axe) ā€¦ same for other axes. This pyConstraint may be ā€œmutedā€ by influence button.

I hope that there soon may be quite good pyConstraint repository for such things. I hope python coders will be enthusiastic to write dozens of useful pyConstraint as this superb new possibility is finally implemented in next release.

Thank you very much. I know this rig. But it does not have all the features mentioned in the beginning which is clear when you was not able to use some needed python constraints.

iā€™ll look forwards for the progress of thisā€¦ sounds like youā€™re gonna make itā€¦ :smiley:

JiriH:

Hmmā€¦ what exactly is the situation youā€™re trying to achieve. The rig I posted does SCALING INDEPENDENT OF ROTATION (i.e. ball can still roll, but squashing is not done along the ballā€™s local axes, but the ā€˜globalā€™ axes). Isnā€™t that what you required (are still looking for)? If not, how? Examples please.

Aligorith

Thank you for your interest Aligorith. I am playing with your test rig a lot. My problems mentioned hereunder were partially solved by using new build from Graphicall.

But there are still some bugs I would like to solve. I am quite busy toady in my job so have just a little time to play with Blender. I will definitely report on any progress.
So big thank for your blend file and script.

Sorry guys,

I am giving up. After two weeks and hours of testing I have not succeed to make a rig in matter which would fulfil the conditions hereabove. As I know practically nothing about python I am not able to code which probably may help (new pyconstratints).

I will probably download trial version of XSI as Cessen (Nathan) mentioned hereabove to practice such animation beginner S&S ball lessons.

I donā€™t know if you guys are still interested in this issue but I am also looking into rigging a S&S ball lately and I must say that the bones-only based approches that looked like they should work have all failed yet.

One issue I find particularly puzzling is the meaning of Local vs Global spaces. I read Ton explanation about those spaces and I think I get them but when I try to use them in constraints, they donā€™t give the expected results. I tried all 16 possible source and destination combinations.

What Iā€™m trying to do does work when I position the bones manually in a pose but it does not work anymore when the same bone is positioned from a copy rotation constraint. Here is my idea and approach:

In a parent / child bone hierarchy, if the parent bone is scaled on one single axis, the child is also scaled but along the parentā€™s local space. That is exactly what I want. And no matter how I pose (rotate) the child bone, it always gets scaled along the parentā€™s local space. But because I want the child bone rotation to be independent from the parent rotation, I constraint the child bone with a copy rotation to another independent bone. And when I add this constraint, the child bone scaling stop being along the parentā€™s space. It just copy the parent scaling along its own local space.

Is there any solution to this issue? If my explanation is confusing, I can prepare and post an illustration. If anyone can shed light as to the meaning of ā€œLocalā€, ā€œLocal with Parentā€, ā€œPoseā€, and ā€œGlobalā€ for both target and source I would greatly appreciate. Would that space conversion be usefull for what Iā€™m trying to accomplish or is that useless in that circumstance?

Iā€™ve also been looking at the script constraint possible solution. Thanks Aligorith for the script. That is a great start. Obviously, the keep volume part is a must have.

BTW, the equation to preserve volume should be ā€œ1 / math.sqrt(math.fabs( obsca.y ))ā€. Without the sqrt, the volume is not preserved.

PS. Sorry for resurecting this old thread but since you were already intrinsically interested in solving this issue, I thought I might join in.

From the sounds of things, youā€™ll need to write a pyconstraint for this. Iā€™m guessing that what needs to happen is that the order that transforms are applied, needs to be tweaked a bit for your purposes.

What currently happens is:
scale * rotation * location
What you want is:
rotation * scale * location

Aligorith

Cool! I did not look at it from this anglebut Yeah! You are right. That is an excellent explanation.

It turns out that this is not enough. It seems tha what I really need to do it is transform the ownerā€™s bone into the target bone space, apply the scale transformation and then retransform the ownerā€™s bone back into its own space. That is why it works when the bone is simply a child of the parent but it does not work otherwise. When the bone is the child, the transformations are applied into the parentā€™ space. But if the parent to child trnasformation relationship is broken by any means, then this does not work anymore.

I will work some more on figuring the chain of tranformation to accomplish that but if someone, who eats transformation for breakfast, can figure that in a blink, I would appreciate some help.

After some break I have given it another try. May be there be even two quite acceptable solutions (rigs). Some details have to be solved still. First test may be posted after final release of Blender 2.46.

I give up.

There is a strange switch of axis that I donā€™t understand. I keep having the same issue as Aligorith ball which rotates around a diferent axis than the rotation bone. I get that all the place and I think I would need to analyze the matrices in the debugger to figure a solution. But that would take me way off my goal and it is not worth all that time to solve the squash and stretch ball and I need to get back to my main project. So I decided to leave that problem and move on.