Page 1 of 1

Depth sorting needs improvement

Posted: Tue Jul 18, 2017 6:23 pm
by yueda
Hi, I am a 2D puppet rigger exploring the potential of Moho 12.
When comes to rigging, Moho 12 is much superior than Harmony but one thing I wish Moho handles better is Depth Sorting.
I suggest Moho to implement a new Depth Sorting method that:

-absolutely sort layers in depth based on each layer's Z-position value so users can animate the value to sort layers.
-This method will ignore each layer's X and Y rotation and also how far each layer's origin is from the camera.
-Similar to Harmony, when more than one layer has the same Z-position value, The method decides the Depth Sort based on layer stacking order in Layer Window.

I am currently using "Enable animated layer order" method but it is quite complicated and tedious when I have so many layers to sort depth.

I am aware that "Sort Layers by Depth" method supposed to do what I need but this method is not immune to 3D camera movement and also 3D rotation of layers:
Image
As you see in this GIF that layer sort order gets totally messed up when I rotate the parent group in space.
I can make each layers distant from each other in Z-Axis to solve this but that causes more troubles.
"Sort Layers by Depth" method is probably made for people who want to construct 3D rooms by rotating vector layers in space but that is not useful for me.

Re: Depth sorting needs improvement

Posted: Wed Jul 19, 2017 7:09 am
by funksmaname
Hi Yueda,
In your example it looks like 'sort layers by depth' is enabled... if you turn that off it will only use the actual layer position for order and would avoid the problem you are experiencing. If you want to sort the layers do it with 'animated layer order' on the main group - it will key layer order changes on the timeline.

Re: Depth sorting needs improvement

Posted: Wed Jul 19, 2017 10:46 am
by hayasidist
groups are treated as a single entity so, e.g. in your example where the mouth and eyes variously disappear -- if you have the face and features in a group without depth sort enabled and put that group in a group that is sorted by depth, that issue should go away.

