Render groups separately

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

Moderators: Víctor Paredes, Belgarath, slowtiger

kovis
Posts: 5
Joined: Sat Jan 16, 2021 3:53 pm

Render groups separately

Post by kovis »

Hello all,

we are currently starting animated series in Moho and we urgently need script which can render top groups from project separately. In our case, we need output from moho to be Background / middleground / foreground as png sequences. Best would be, that script will create folder with name of the shot - then render top groups, each in new folder with the name of the group.

Our folder structure (sometimes there can appear multiple BG or FG etc.): https://prnt.sc/20mqp66
Desirable output: https://prnt.sc/20mqzb9


I hope, that i explained it well :)

If someone can do it, please let me know, how long it can take and how much it will cost :)

Kind regards
Roman
User avatar
hayasidist
Posts: 3528
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Render groups separately

Post by hayasidist »

use layer comps?! Moho 13.5 manual page 176. just create 3 layercomps - one for each of fg, mg, bg and export as you wish (e.g. png sequence) for input to whatever post process you want...
kovis
Posts: 5
Joined: Sat Jan 16, 2021 3:53 pm

Re: Render groups separately

Post by kovis »

hayasidist wrote: Tue Nov 23, 2021 1:41 pm use layer comps?! Moho 13.5 manual page 176. just create 3 layercomps - one for each of fg, mg, bg and export as you wish (e.g. png sequence) for input to whatever post process you want...
We considered it, but in our opinion, script would be better - we will have around 300 unique shots in every episode (with unique structure - as i wrote, there can be in one shot for example 3 Fg / 1 Mg / 4 Bg in other just 1/1/1 and so on) and I'm afraid, this would be too complicated to do in every shot. That's why i need some simpler solution :)
User avatar
hayasidist
Posts: 3528
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Render groups separately

Post by hayasidist »

kovis wrote: Tue Nov 23, 2021 1:58 pm we will have around 300 unique shots in every episode (with unique structure - as i wrote, there can be in one shot for example 3 Fg / 1 Mg / 4 Bg in other just 1/1/1 and so on) and I'm afraid, this would be too complicated to do in every shot. That's why i need some simpler solution :)
ok -- so do you want just one Fg output no matter how many "input" folders? or, as in your example above - if it's 3/1/4 do you want 3/1/4 png sequences?
User avatar
Lukas
Posts: 1297
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: Render groups separately

Post by Lukas »

You could create a script that wipes all layercomps and creates new ones per top layer and then use a renderer that renders all layercomps.
User avatar
hayasidist
Posts: 3528
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Render groups separately

Post by hayasidist »

Lukas wrote: Tue Nov 23, 2021 8:42 pm You could create a script that wipes all layercomps and creates new ones per top layer and then use a renderer that renders all layercomps.
which would be fine if the OP wanted one layercomp per top level group ...

but it isn't clear to me if the need is to have 3 output image sets (one FG, One MG, one BG) irrespective of the number of layers that go to make up each planned output set (= each comp set) ... and that's also pretty straightforward as long as there was a way to identify which set a layer belongs to (e.g. hierarchy position, tag, colour, name ...); then there's the question of actually initiating the render...

IMO, a straightforward challenge whatever the actual need, but still too many unknowns at this point to encourage me to reach for the proverbial coding pencil...
User avatar
synthsin75
Posts: 9981
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Render groups separately

Post by synthsin75 »

It would help if either of the linked screen shots worked. I can't see them here.
hayasidist wrote: Tue Nov 23, 2021 10:43 pm then there's the question of actually initiating the render...
I assume just using command line rendering, as per Appendix G in the manual.
User avatar
SimplSam
Posts: 1048
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

Re: Render groups separately

Post by SimplSam »

For Your Eyes Only !
Image
Image
Moho 14.1 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.1 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam


Sam
kovis
Posts: 5
Joined: Sat Jan 16, 2021 3:53 pm

Re: Render groups separately

Post by kovis »

hayasidist wrote: Tue Nov 23, 2021 10:43 pm
Lukas wrote: Tue Nov 23, 2021 8:42 pm You could create a script that wipes all layercomps and creates new ones per top layer and then use a renderer that renders all layercomps.
which would be fine if the OP wanted one layercomp per top level group ...

but it isn't clear to me if the need is to have 3 output image sets (one FG, One MG, one BG) irrespective of the number of layers that go to make up each planned output set (= each comp set) ... and that's also pretty straightforward as long as there was a way to identify which set a layer belongs to (e.g. hierarchy position, tag, colour, name ...); then there's the question of actually initiating the render...

IMO, a straightforward challenge whatever the actual need, but still too many unknowns at this point to encourage me to reach for the proverbial coding pencil...
sorry if i not making this clear enough, trying my best :) Well, simply said, i just need script, that will scan the layer panel and render each top group separately. Nothing else. Just hit the button, select where to save it and script will do the job. The 3 output image sequences was just example.
User avatar
hayasidist
Posts: 3528
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Render groups separately

