Page 1 of 1

Accurate placement of background into workspace

Posted: Mon Mar 20, 2023 6:56 pm
by Hoptoad
My workspace is 1920x1080.

My bitmap background image is also 1920x1080 - so there's not a pixel to spare.

After I move the background image around a few times, "reset" doesn't replace the background into its original spot, but in the previous spot, so it's not centered. And yet the position and x/y/z display values of 0.

Is there a method for making a background relocate itself into the exact center of the workspace? I don't like eyeballing it, to see if it's placed correctly.

Re: Accurate placement of background into workspace

Posted: Mon Mar 20, 2023 7:16 pm
by Greenlaw
Have you checked the origin of the layer? It should be set to 0,0 as well but maybe it got accidentally moved. If it's been moved, the layer will reset to the origin's offset position. (Edit: this is incorrect; the origin offset does not change how the layer position resets. I think that's how it works in After Effects but it doesn't apply to Moho. Sorry for the bad info.)

Otherwise, it sounds like you're doing everything correctly: reset all the Transform Layer settings.

Oh, changing the camera position after you imported the image can have an affect as well. Try setting the camera to its default position. If it's still not right, maybe you need to reset the lens as well.

This of course is assuming the camera hadn't been moved before you imported the image. Although, I think you might have noticed the offset on import if that was the case. (Update: Yup, I just checked, and if you had moved the camera before importing, you would see the offset. So that probably didn't happen.)

Re: Accurate placement of background into workspace

Posted: Mon Mar 20, 2023 8:14 pm
by Hoptoad
Thanks for the help.

I think I figured-out part of the problem, maybe the whole problem.

The background image was probably imported as a Moho Object from a different project file, and it had been moved or something in the old project, so it arrived off-center because it remembered its animation? I think that's what happened.

I guess I need to start using my background folder to hold images, instead of stealing background images from other project files. If the image had been animated before being imported, they arrive off-center and you can't undo the animation by clearing the animation from the layer.

Maybe.

Re: Accurate placement of background into workspace

Posted: Mon Mar 20, 2023 8:30 pm
by Greenlaw
When I have a sequence that uses the same background and props for most or every shot, I like to make a master 'environment' project with all the elements in place. Then I just make each new scene projects based on that one.

When I have scenes that re-use specific camera angles from an existing scene project, then I'll just save a copy of that project, clear the keyframes and start from there for the new scene.

I typically have this all planned out in my shot list after I create my animatic. It's a little work upfront to save a ton of time later.

Re: Accurate placement of background into workspace

Posted: Mon Mar 20, 2023 10:08 pm
by Hoptoad
I like the idea of a Master Environment project. I'll start doing that.

For my cartoon, I have a lot of backgrounds set inside a house. I'm going to start a project called "House" and put all the room backgrounds there. But not include any characters in the project - just backgrounds. And then make another project called "Outdoors," etc.

Thanks for the idea.

Re: Accurate placement of background into workspace

Posted: Tue Mar 21, 2023 10:12 am
by hayasidist
Hoptoad wrote: Mon Mar 20, 2023 8:14 pm I think I figured-out part of the problem, maybe the whole problem.
The background image was probably imported as a Moho Object from a different project file, and it had been moved or something in the old project, so it arrived off-center because it remembered its animation? I think that's what happened.
Not sure if this is relevant or not, but: One place to look is Edit > Preferences > Layers / Objects > Auto Center -- with that checked, any new layer will be created to be "square on" to the camera.

If you'd like to upload the old project file -- just the group layer(s) that hold the image layer in question (doesn't have to include the actual image file or any other artwork if that makes your life easier) that might shed some light on the underlying cause. If you couldn't give a sh*t about the "why" -- then just ignore this!

Re: Accurate placement of background into workspace

Posted: Tue Mar 21, 2023 2:56 pm
by Hoptoad
hayasidist wrote: Tue Mar 21, 2023 10:12 am Not sure if this is relevant or not, but: One place to look is Edit > Preferences > Layers / Objects > Auto Center -- with that checked, any new layer will be created to be "square on" to the camera.

If you'd like to upload the old project file -- just the group layer(s) that hold the image layer in question (doesn't have to include the actual image file or any other artwork if that makes your life easier) that might shed some light on the underlying cause. If you couldn't give a sh*t about the "why" -- then just ignore this!
I didn't know about the the auto-center option, thanks for pointing it out. I probably unchecked the boxes ages ago and promptly forgot it existed.

I was about to upload the project file to the forum for a forensic analysis, but I finally figured out what happened: the original project file with the background image had camera movement to the left. See, I was creating a character in the center of the workspace, and I decided to move him to the left so I could work on his side-view to his right. Rather than translate the group layer of the character to the left, I moved the camera. That messed-up the placement of the background, so I used translate layer to re-center it. Now it's x value was .7155 instead of 0. And then. . .I forgot I had moved things. In a subsequent project, when I imported that same background, it kept the x=.7155, and so it arrived off-center.