3d rotation of layers (as I'm sure you know) can cause different parts of the layer to be at different z. Moho can't break the artwork in a layer into different slices according to different z -- the chin flipping in front of / behind the body is probably because of that. I'm also sure you have a perfectly good reason to have the different parts of the character in a depth sort group - but if you can put head and torso in a group and put that in a depth sort group (so that arms can go in front/behind??) that will go away too.

However, if you are aiming to use depth sort so that you can have the limbs automatically switch in front / behind - this is where most people do use animated layer order as funks has said. And this is where I'd agree with you that an enhancement (to automate the creation of animated layer order keyframes) could be very useful.

Re: Depth sorting needs improvement

Posted: Wed Jul 19, 2017 4:38 pm
by yueda
Hi Funksmaname and hayasidist, thank you for your answers.

Funksmaname wrote:
If you want to sort the layers do it with 'animated layer order' on the main group
Like I mentioned, I do use "sort layers by depth" method but it is very tedious if you have 20 layers to sort depth each time you rotate the character:
Image
I also created regular actions with Layer Order keys so I can sort all layers for the character at once.

The GIF I posted is just an example to show how 3D rotation messes up depth sort when using "sort layers by depth" option.
The rig I am working is much more complex and trust me, I tried all depth sort options available already.
The only solution is Moho to have a new depth sort that works for both smart bone action and 3D object/camera rotation.

Moho is a good software but missing opportunity to be popular because it lacks critical functions such as this.

hayasidist wrote:
And this is where I'd agree with you that an enhancement (to automate the creation of animated layer order keyframes) could be very useful.
I don't know what you meant by "automate the creation of animated layer order keyframes".
We can add Layer Ordering keys to Smart Bone actions while using "sort layers by depth" method so every time you move the dial, depth sorting gets updated automatically. With that said, here is the catch; in each layer, you can have only one timeline that has Layer Ordering keys. This is same as how Switch Layer keyframes work. That means, if you have made a Layer Ordering key on a smart bone action, you can no longer animate layer order in your main timeline. It means animators cannot change the layer order freely while animating.

hayasidist wrote:
if you have the face and features in a group without depth sort enabled and put that group in a group that is sorted by depth, that issue should go away.
True, and I do have group for the entire head parts for my rig. The grouping solution doesn't always work because, in some cases, it can mess up masking, bone binding, layer movement and so on.

Re: Depth sorting needs improvement

Posted: Sat Dec 08, 2018 11:47 pm
by synthsin75
If you don't want the layers sorted by depth from the camera, you are misusing the "sort by depth" feature.

You should be using animated layer order instead.

Re: Depth sorting needs improvement

Posted: Sun Dec 09, 2018 8:25 am
by yueda
synthsin75 wrote:
If you don't want the layers sorted by depth from the camera, you are misusing the "sort by depth" feature.

You should be using animated layer order instead.
It's been more than a year since I finished the project. I did use "animated layer order" since it was only option if you have 3D camera on.
It was pain because the 360 rig I created was quite complex. They also had to turnaround a lot while doing valley dances.

I think you are right that the behavior we see with "sort by depth" feature is not a bug.
I still think it will be great if we can just animate layer order using a value while it still works for 3D cameras.

I personally don't see the benefit of determining layer orders based on the distance between the camera and the object's pivot.
Why can't Moho stack layers simply based on z-depth values of each layer like Harmony does.

Re: Depth sorting needs improvement

Posted: Sun Dec 09, 2018 1:06 pm
by hayasidist
yueda wrote:Why can't Moho stack layers simply based on z-depth values of each layer
I think I see what you're getting at here -- we actually have many sets of axes -- the "universe" x,y,z; each layer's x,y,z; and the camera-centric x,y,z.

There are two "sort by depth" options in a group - one is "Sort by depth" (which I think uses "universe" z) and the other is "sort by true depth" (which I think uses "Camera-centric" z)

However, whether the layer is rotated in x/y (around its origin) or the camera has tilt/pan (x/y rotation around its "origin") even if the content of a layer spans a range of z - e.g. here the bottom of the tilted layer is at around z = +1 and the top is around z = -1
Image
moho still uses only its origin (here z=0) for its depth - and this can lead to the sorts of "unwanted" occlusions you've pointed out - especially where lots of layers have origin at z=0 and their rotations don't alter that.

But where you've got a group rotating in x/y about its origin, with sub-layers that have different origins, the sub-layers will move in z - e.g. - the head and torso layers are both at z = 0; but although they don't themselves move, when the group they're in swings, this moves them in both universe and camera z:

Image

and if you have depth sort on in that group they will flip.

But, e.g., by making the head and torso origins the same, rotating the group keeps them in the same order.

I think a lot of what you're asking is already there - it may be hard to see how to get it to work with a particular rig - but origin placement; grouping; and animated layer order should get you to where you want to be.

Re: Depth sorting needs improvement

Posted: Tue Dec 11, 2018 5:53 am
by chucky
You could have layers in the head group set to face camera ( set them first and then put them in the group).
Then the mouth eyes and face will stay perpendicular to the camera even when the group is changing depth.
This I assume should work :?:

I tried in this gif, the body head I wanted to switch by depth the eyes/mouth are in the head group but I wanted them to stay in front of the fac.
I might have misunderstood what you want to do.

Image

Re: Depth sorting needs improvement

Posted: Tue Dec 11, 2018 6:26 am
by synthsin75
Snicker....he's very excited about something above him. :wink:

Re: Depth sorting needs improvement

Posted: Wed Dec 12, 2018 1:46 pm
by chucky
Oh Yeah. Hehe. :lol:

Re: Depth sorting needs improvement

Posted: Sat Dec 29, 2018 6:34 am
by synthsin75
Here's a layerscript to solve this problem: https://sites.google.com/site/synthsin/ ... ects=0&d=1

Embed this in any group or bone layer with animated layer order enabled. Now the animated layer order will be determined by the sublayer z-depths. Since this uses animated layer order, this is independent of the camera, layer origins, and group layer rotation.