Target bones between different bone layers

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
StarvingArtist
Posts: 5
Joined: Tue May 24, 2022 4:34 pm

Target bones between different bone layers

Post by StarvingArtist »

Good evening!

I've been struggling with this for a while. I need to be able to link layers between 2 separate rigs (i.e. 2 bone layers) so that the characters interact with each other.
Whilst I did come across this old post from 2016, the issue was never solved. Putting both characters into a single rig isn't feasible for this project & ideally, I'd like to avoid having to manually animate the scene.
viewtopic.php?t=28645

Since it's now been a number of years since that thread, I was hoping that there may be a new workaround or overall solution.

I should also note that I'm currently using a script, which I can't remember the name/author of, which allows linking bone layers. However, that has it's own problems regarding scaling issues.

If anyone has any help or advice, I'd greatly appreciate it.

Thankyou in advance!
- S
User avatar
Greenlaw
Posts: 10392
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Target bones between different bone layers

Post by Greenlaw »

What do you mean by interacting?

For example, do the characters need to hold hands? Do they need to hand off an item to each other? Do they both need to be attached to something? There are ways to do any of these things but they each require different methods.

We might be able to help with more information.
User avatar
Greenlaw
Posts: 10392
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Target bones between different bone layers

Post by Greenlaw »

Regarding linking bones, someone wrote a script recently that simulates sharing bones. I believe it did this by having a selected bone read the world position of a bone in another layer and baking the keys so it had the same relative position on screen. I haven't used this in production yet but it seemed like a good way to get characters to 'share' a bone.
User avatar
Greenlaw
Posts: 10392
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Target bones between different bone layers

Post by Greenlaw »

Ah, here we go...

MR Track Bone Script

I haven't tried this script for actual production work yet, but it worked well for me in a quick test back when Eugene released it.

Come to think of it, this script probably makes the methods I implied in my first post obsolete.
StarvingArtist
Posts: 5
Joined: Tue May 24, 2022 4:34 pm

Re: Target bones between different bone layers

Post by StarvingArtist »

One character needs to be holding onto the other in a scene where they are both moving. I can't be too specific due to the terms of my NDA, regardless, this shouldn't matter. I just need to be able to link between bone layers (set target bones).

Unfortunately, that's the one I'm currently using. Which, as stated, is causing problems related to the fact that the characters have been scaled down. i.e. it doesn't seem to scale translate.

Thanks for your time,
- S
User avatar
Greenlaw
Posts: 10392
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Target bones between different bone layers

Post by Greenlaw »

Yeah, I think the above script should work. You can use it to track a relevant bone in the 'carrying' character's bone layer and use the bone in the second character's bone layer to move it along with the first.

The only shot I've done in the past that was similar was maybe Thighsander Plunderhorse and Norge Grendelfist holding hands...you can see this near the beginning of my 2017 demo reel:

My 2017 Demo Reel

it starts at around 0:39, and it's also done in the next related shot where they're running across the bridge while holding hands.

This is pretty old and it was done in Anime Studio (Moho) 11. If I remember correctly, I animated a target bone for the hand in one character's bone layer, and then copied and pasted that bone to the other character so it's hand would target it.

Technically, this is what Eugene's script does but it does so easily and much more accurately.
StarvingArtist
Posts: 5
Joined: Tue May 24, 2022 4:34 pm

Re: Target bones between different bone layers

Post by StarvingArtist »

Aaah, okay, I see. Thankyou for the clarification there!
Is that a parented bone or a free-floating bone?

I'm wondering now why the script isn't working correctly for me. Perhaps something I've done has caused the issue, or maybe the program is having a moment.
The project file is very large at this stage, after all. In hindsight, splitting it up into smaller 'scenes' would have been a good idea.

Thanks
- S
Daxel
Posts: 1081
Joined: Wed Mar 27, 2019 8:34 pm

Re: Target bones between different bone layers

Post by Daxel »

StarvingArtist wrote: Wed May 25, 2022 2:23 pm
I'm wondering now why the script isn't working correctly for me. Perhaps something I've done has caused the issue, or maybe the program is having a moment.
The project file is very large at this stage, after all. In hindsight, splitting it up into smaller 'scenes' would have been a good idea.
I'm going to test the script to check if it is working correctly. So far, I have watched the author's (Mult Rush) explainer video and he says that the layer transforms shouldn't affect it, but Z axis transforms will indeed cause problems because there will be some parallax effect. Is that what is causing your problem?

https://www.youtube.com/watch?v=r5LB2co8dzk
Daxel
Posts: 1081
Joined: Wed Mar 27, 2019 8:34 pm

