Layer depth between two rigged characters please help!

General Moho topics.

Moderators: Víctor Paredes, Belgarath, slowtiger

sakisbates
Posts: 3
Joined: Mon Aug 01, 2022 7:17 pm

Layer depth between two rigged characters please help!

Post by sakisbates »

Hello everyone :).
I am new to 2d animation and i really need help with (i hope) a simple issue.
Lets say i have 2 rigged characters and i want to make them hug on a scene.
How do i set layer depth so the arms head and body are not staying in the back.
For example first character arm must be between second character head and arm.
I made a simple example to explain what i mean.(i cannot explain it any better with my bad english)
https://ibb.co/rkhKCy0
User avatar
Greenlaw
Posts: 10466
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Layer depth between two rigged characters please help!

Post by Greenlaw »

There are two ways to do this.

1. Put both rigs in the same bone layer so all the artwork falls under it. This allows you to sort the artwork anyway you like. This approach is practical for only simple characters; it might get messy for complicated characters.

If you have rigs that more complicated than the box figures from your example and you want to keep the rigs separated, this following approach is better...

2. Make reference copies of your character(s) for FG/BG separation, then hide (click the eyeball) for the layers you don't want to see in each copy. Then you can sort the layers to make the hug look properly nested.

Tip: In this situation, It's import to animate ONLY the original layers. If you add keyframes in either reference layer, you break the connection and the references will no longer be in sync with the original. If you break the connection, can correct it by r-clicking the reference and choosing Sync All Channels To Original, but be aware that you will lose any changes you made to it. (You can copy those changes to the original before synching if that's practical.)

When working with reference layers, I like insert the text 'REF' or 'REFERENCE' at the beginning of the layer's name and color code it with a bright color (Red or Orange is good.) This helps keep me from unintentionally animating these layers. If you're comfortable with adding scripts, you might also consider installing Synthsin75's Lock Layers tool to lock the reference layers.

Hope this helps. If I have time later today, I can post an example if you wish.
User avatar
Greenlaw
Posts: 10466
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Layer depth between two rigged characters please help!

Post by Greenlaw »

Just found what I think is a bug. In the post above I previously wrote that I like to append the reference layer name with 'REF' or 'REFERENCE', but what I meant instead was I like to insert the text in front of the reference layer's name. (I've updated the post.)

What happens when you append the reference layer's with text is Moho will replace the entire layer name with only the added text. So if the reference layer's name is 'BonesA' and you change it to 'BonesA REF', the next time you open the project the layer name will be just 'REF'.

But if you change the layer name by inserting text in front of the layer name, like 'REF BonesA' or 'REFERENCE BonesA', Moho is totally fine with that.

This happens in either Moho 13.5.5 or 12.5, so this behavior has been around for a while. I guess in the past I've only ever inserted text at the beginning of the name not after, so I never noticed the problem before.

Anyway, just thought to mention this before this confuses anyone else here. It sure confused me. 😸

I started putting together a demo project during my lunch break. Will finish and post it after work tonight.
User avatar
synthsin75
Posts: 10280
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Layer depth between two rigged characters please help!

Post by synthsin75 »

I'm not able to replicate that reference layer naming behavior, Dennis.
Don't know if you're doing something different.
User avatar
Greenlaw
Posts: 10466
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Layer depth between two rigged characters please help!

Post by Greenlaw »

Strange. I'm able to repeat this here in both 12.5 and 13.5.5.

It's probably not the setup because there really isn't anything to this project...just a bone layer with a few simple vector layers inside, and a reference of that bone layer with its vector layers. But I've been using the same stripped down Project file in these tests and maybe there's something corrupted about it.

Will test with a clean file tonight and post an example when I'm sure this is reproducible.
Last edited by Greenlaw on Wed Aug 03, 2022 12:07 am, edited 1 time in total.
User avatar
Greenlaw
Posts: 10466
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Layer depth between two rigged characters please help!

Post by Greenlaw »

I wonder if any third party scripts are causing the problem. Probably not since I'm seeing this in Moho 12.5 too and I haven't installed any new scripts to that version in ages.

Will try with the stock scripts tonight to be sure.
User avatar
Greenlaw
Posts: 10466
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Layer depth between two rigged characters please help!

Post by Greenlaw »

