How to have control over render order while remaining the layer order?

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
mmmaarten
Posts: 271
Joined: Mon Sep 19, 2022 2:19 pm
Location: Utrecht, The Netherlands
Contact:

How to have control over render order while remaining the layer order?

Post by mmmaarten »

Hi,

I need to have full control over the rendering/stacking order of image layers, but without changing the layer order in the layers panel. I've been searching for a while now, but I can't find anything in the API on this.

Is there a way to do this with scripting?
Adults should play more often
User avatar
hayasidist
Posts: 3525
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: How to have control over render order while remaining the layer order?

Post by hayasidist »

depends on how complicated you want to make it....
simple approach: will layer comps work for you - so that you can export in "random" order then use your video editor to assemble the renders in the order you want them??
scripted suggestion: build / use a script-created layer panel to show them to you in the order you want them and to give you an "extra" field that shows the render order - and your script uses "animated layer order" to set them in the render order you want (the factory "layer panel" will show them in the render order, but you can undock and hide it)
User avatar
mmmaarten
Posts: 271
Joined: Mon Sep 19, 2022 2:19 pm
Location: Utrecht, The Netherlands
Contact:

Re: How to have control over render order while remaining the layer order?

Post by mmmaarten »

hayasidist wrote: Sun Oct 15, 2023 4:04 pm depends on how complicated you want to make it....
simple approach: will layer comps work for you - so that you can export in "random" order then use your video editor to assemble the renders in the order you want them??
scripted suggestion: build / use a script-created layer panel to show them to you in the order you want them and to give you an "extra" field that shows the render order - and your script uses "animated layer order" to set them in the render order you want (the factory "layer panel" will show them in the render order, but you can undock and hide it)
Thanks. It's not only for rendering tho, it needs to set the right order in the viewport too.
I was hoping to use the moho layering system / hierarchy to have hierarchical translate, rotate and scale to not having to fiddle around with rotated and scaled (and even skewed) axis and all that complex stuff of nested layers.
But it didn't work and turned out to be quite a lot of layers and groups in moho, because Spine is able to flexibly handle image order completely individually from the layer order and Moho is not. 😦

So I reworked all my code back to where I was a day ago and decided to go another route. Right now I solved everything with hierarchical calculations throught the full list of (nested) bones and slots and attachments 🙂 (a hell of work tho and quite a puzzle because of a lot of parameters. I wished Moho was more flexible on ordering and had something similar to spine. But apart from a little thing that needs to be done still it works now 🙂 )

I wonder tho why Moho doesn't simply has something like a z-index system to make us manually enter the render order. Even websites can do that in the browser. I think that's a missed oppertunity that causes a lot of headaches tbh
Adults should play more often
Post Reply