Smart bones: can 1 action for both directions work?

General Moho topics.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
drichird
Posts: 85
Joined: Sat Sep 07, 2013 11:14 am
Location: Los Angeles

Smart bones: can 1 action for both directions work?

Post by drichird »

Since we're on the subject of smart bones, I was wondering. Most tutorials I have seen recommend 2 actions (bone_name and bone_name 2) if the bone moves in both directions from resting state. But I created an action for very simple rectangle and 2 bones which moves both ways (keyframe at max one way, then back thru rest state to other extreme for 2nd keyframe), and it seems to work. Will this lead to future disaster?
User avatar
heyvern
Posts: 7045
Joined: Thu Sep 01, 2005 8:49 pm

Re: Smart bones: can 1 action for both directions work?

Post by heyvern »

I actually thought the same thing and tried this way back when smart bones were first added to ASP. I noticed that there is a "flicker" when the bone rotates over the "0" position of point movement. It's like it's conflicting with the default 0 position of frame 0.

I believe it creates a "conflict" when the bone rotates "over" the "default" angle. The "0" angle or default angle (frame 0) is like a neutral position not effected by the SB. One action does something in one direction, the other in the other direction. To do both sides of an SB in one action, you would have to include that neutral position as part of the action. It could cause issues.

After playing around with this, it "seemed" to work but caused issues so I abandoned it and stuck with the two action set up. To be hones the two action set up is much better, has more options and less problems.
User avatar
drichird
Posts: 85
Joined: Sat Sep 07, 2013 11:14 am
Location: Los Angeles

Re: Smart bones: can 1 action for both directions work?

Post by drichird »

Thanks a bunch heyvern I will stick with the proper method then. Lucky for me you spent the time and effort researching that possibility, since as I am finding out as a newcomer it takes forever to make even a small animation, workflow seems to be a key and it's good to use any possible shortcuts. So it would have been nice and simpler to just have one action and I probably would have gone down that path thinking how clever I am until suddenly (too late!) noticing everything had a flicker. Sure is nice to have a forum of dedicated AS users who can save me a LOT of time and pain!!! Thanks again! :D
User avatar
heyvern
Posts: 7045
Joined: Thu Sep 01, 2005 8:49 pm

Re: Smart bones: can 1 action for both directions work?

Post by heyvern »

Oh crap... sorry dude.

I spent some more time on this and it's possible that using one action in a specific way IS OKAY!!!!! I think you are okay as long as you set it up correctly which you probably have since you didn't see any problems.

When thinking about doing this, there is a bunch of ways to put in the keys for a single/double smart bone action. When I saw "glitches" it was because I was doing it the wrong way.

Smart bones can start at any angle. The key to this working is that you "split" the double smart bone on either side of the "default" frame 0 rotation.

In this example:
Smart bone frame 0 position is "0", pointing to the right.
This position is the "off" or default position.

SB Action 1: 90 deg (straight up)
Default - 0 deg
SB Action 2: -90 deg (straight down)


This can works fine with no problems as a "single/double" SB action set up like this:

SB action bone requires 3 key frames:
Key frame 1: Must be on frame 1. the first side of action:
Key frame 2, the default "0" position. This key is the "middle" between frame 1 and key frame 3.
Key frame 3: the opposite angle of frame 1. This key can be any where down the time line. Further down, better "resolution" of the action.

In this example:
Key frame 1: 90 deg, frame 1.
Key frame 2: 0 deg. Frame 48 (middle, between 1 and 96).
Key frame 3: -90 deg. Frame 96

This second side of the action must be the opposite angle of the first part on frame 1 and can not overlap any rotation.
You can't have any part of the bone rotation controlled by both sides of the double action.

The "middle" or second key set to 0 angle is for the "missing" default position. By having both sides in one action, the "default" uncontrolled points is completely gone. You always have a "mix" of each side of the action, and never get that original "frame 0" position of the smart bone.

Because of this you would have to "put it back in". So you need to put in a key for the 0 deg angle of the bone, or whatever that angle is on frame 0, and also copy/paste keys of points (or anything other channel keys) onto that key.

This set up will work and not cause flickering or issues. However, in my opinion it is more work than creating two opposite actions. You have to add more keys and it's a bit confusing.

A simple two sided smart bone requires at minimum, only 2 key frames. For each action you only really need a single key on frame 1.
Putting both in ONE action ALWAYS requires at least 3 key frames and they have to be spread out over time.
The other issue is keeping track of "frame 0" point motion. With the second key frame of a "double action", you always have to copy frame 0 to that key if any layers change on frame 0. With 2 actions this is handled automatically.

Anyway, I plan to stick with two actions. I just wanted to let you know that I was wrong, and using one will work.
User avatar
drichird
Posts: 85
Joined: Sat Sep 07, 2013 11:14 am
Location: Los Angeles

Re: Smart bones: can 1 action for both directions work?

Post by drichird »

Thanks heyvern that makes sense. As long as the action keyframes are all in one rotational direction from one extreme to the other it seems like it should work flicker-free, but like you said the default keyframe at 0 is no longer there I did not think of that, so it must be re-inserted, so from a workflow standpoint there's no work really being reduced so better to just follow the standard 2 action method. Thanks for the research !!!
User avatar
heyvern
Posts: 7045
Joined: Thu Sep 01, 2005 8:49 pm

Re: Smart bones: can 1 action for both directions work?

Post by heyvern »

drichird wrote:... Thanks for the research !!!
No problem. Apparently I had already done the research and totally forgot the results. :)
Post Reply