resize/scale canvas only?

Have you come up with a good Moho trick? Need help solving an animation problem? Come on in.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
philis401
Posts: 2
Joined: Tue May 01, 2018 2:34 am

resize/scale canvas only?

Post by philis401 »

Is there anyway to resize just the canvas? Tried googling and searching in this frum with both resize canvas and scale canvas but no results.
Trying to make some assets for a game but as I am animating I find that some animations I do go outside border of canvas. I tried giving myself what I think is enough space. I would export as swf but it lacks the ability to do what i need it to do on this animation (ie masking) so I have to use image sequence export. Would like to keep all assets' size to be the size I want them to be compared to each other. Like I don't want one asset to suddenly come out smaller than another when it is suppose to be same or larger size because I know I'll be changing canvas size frequently to fit all my animations in.

I'm thinking of just animating in my screen's native resolution then just cropping the images...but would rather try and avoid adding tedious work if possible. Unless someone knows a way to automatically batch crop a series of images so it can be as small as possible while fitting all the pixels within the same dimension.
User avatar
Greenlaw
Posts: 9191
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: resize/scale canvas only?

Post by Greenlaw »

Under File: Project Settings you can make the canvas any size you want. (In Pro, I think it's up to 9000 x 9000 anyway.)
Last edited by Greenlaw on Sat Aug 04, 2018 8:23 pm, edited 1 time in total.
User avatar
Greenlaw
Posts: 9191
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: resize/scale canvas only?

Post by Greenlaw »

To scale rigs, I like to keep the bones layer in another group and scale the group. I typically call this group something like '[CharName] PosAndScale'.

The advantage of this is I can transform the group independently of the rig, and not worry about messing up the rig, the body parts, or animation.

Tip 1: put the origin of the PosAndScale group at the feet so you can add a global squash and stretch effect. Keep it subtle and it can make your animation look smoother and more animated than it actually is.

Tip 2: Nest the group in another group, and you can give it a different origin. This is useful if the character needs to be transformed from different points during the scene. For example, the first group's origin will be good for when the character is running on the ground, and the second group's origin, if placed at the character's hand, can be used for position and rotation when the character leaps up and swings from a rope.
User avatar
RendCycle
Posts: 14
Joined: Tue May 23, 2023 3:26 pm

Re: resize/scale canvas only?

Post by RendCycle »

Greenlaw wrote: Sat Aug 04, 2018 8:12 pm Under File: Project Settings you can make the canvas any size you want. (In Pro, I think it's up to 9000 x 9000 anyway.)
I am also wondering about how to easily resize just the Canvas (just enlarging the outer border) and not the images & rigs inside. In Project Settings, it looks like everything is resized when fiddling with the Dimensions Width & Height values. I was thinking more of like how the Canvas Size feature in Photoshop works instead of the Image Size (see attached image). Is there a similar feature in Moho Pro 12 that I missed?

Image
User avatar
Greenlaw
Posts: 9191
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: resize/scale canvas only?

Post by Greenlaw »

Oh, I see what you want. The thinking is different in an animation program like Moho. The 'canvas' size (Project Dimensions, actually) in Moho is what you want to set for your final output, and this is normally decided before you start adding your content. When you change it after the fact, Moho tries to preserve the scale and proportion of the content by design. This allows you to change the resolution of the project from, say, HD to UHD without having to rescale or reposition all your content.

So, you want to change the scale of your content instead. First, make sure the Project size is what you want for your final output. Then, place all your layers inside a group layer (select them all, then r+click Group With Selection) and use the Transform settings to bring up or down the size you want within your defined render output area. If you need to change the pivot point for the scaling, use the Set Origin tool to position the Group's origin where you want it to be.

Technically, scaling artwork in Moho is non-destructive. That's obvious for Vector Art, but this is true for imported Bitmap Art too. So long as the original images have enough resolution, Moho will render it at the highest quality possible.

Tip: You might want to try Synthsin75's Lock Layer tool to lock the group after setting it to the size you want.
User avatar
Greenlaw
Posts: 9191
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: resize/scale canvas only?

Post by Greenlaw »

Oh, sorry...this is thread is a bit old, and I just realized that what I wrote is basically what I previously suggested.

But yeah, normally, you should scale the contents to the preferred output size area. Because of Moho's resolution independence, scaling the artwork doesn't degrade it (not at all for Vector and within reason for Images, of course.)
User avatar
RendCycle
Posts: 14
Joined: Tue May 23, 2023 3:26 pm

Re: resize/scale canvas only?

Post by RendCycle »

Greenlaw wrote: Tue Aug 29, 2023 9:08 am Oh, I see what you want. The thinking is different in an animation program like Moho. The 'canvas' size (Project Dimensions, actually) in Moho is what you want to set for your final output, and this is normally decided before you start adding your content. When you change it after the fact, Moho tries to preserve the scale and proportion of the content by design. This allows you to change the resolution of the project from, say, HD to UHD without having to rescale or reposition all your content.

So, you want to change the scale of your content instead. First, make sure the Project size is what you want for your final output. Then, place all your layers inside a group layer (select them all, then r+click Group With Selection) and use the Transform settings to bring up or down the size you want within your defined render output area. If you need to change the pivot point for the scaling, use the Set Origin tool to position the Group's origin where you want it to be.

Technically, scaling artwork in Moho is non-destructive. That's obvious for Vector Art, but this is true for imported Bitmap Art too. So long as the original images have enough resolution, Moho will render it at the highest quality possible.

Tip: You might want to try Synthsin75's Lock Layer tool to lock the group after setting it to the size you want.
The Project Dimension in Moho works like Image Size in Photoshop as when you make any adjustments to the values, the content also gets resized proportionally. But the good thing about Photoshop's Canvas Size feature is it easily resizes just the "outer bounds" of the file and the "transform" properties of the Content inside it like the scale, position, and such is retained and not touched.

For games, I am exporting as PNG Image Sequences in Moho then I convert them to a PNG Spritesheet using another software. I have already made some basic animations earlier in Moho in 512 x 512 pixels dimension. Now, I've decided to add a very long Weapon to my Character and when I animate him holding it, some portions of that item is cut off. Thus I just want to enlarge the Canvas a little bit (maybe up to 550 x 550 pixels dimension) without touching the content inside for fear that I might mess up the original Positioning and Scaling and it won't match my previous animations.

Following your suggestion, how can I make sure that when I re-scale the artwork it will retain the same Position and Scale as my previous animation that was done in 512 x 512 pixels dimension? Is there a way to copy-paste the original values of the Position and Scale to the newly resized file?
User avatar
Greenlaw
Posts: 9191
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: resize/scale canvas only?

Post by Greenlaw »

Yeah...that's a little tricky. There have been situations where, for example, I needed to add overscan (or padding) to my renders for compositing elsewhere, and without changing the relative placement and size of the content, but other than planning for this from the start, I don't think there's a way to do it in Moho.

Maybe this is because, in Moho, we're technically adjusting a camera's viewable area and not setting a canvas boundary. Unlike paint programs like Photoshop, Moho doesn't have a canvas; instead, it has an endless 3D workspace environment, and the camera defines the renderable part of it.

The same idea is true in the 3D programs I use; when I adjust the render area in these programs, the content in the area 'scales' with the render size changes. The only way to extend the render region without otherwise altering the image is to pad it with an overscan area, assuming the program supports this option.

Unfortunately, Moho does not support this option, and I think the only way is to set the output size to what you need and then calculate the new scale/position of your existing content. Sorry, I know that's not much help.

Actually, there's a formula for adding overscan that calculates how much to adjust the lens to compensate for the larger output region. I used to apply this formula manually in my 3D programs before they got the overscan feature built-in. (It's common to want overscan when you're applying motion blur or camera shake as a post-process in compositing programs.) It's been years since I've had to do this manually, but I'll see if I can dig up the formula...it's pretty easy to apply and might be relevant to Moho.

It's possible somebody has written a script that does this, but I'm not aware of one. If I have time tonight, I'll look around.
Last edited by Greenlaw on Tue Aug 29, 2023 8:55 pm, edited 1 time in total.
User avatar
SimplSam
Posts: 1033
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

Re: resize/scale canvas only?

Post by SimplSam »

Are you not over-complicating this?

I see the solution as:

- put everything in a Group
- resize Canvas
- resize Group with opposite resize ratio

The end-effect should be the same as resizing the canvas without the related rezing of the content.
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
User avatar
Greenlaw
Posts: 9191
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: resize/scale canvas only?

Post by Greenlaw »

Yeah, that's what I was suggesting originally. I think the OP wants a 1-click solution that calculates the scaling compensation automatically.

My second suggestion doesn't apply to Moho unless there's 3D camera motion and parallax involved, I guess. So, it's probably way outside of what the OP is asking. :P
User avatar
RendCycle
Posts: 14
Joined: Tue May 23, 2023 3:26 pm

Re: resize/scale canvas only?

Post by RendCycle »

SimplSam wrote: Tue Aug 29, 2023 8:32 pm - resize Group with opposite resize ratio
How do I do this? Do I just drag the corner (w/ diagonal arrow cursor) of the Group's red box outline? What's the formula to get the exact previous Scale (X, Y, Z) of the Group content for let's say from 512 x512 pixels to 800 x 800 pixels dimension (I just checked and this is the actual Project Dimension I need)? When do I stop dragging/resizing down the Group content?

Previously at 512 x 512 pixels Project Dimension, the Scale just indicates X: 1, Y: 1, and Z: 1. After increasing the Project Dimension then to 800 x 800 pixels, the Group content I see has the same values of X:1, Y:1, and Z:1. If I resize the Group content to be smaller, the Scale values of course goes down from 1 (e.g. 0.9 and lower). When do I stop resizing down to get the exact size from the previous Project Dimension? I'm not very good at Math. :-P
Last edited by RendCycle on Wed Aug 30, 2023 7:37 am, edited 5 times in total.
User avatar
RendCycle
Posts: 14
Joined: Tue May 23, 2023 3:26 pm

Re: resize/scale canvas only?

Post by RendCycle »

Greenlaw wrote: Tue Aug 29, 2023 9:00 pm Yeah, that's what I was suggesting originally. I think the OP wants a 1-click solution that calculates the scaling compensation automatically.
Yes, it would be very useful to have a 1-click solution like the Canvas Size feature in Photoshop. The Anchor option there works like Set Origin in Moho too. This would really be a very useful feature especially for game asset creation and those new Moho users with Photoshop background might look for it. :) It can be made simpler for Moho users by maybe just adding these "Retain Content Proportions" and "Anchor" controls under Project Settings:

Image
User avatar
SimplSam
Posts: 1033
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

Re: resize/scale canvas only?

Post by SimplSam »

RendCycle wrote: Wed Aug 30, 2023 6:33 am ... How do I do this? Do I just drag the corner (w/ diagonal arrow cursor) of the Group's red box outline? What's the formula to get the exact previous Scale (X, Y, Z) of the Group content for let's say from 512 x512 pixels to 550 x 550 pixels dimension? When do I stop dragging/resizing down? ...
So the math in that example would be an Inverse Ratio of: 512 / 550 == 0.9309090909

You can just copy/paste that number into the number boxes for Layer Scale - for X, Y and Z. Though, I don't think Z matters in your case.
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
User avatar
RendCycle
Posts: 14
Joined: Tue May 23, 2023 3:26 pm

Re: resize/scale canvas only?

Post by RendCycle »

SimplSam wrote: Wed Aug 30, 2023 7:41 am
RendCycle wrote: Wed Aug 30, 2023 6:33 am ... How do I do this? Do I just drag the corner (w/ diagonal arrow cursor) of the Group's red box outline? What's the formula to get the exact previous Scale (X, Y, Z) of the Group content for let's say from 512 x512 pixels to 550 x 550 pixels dimension? When do I stop dragging/resizing down? ...
So the math in that example would be an Inverse Ratio of: 512 / 550 == 0.9309090909

You can just copy/paste that number into the number boxes for Layer Scale - for X, Y and Z. Though, I don't think Z matters in your case.
Great! I will try this out. Thank you very much!!! :D
Post Reply