Figured it out. The problem has to do with using a parenthesized letter after the layer name. Somehow this messes up the Reference layer renaming. I discovered this also happens when using the Duplicate command, so it's not specifically a Reference layer thing.

More info: It doesn't happen when you place a two or more letter word inside the parenthesis, or use an empty parenthesis, so I'm guessing the Layers window is confusing this for a shortcut command.

Anyway, avoid using parenthesized single letters in a layer name and you should be good. (FYI, I don't normally use parenthesis in a layer name which is probably why I haven't seen this before.)

Submitting this as a bug tonight.
Last edited by Greenlaw on Wed Aug 03, 2022 12:56 am, edited 3 times in total.
User avatar
Greenlaw
Posts: 10466
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Layer depth between two rigged characters please help!

Post by Greenlaw »

Oops! I just realized I left the parenthesized letter out of my earlier example, which is why that example doesn't produce the error.

So, instead of 'BonesA' try 'BonesA (B)' or 'BonesA (W)'. The error probably doesn't happen with every letter but it happens for the handful of letters I tried so far.

(Boy did I go off on a tangent.) 😸
Last edited by Greenlaw on Mon Aug 08, 2022 5:46 pm, edited 1 time in total.
User avatar
synthsin75
Posts: 10280
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Layer depth between two rigged characters please help!

Post by synthsin75 »

This is being caused by my layer shortcuts script. I have it set to automatically remove shortcut key indicators from the layer name, if the layer doesn't have a user tag with the shortcut.
If you use that script and don't use the layer keyboard shortcuts, you can comment out line 637.
User avatar
Greenlaw
Posts: 10466
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Layer depth between two rigged characters please help!

Post by Greenlaw »

Ah! So it was a script after all. (Layer Shortcuts is in my 12.5 too.)

Thanks for figuring that out Wes. Will give the edit a try.
User avatar
Greenlaw
Posts: 10466
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Layer depth between two rigged characters please help!

Post by Greenlaw »

Hi Wes,

That did the trick! Just to be sure, the line to comment out is this one, correct?:

Code: Select all

layer:SetName(string.match(layer:Name(), "%(.%)(.+)"))
On my computer this is line 643, but mine has other tweaks and comments previously inserted.
User avatar
synthsin75
Posts: 10280
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Layer depth between two rigged characters please help!

Post by synthsin75 »

Greenlaw wrote: Thu Aug 04, 2022 5:49 pm Hi Wes,

That did the trick! Just to be sure, the line to comment out is this one, correct?:

Code: Select all

layer:SetName(string.match(layer:Name(), "%(.%)(.+)"))
On my computer this is line 643, but mine has other tweaks and comments previously inserted.
Yeah, that's the line. I've probably made some edits to mine since I released it.
sakisbates
Posts: 3
Joined: Mon Aug 01, 2022 7:17 pm

Re: Layer depth between two rigged characters please help!

Post by sakisbates »

Thank you for your answer.
You are very kind and helpful.
I am gonna try the reference layers option and see what happens.
Thank you again.
User avatar
Greenlaw
Posts: 10466
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Layer depth between two rigged characters please help!

Post by Greenlaw »

Hi sakisbates,

Whoops...sorry for getting distracted. Here's the example I meant to post last Friday:

This is the original setup, similar to the example you posted...

Image

And here it is with a reference created of each rig layer and sorted...

Image

The originals and references are the same but with different visibility settings for certain layers as shown here...

Image

Here's a short recap for working with reference layers...

When editing the animtions, be sure to edit only the originals, not the references. There's nothing wrong about editing a reference but when you do this you break the synchronization with the original.

This is why I have the reference layers clearly marked REFERENCE and highlighted in orange, to remind me not to touch these layers for animation. Another way to prevent unintended animation is to use Synthsin75's Lock Layers script.

If you accidentally animate a reference layer and break the sync, you can re-sync it by r-clicking the layer and selection Sync Channels To Original. If you want, you can copy and paste any keys you made to the reference to the original before you re-sync the reference.

Hope this helps, and good luck! 😺

P.S., as shown here, you can disregard everything I wrote about appending reference layer names...unless you use Layer Shortcuts, in which case you should modify the script as instructed.
User avatar
Greenlaw
Posts: 10466
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Layer depth between two rigged characters please help!

Post by Greenlaw »

Here's the file if you want to poke around in it...

hugs_02.moho
Post Reply