Re: Target bones between different bone layers

Post by Daxel »

Yes I can confirm that layer scale and X-Y translation doesn't affect this script at all. I even scaled and translated both layers during the tracked animation and it still worked correctly. It is pretty amazing and super useful.

Check that Z axis, and also check that you are not using any of the offset options that are there to not follow the other bone precisely but relatively.
User avatar
Greenlaw
Posts: 10392
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Target bones between different bone layers

Post by Greenlaw »

StarvingArtist wrote: Wed May 25, 2022 2:23 pm The project file is very large at this stage, after all. In hindsight, splitting it up into smaller 'scenes' would have been a good idea.
It's common practice to animate each scene as a separate project file. Animation files can be resource heavy so it's always best to break out scenes individually, and then put together the rendered output in another program (i.e., a video editor.)

The typical animation production workflow is to...

1. first create an animatic of your short in a video editor. Here you work out timing and how all the individual scenes will cut together. An animatic is essentially the blueprint of your production, and you shouldn't begin animating until you have one.

2. mark each scene in your edit and export a clip for each scene.

3. import the clip to Moho and animate your project to the timing of the clip.

4. export the animation from Moho.

5. import the animation to edit in the video editor and and overcut the corresponding scene in the animatic. This is normally done in a separate 'finals' track above the 'animatic' track.

Once you've overcut all the animatic scenes in the animatic, you have a short film.

There's more to the process but that depends on the scope of your project and the techniques you wish to employ. But the above is the whole process in a nutshell. If you need more information, there are threads dedicated to this topic elsewhere in this forum.

I don't know how you have your project set up, but you might consider breaking it apart. The easiest way to do that is to duplicate the project for each scene, re-name each project for its specific scene (for example: s001, s002, etc.), and delete everything from the scene that's not part of the scene.

It's common to create all your assets as separate project files (Character rigs, backgrounds, props, etc.,) and then import them to your scene projects as you need them. This keeps the memory and processing overhead efficient and easier to animate with.

In brief, it's all about planning.

Hope this helps.
StarvingArtist
Posts: 5
Joined: Tue May 24, 2022 4:34 pm

Re: Target bones between different bone layers

Post by StarvingArtist »

Daxel wrote: Wed May 25, 2022 3:19 pm Yes I can confirm that layer scale and X-Y translation doesn't affect this script at all. I even scaled and translated both layers during the tracked animation and it still worked correctly. It is pretty amazing and super useful.

Check that Z axis, and also check that you are not using any of the offset options that are there to not follow the other bone precisely but relatively.
Thankyou so much for this, it's incredibly kind of you to do the leg-work there. Really appreciate it!
I agree, it's a really useful script! I do hope that it'll eventually become a native feature to Moho.

Thanks again,
- S
StarvingArtist
Posts: 5
Joined: Tue May 24, 2022 4:34 pm

Re: Target bones between different bone layers

Post by StarvingArtist »

Greenlaw wrote: Wed May 25, 2022 3:35 pm It's common practice to animate each scene as a separate project file...
Oh I know, believe me, I usually would. Initially this was a much smaller project, but the scope of it has changed and grown over time. Gradually, so I didn't quite see it at first. Alas, I've learned not to yield to my own stubbornness for next time!
Fortunately it's very near completion so I'm not too worried about splitting it up at this stage.

Sorry if it was too long ago to remember but I don't suppose you know if, in your example, you used a parented bone or a free-floating bone?

At this point, I've worked around it using a target bone & some manual work. It actually took a lot less time than I thought it would, but the information I've gathered here will still be greatly useful in making life easier in the future!

Thanks in advance,
- S
User avatar
Greenlaw
Posts: 10392
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Target bones between different bone layers

Post by Greenlaw »

StarvingArtist wrote: Wed May 25, 2022 9:34 pm Sorry if it was too long ago to remember but I don't suppose you know if, in your example, you used a parented bone or a free-floating bone?
In that example, it was probably free-floating, and the characters were animated 'in-place', and their main groups were moved (transformed.)

But parenting depends on your intent. If the targeting bone needs to move with the character, it should be parented to the character...maybe to root bone but it really depends on the animation. For example, one common trick I use a lot is to parent target to a character's hips so I can pin their hands to their hips. Parenting in Moho is dynamics so you move targets around and reparent them at anytime.

If you're using the baking script, it doesn't matter because the script is ignoring hierarchy and recording the world coordinates of the bone. This is how it works across different character/bones setups
Post Reply