Post by hayasidist »

kovis wrote: Wed Nov 24, 2021 7:47 am sorry if i not making this clear enough, trying my best :) Well, simply said, i just need script, that will scan the layer panel and render each top group separately. Nothing else. Just hit the button, select where to save it and script will do the job. The 3 output image sequences was just example.
ok -- getting clearer ... top level GROUPs only or ALL top level layers - e.g. if you have a single vector layer not in a group at top level; or the audio layer as in the example
User avatar
Greenlaw
Posts: 9270
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Render groups separately

Post by Greenlaw »

Just to be clear, wouldn't using Moho Exporter do what you need? You can set it up to break out the render passes based on your Layer Comp settings with a button click, and Moho will automatically save each layer comp to its own separate directory. For example...

1. Set up your layers comps, e.g., Fg, Mg, Bg., and then save your project.
2. Open Moho Exporter (Ctrl-B.) If the project has been saved it will load automatically.
3. Double-click the project and enable Render Layer Comp* (if it hasn't already been enabled by default,) and then set the output path in its render settings. Close the project's settings window.
4. Click Split Selected Item By Layer Comps. This breaks out the project into Layers, and each layer comp is automatically assigned a separate output folder with its layer comp name.
5. Click Start. This renders each layer to its own folder (e.g., projectName-Fg, -Mg, -Bg,) with the layer comp name appended to its filename (e.g., projectName-Fg_0001.png, projectName-Mg_0001.png, projectName-Bg_0001.png)

To save time, you should save the Moho Exporter Profile after clicking the Split button. This will save the settings up to this point (including the output folders) so you don't need to set it again for this project. When you need to render this project again, just load this profile file.

This is how I work on my personal projects. At work, we have a custom controller that automatically knows where to save the files on our network, but it still gets its info from the Layer Comps settings.

That said, there are improvements I wish to see in this workflow. For example, I still don't understand why the Project's preferred default output directory can't be embedded in the Project itself (i.e., in the Project Settings window.) Right now, the preferred output directory needs to be manually selected every time I wish to render, which unnecessarily increases the chances of rendering files to an incorrect directory. In a studio production where a team of artists may be working the same scene, this additional manual step can lead to mistakes and wasted time.

I hope this helps. It's probably not exactly what you need, but until Layer Comps and Moho Exporter gets a makeover, maybe this is close to it.

*Additionally, I suggest enabling Overwrite Existing Files as a default.
Last edited by Greenlaw on Wed Nov 24, 2021 1:07 pm, edited 5 times in total.
User avatar
Greenlaw
Posts: 9270
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Render groups separately

Post by Greenlaw »

Oh, I see...you only want to consistently render specific layer comps. I get that; I often have extra layer comps I never wish to render like the 'work' layer comps I use as guides for drawing, rigging or animation; or the 'Master' layer comp that has all render layers active at the same time and hides the 'work' layers (I use this only for test render.)

To address this, I'd like to see an option added to Layer Comps, maybe a check box or grouping system, to tell Moho Exporter which layer comps to render and which to ignore.
Last edited by Greenlaw on Wed Nov 24, 2021 1:09 pm, edited 1 time in total.
User avatar
hayasidist
Posts: 3528
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Render groups separately

Post by hayasidist »

Denis, I think it's your step 1 - setting up the layer comps in the first place - that the OP finds hard ... and for sure - once set up, just let the exporter rip - but probably invoked from a script using the Command Line Renderer.
kovis
Posts: 5
Joined: Sat Jan 16, 2021 3:53 pm

Re: Render groups separately

Post by kovis »

hayasidist wrote: Wed Nov 24, 2021 10:50 am
kovis wrote: Wed Nov 24, 2021 7:47 am sorry if i not making this clear enough, trying my best :) Well, simply said, i just need script, that will scan the layer panel and render each top group separately. Nothing else. Just hit the button, select where to save it and script will do the job. The 3 output image sequences was just example.
ok -- getting clearer ... top level GROUPs only or ALL top level layers - e.g. if you have a single vector layer not in a group at top level; or the audio layer as in the example
Idk mate, i think i made it as clear as possible - in image example are 3 groups in layer panel and then there is another image example where is output - which is 3 separated folders with image sequences.

Please, understand my struggle, that there will be in this season maybe 10 episodes, each +-300 shot. Each shot is unique and i fear, that setting up layer comps will be totall killer (seems to me, that it can create mess real fast). These shots will be made by different animators and I really want the easiest possible solutions for them. That's why, as i wrote, few clicks script which automatically render top groups from file is better option for me.
User avatar
Víctor Paredes
Site Admin
Posts: 5664
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Re: Render groups separately

Post by Víctor Paredes »

I think exporting as a PSD sequence does something similar to what you want.
Image Image Image Image
Moho Product Manager

www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel
Post Reply