MichelVictor

Is it possible to make a constraint relative to other atributes like Position to Scale or Rotation?
For example move a bone to 20 X is relative to scale 0.2 on X, or rotate to +2º.
Or anything like that in any proportion or direction.
MichelVictor
  • Postovi: 86

Nate

It's not possible yet, but we plan on doing exactly that!
Avatar
Nate

Nate
  • Postovi: 11795

IanM

Looking forward to that, it's one of the things at the top of my wishlist!

For anyone looking for a workaround in the meantime, I've had some success using chained constraints and hierarchy contraptions to transform different types of movement into one another.

For example, say you want to turn translation on bone A into rotation on bone B. You can attach a third bone (C) as a child of A, and have it use an IK constraint to look at a bone you've placed somewhere stable relative to A (probably A's parent). If placed far enough away, the rotation of the IK constraint will move at a fairly constant rate as A translates around, which you can map wherever it's needed.

In my case I needed precise rotation, so I ended up going to wolfram alpha and having it calculate derivatives for me so I could figure out an anchor position that'd give me predictable x degrees degrees per y units movement. As long as the rate of change/second derivative stayed stable over a given range, it'd do the trick. I ended up putting the anchor at 3288.8, 1000 relative to the control, which gave me something like 5 degrees stable rotation for every 300 units translation... I think? It's a blur of weird equations and half-remembered calculus.

You can also go the other way, turning rotation into a sine-wave translation. Three nested calculator bones (A, B, C, each the parent of the next) can do this; set one scale axis of A to 0, use a constraint to map the rotation to B, then place C some distance from B; as the bone that controls B rotates, C will move in a sine wave pattern that you can repurpose, either with a constraint or by turning off rotation/scale inheritance and just attaching something directly.

I haven't tried it yet, but I think you could also do the same job by taking a rotating bone, attaching a child with a constraint that rotates it opposite its parent, and then track the end point like it's a steam piston... probably simpler overall!

Similar things can be done with scale by using the IK constraint (on a single bone) with compression/stretching enabled, and some really elaborate calculation can be done by chaining constraints correctly. I learned a lot of this while experimenting with a fake-3D rig for a foot that could yaw and pitch independently, which required some pretty strange convolutions to work!

Lot of gotchas and limitations of doing things like this, but all three of the basic transformation types (translate, rotate, scale) can be manipulated like this if you're creative about it and don't mind your constraint list getting intimidatingly long!
IanM
  • Postovi: 23

Nate

Cool ideas! It reminds me a little of those crazy people building computers inside of Minecraft: :bigeyed:
Avatar
Nate

Nate
  • Postovi: 11795

IanM

It definitely got a little out of hand, yes! At points I felt like I was suddenly doing geometry homework again. Now that you mention those redstone monstrosities I almost want see if logic gates can be made in Spine, but I should probably resist that temptation. :)

This is a video I took of the most ridiculous thing I did, an early prototype of a two plane fake 3D rotation. I wanted to see if I could take the technique from the diamond tutorial and nest it. It shows the ability to rotate the ankle and lift the heel along the pitch plane, and about 45 degrees of useful rotation for a single image:



And this is the simplified version after more development, with five different rotation sprites:



Which looks a bit rough (especially with my sloppy draftsmanship on the art) but is probably acceptable if you're careful with how you animate it.

I don't want to hijack the thread more than I already have so I won't get too far into it, but you can see some of the calculator bones faded out underneath the foot (you might need to fullscreen to see them), and they enable most of the trickery on display, as well as compensating for a lot of edge cases and instabilities. Not sure if this is really a practical technique for production given the setup complexity, but it was an interesting proof of concept!
IanM
  • Postovi: 23

Nate

That is really cool, thanks for sharing! It's amazing what you guys come up with. I can't wait for us to be able to focus on more advanced constraints, as well as sliders, joysticks, and similar controls.
Avatar
Nate

Nate
  • Postovi: 11795

IanM

Nate je napisao/la:() as well as sliders, joysticks, and similar controls.
Ooh, that's interesting. What do you mean by that? Explicit editor-side, non-bone replacements for bone based rig controls?
IanM
  • Postovi: 23

Nate

Yep. Controls similar to using bones, but with bounds.
Avatar
Nate

Nate
  • Postovi: 11795

SilverStraw

Nate je napisao/la:Yep. Controls similar to using bones, but with bounds.
Nate is really giving us a teaser. :nerd:

@IanM: Good thing I found your post and video. I want to tackle the same problem as your boot.
SilverStraw
  • Postovi: 12


Natrag na Editor