This is the worst mistake, though: when I checked the x value of the imported background image that had arrived off-center, I thought it said x = 0. But I must've had the wrong layer selected!

I am like a Russian nesting doll when it comes to mistakes. When I make a mistake, there is probably a second hidden mistake within that mistake.

Question:

When I move a group layer on frame 0, is there a way to make Moho forget the layer had moved? I would like to re-set the x and y values of a group layer and an image layer to 0 before I start animating, but I want to keep everything in place. Is that called "baking" frame 0? I seem to remember a script did something like that.

Re: Accurate placement of background into workspace

Posted: Tue Mar 21, 2023 3:30 pm
by Greenlaw
The way I deal with that is to put the layer in a Group layer and transform only the Group. This way I can offset the art inside the Group layer but pretend it's at 0,0 when I'm working with the Group layer.

But I know what you mean. In Maya, for example, there's a command called Freeze Transforms (or something like that) which 'flattens' any transforms on an object so it becomes the new 'zero' position (or rotation or scale).

Re: Accurate placement of background into workspace

Posted: Tue Mar 21, 2023 4:01 pm
by SimplSam
Hoptoad wrote: Tue Mar 21, 2023 2:56 pm ...
When I move a group layer on frame 0, is there a way to make Moho forget the layer had moved? I would like to re-set the x and y values of a group layer and an image layer to 0 before I start animating, but I want to keep everything in place. Is that called "baking" frame 0? I seem to remember a script did something like that.
It is called Applying in some apps.

There is a Script that does this in part: https://mohoscripts.com/script/ae_reset_layer_transform

Typically used to reset a Group to zero's and set the transform of the child layers accordingly. Or reset a Vector layer to zero's and adjust/transform the point positions accordingly.

It does not work recursively, so I had to hack mine to do that.

Re: Accurate placement of background into workspace

Posted: Tue Mar 21, 2023 4:18 pm
by Hoptoad
Greenlaw wrote: Tue Mar 21, 2023 3:30 pm The way I deal with that is to put the layer in a Group layer and transform only the Group. This way I can offset the art inside the Group layer but pretend it's at 0,0 when I'm working with the Group layer.
Good idea. Henceforth I'll START with the group layers.

Man, starting a project file with empty group layers is going to feel like putting the cart before the horse. Creating group layers to organize everything was literally my last step.
SimplSam wrote: Tue Mar 21, 2023 4:01 pm There is a Script that does this in part: https://mohoscripts.com/script/ae_reset_layer_transform

Typically used to reset a Group to zero's and set the transform of the child layers accordingly. Or reset a Vector layer to zero's and adjust/transform the point positions accordingly.

It does not work recursively, so I had to hack mine to do that.
I think I used that, or something similar, in the past to fix a project file that had a problem with the scaling of hands in an imported switch group. Thanks for the link.

Re: Accurate placement of background into workspace

Posted: Tue Mar 21, 2023 7:35 pm
by Greenlaw
I tend to use a lot of Groups. When I have many dozens or even hundreds of layers, Groups keep things tidy and manageable.

You don't need to create empty groups beforehand. Just select the layers that you want in a group, r-click over the selection and choose Group With Selection. I do this as I build the project.

Re: Accurate placement of background into workspace

Posted: Tue Mar 21, 2023 8:18 pm
by Hoptoad
Greenlaw wrote: Tue Mar 21, 2023 7:35 pm
You don't need to create empty groups beforehand. Just select the layers that you want in a group, r-click over the selection and choose Group With Selection. I do this as I build the project.
I do that. Dragging is hit or miss. I think it's in the folder, but it's not. Or it arrives in the wrong folder. So I usually Group With Selection.

I generally create 3 or so different bone rigs for a character: front, side and back, usually. When they're done, I add them to a new group and make that group a switch layer. Then I put the background grass, trees and sky in a group layer. That's what I meant when I said I make group layers last. Technically, I'm using group layers from the very beginning, though.

Re: Accurate placement of background into workspace

Posted: Thu Mar 23, 2023 10:53 am
by slowtiger
I've noticed a problem which is there from at least v11: I have a 1920 x project and import a 1920 x 1080 video file - I do that all the time because Moho givesme a certain render option. Now when I render this file I get a video with a visible ca. 1 px white line on the left. This is really annoying!

Can someone confirm?

Re: Accurate placement of background into workspace

Posted: Thu Mar 23, 2023 11:24 am
by hayasidist
yes. confirmed. (it's background or the fill colour of any vector larger than the 1920 x-dimension) and is exactly 1px wide.

this image is cropped down from a full frame render (exporter not ctrl-R) of an imported .mp4 created by a moho export (export video) in Sept 2021 -- file properties shows as 1920*1080 -- over a red-filled vector layer that extends far beyond the render window in all dimensions.

Image