Page 2 of 2

Re: Script request - Vector layer/group to PNG

Posted: Wed Apr 25, 2018 9:11 am
by hayasidist
chucky wrote:...<snip>
Only one thing bugged it out... an old file using the offset on 0 , that froze the file at render... no big deal.


Really cool, my Kentish friend, very clever.
Do you mean sequencer offset? I've run it a few times with both +ve and -ve offsets on a vector with no obvious issues. Or do you mean that the image is not set to the vector offset? (easy to fix if only one layer, but not so with multiple layers that might be shifted differently). Be interested to see what exactly happened if you could maybe (strip out sensitive content and) let me see the file PM / or post?

And - just to be very picky <vbg> :D -- there's a world of difference between Kentish Man (someone from West Kent) and Man of Kent (from East Kent) - nearly as bad as calling a New Zealander an Aussie! :lol: or vice versa!

Thanks for the kind words!

Re: Script request - Vector layer/group to PNG

Posted: Wed Apr 25, 2018 11:57 am
by chucky
Oh... ouch what am ignorant faux pas, my humblest and deepest apologies... how offended and insulted you must be, Paul. :oops:
I might as well have called you a.... 'Northerner!' :lol:
Although I'm thinking the comparison is more New South Wales person to a Queenslander- both would be insulted - the new south welshman rightly so :wink: DK?
Or even a Victorian and a Taswegian .
Kiwi and Aussie is more like Norwegian and Swede... just a completely different kettle of herring.

Of course I have no real place of origin that I can cling to rightly, I've lived soo many places.... guilty secret though... I was born in Surry , Haslemere 'actually' . Don't hate me, I have nothing to do with those people. :P

Re: Script request - Vector layer/group to PNG

Posted: Wed Apr 25, 2018 11:58 am
by chucky
Oh about the offset glitch , that was the long forgotten 'bone' offset.
Yeah ancient history.
That's 'old' moho juju.

Re: Script request - Vector layer/group to PNG

Posted: Wed Apr 25, 2018 5:37 pm
by Greenlaw
Thanks for making this script Paul! It sounds great.

I haven't had a chance to try it yet (working mostly in 3D at lately,) but hope to give it a spin at home soon. Will let you know how it goes.

Re: Script request - Vector layer/group to PNG

Posted: Thu Apr 26, 2018 11:38 am
by peterkajan
Hi Paul
thanks for great script!
But, to make it really useful production tool, it would be great to implement some changes:

1. The resolution of the baked image is the same as your current project resolution. This is quite limitation factor, if you could implement a function which would do this:
a. you select a layer and hit script button.
b. script changes your project settings resolution by factor 2 - e.g. from 1920x1080 to 3840x2160 and then do the same as now and after putting the PNG in to your project, scales the resolution to 1920x1080 (original one) back.
c. it will setup the high-quality rendering on the PNG layer settings.

2. It would be great if the script could remember the hidden and showed layers before doing the rendering. So you select for example only BG Folder and the script will save the current composition settings, then hide everything else except the BG Folder, then do his job and at the end put everything back in normal – as it was before.

I would provide you with any help if you could implement those changes, we can even make some paid ob from it. We have a lot of ideas for new scripts. We can pay you for development of these.

PS: I created the icon for the script, you can use it of you like it :)


hayasidist wrote: ... akePNG.lua

I think this is a pretty robust and just about functionally complete version... but give it a thrashing and let me know!

much of the wish list is implemented - including layer comps; but not yet scale up

Installation: copy the .lua to your custom directory (sorry - still no icon...)


activate with just one unlocked (=default state) vector / group selected: the PNG is rendered; the source layer is locked
activate on a locked vector / group: the PNG is made invisible and the source layer is unlocked for editing.

activate with multiple layers selected: a layer comp is created containing the selected layers; the layercomp is SET (i.e. everything else is made invisible); a PNG is created and a NOTE layer is created as a surrogate for the layer comp. The note layer is locked; the layercomp is DEACTIVATED (i.e. only the PNG and "non-render" Note layer are visible)

activate on a locked NOTE layer - the Note layer is unlocked; the layercomp is SET; and layers are available for editing.
activate on an unlocked NOTE layer (i.e. you can put the name of a pre-existing layer comp as the note text) - this is the same as multiple selected layers - i.e.the layercomp is SET; PNG is created; note layer is locked; the layercomp is DEACTIVATED

activate on a PNG: the same as activating on whatever created it.

activate with an unlocked source on any frame - you'll get a PNG for the frame on which it's activated (e.g. run on frames 0, 6, 30 - you get 3 PNGs). All the PNGs from the source are hidden when the source is open for editing.

right now a lot of the "options" that a user might want are hardwired ... e.g. path names to save the png (defaulted to the same as the .moho -- you'll be prompted to save the .moho if necessary); png file names (moho file name .. layer name .. uuid); layer comp names (from the active selected layer)...

Let me know ....

Re: Script request - Vector layer/group to PNG

Posted: Thu Apr 26, 2018 1:58 pm
by hayasidist
new version 1.26 same link. EDIT: <bad link> ... akePNG.lua <Sorry!!

new feature: (thanks for feedback - and Greenlaw's original request!) this version renders at double scale unless the upscaled project would exceed moho's limits (i.e. it will double the scale as long as the document has a maximum dimension of 4500 px) No warning is issued / other action taken if the project is too big to have its dimensions doubled - it just renders as is. (i.e. one more on the list of "some UI might be nice" ... I'll get there ...)

Re: Script request - Vector layer/group to PNG

Posted: Thu Apr 26, 2018 2:37 pm
by chucky
This one didn't work like the last . Might have used it wrong. :oops:

Here's my temp icon.

Re: Script request - Vector layer/group to PNG

Posted: Thu Apr 26, 2018 4:39 pm
by hayasidist
chucky wrote:This one didn't work like the last . Might have used it wrong
:oops: bad link - corrected! Sorry. (that was a link to bake frame - take the vectors and bake the point / bone / layer / motion...) ... akePNG.lua

oh - and - the soufflé?! that's neat! :D

Re: Script request - Vector layer/group to PNG

Posted: Fri Apr 27, 2018 2:36 pm
by hayasidist ...

new link - this adds layer save / set / restore layer visibility and includes Chucky's oven-baked delicacy icon... makes me smile every time I see it!

Once again, I've given it a fair going over but I'm sure there will be wrinkles in there to iron out... some grounded on the one or two niggles with the way layer comps work (e.g. SET layercomp doesn't seem to want to activate the parent layers of included layers?!)

one "feature" you might find is if you try to use a locked layer in a layercomp -- just run the tool to unlock it first!

there are "missing" features, such as the UI, and these are planned for a couple of months time all other things being equal
but that's it as far as core functionality is concerned for the next little while at least (barring any compelling "must have"s) - but there will be bug fixes as necessary of course.

let me know.....

Re: Script request - Vector layer/group to PNG

Posted: Thu May 24, 2018 4:38 pm
by Greenlaw
I finally got around to trying Bake To PNG and it appears to do exactly what I need! Thank you so much for making this tool. I'll try it on a past scene where I had to do this manually and let you know how it goes.

Oh, and nice icon Chucky! :)