Make all the translations to a layer become 0, without changing the art

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
Hoptoad
Posts: 716
Joined: Sun Jan 03, 2016 4:19 pm
Location: Florida

Make all the translations to a layer become 0, without changing the art

Post by Hoptoad »

I sometimes run into problems when animating a layer that has been translated, scaled and rotated previously. The layer remembers the old scale, angle, and XYZ (the numbers are visible in the boxes above the workspace). This is fine, and I like it. But sometimes it makes animation more difficult for me.

Is there a way to make all the layer numbers become 0, while at the same time maintaining the translation, scale and rotation so that the image doesn't change?
User avatar
slowtiger
Posts: 6246
Joined: Thu Feb 16, 2006 6:53 pm
Location: Berlin, Germany
Contact:

Re: Make all the translations to a layer become 0, without changing the art

Post by slowtiger »

No.

Workaround: render this layer only and re-import the image.
AS 9.5 MacPro Quadcore 3GHz 16GB OS 10.6.8 Quicktime 7.6.6
AS 11 MacPro 12core 3GHz 32GB OS 10.11 Quicktime 10.7.3
Moho 13.5 iMac Quadcore 2,9GHz 16GB OS 10.15

Moho 14.1 Mac Mini Plus OS 13.5
User avatar
Greenlaw
Posts: 10412
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Make all the translations to a layer become 0, without changing the art

Post by Greenlaw »

Hayasidist's Bake To PNG does that. It has many uses, and is super useful for situations like that. You just select the layer or group you want to bake, click the muffin button, and the script renders the current frame of the selection and places it in a new layer above. You can get it here:

http://www.lostmarble.com/forum/viewtop ... ng#p182406

I mostly use it to convert a vector layer to a PNG because the vector version isn't deforming satisfactorily in a mesh warp. Unlike rendering and importing, the script maintains the scale, position and any other transforms that have been applied.

I seem to recall a script that flattens a transform, which is different from baking (rendering) the transforms to an image. Unfortunately, I don't remember what it was called and I'd have to look for it. A search in these forums should turn it up.
User avatar
synthsin75
Posts: 10269
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Make all the translations to a layer become 0, without changing the art

Post by synthsin75 »

If you're talking about vector art, it's usually better to do vector animation instead of layer animation.
User avatar
Lukas
Posts: 1336
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: Make all the translations to a layer become 0, without changing the art

Post by Lukas »

This would be a good feature request. There’s many situations in which I’d need this too (especially scale). I like how you can apply a change in Blender and it becomes the new ‘0’ state or ‘100%’ scale. Moho could use that too for sure!
User avatar
Greenlaw
Posts: 10412
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Make all the translations to a layer become 0, without changing the art

Post by Greenlaw »

Yeah, Maya has that, it's called Freeze Transformations. It's a handy feature when you need it, but if you're not careful, it can really mess you up too. :)

I can recall one or two times where I've wanted to do that in Moho. Knowing me, I probably just used brute force to get what I needed back then.
User avatar
hayasidist
Posts: 3846
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Make all the translations to a layer become 0, without changing the art

Post by hayasidist »

there's my "bake vector" script too ... http://www.lostmarble.com/forum/viewtop ... 13#p194770
User avatar
Hoptoad
Posts: 716
Joined: Sun Jan 03, 2016 4:19 pm
Location: Florida

Re: Make all the translations to a layer become 0, without changing the art

Post by Hoptoad »

Thanks for all the replies.

I just learned that baking is another word for rendering. Haha, that's awesome.
synthsin75 wrote: Sat Jun 05, 2021 7:16 pm If you're talking about vector art, it's usually better to do vector animation instead of layer animation.
Ah. That's probably why I run into this situation so often: too much layer animation.

I think this is what I'll do: modify my animation process to prefer moving points rather than layers. Animation sometimes gets confusing when I employ both layer animation and vector animation to the same shapes. If that doesn't reduce my confusion, I'll try the script.

Thanks for the help everybody.
User avatar
Greenlaw
Posts: 10412
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Make all the translations to a layer become 0, without changing the art

Post by Greenlaw »

'Baking' usually means one of two things....

1. generating a keyframe for every frame in an animation. This is usually done to remove calculations from IK, dynamics or some procedural displacement, to optimize animation performance. It's also done for animation compatibility with another program.

or...

2. flattening a procedural, vector, or displaced image(s) to one bitmap layer...so, yeah, in this case it's basically rendering. This is typically done for the same reasons as above.

Oops...I forgot about Paul's Bake Vector script. This one flattens the deformations and transforms so you wind up with a new vector graphic. This can be super useful too since the result is an editiable vector graphic, unlike the PNG generated by the Bake To PNG script. (Thanks for the reminder Paul...I need to add this one to my Moho 13.5 custom content folder.) :)
Last edited by Greenlaw on Mon Jun 07, 2021 3:16 am, edited 2 times in total.
User avatar
Hoptoad
Posts: 716
Joined: Sun Jan 03, 2016 4:19 pm
Location: Florida

Re: Make all the translations to a layer become 0, without changing the art

Post by Hoptoad »

Gadzooks, I think I misunderstood what constitutes "baking." Thanks for a more specific definition.
Daxel
Posts: 1084
Joined: Wed Mar 27, 2019 8:34 pm

Re: Make all the translations to a layer become 0, without changing the art

Post by Daxel »

Hoptoad wrote: Sat Jun 05, 2021 2:16 pm I sometimes run into problems when animating a layer that has been translated, scaled and rotated previously. The layer remembers the old scale, angle, and XYZ (the numbers are visible in the boxes above the workspace). This is fine, and I like it. But sometimes it makes animation more difficult for me.

Is there a way to make all the layer numbers become 0, while at the same time maintaining the translation, scale and rotation so that the image doesn't change?

Yes. If you are talking about a vector layer you can use Hayasidist's Bake Frame script (now I see that he mentioned it too here) It takes all the "external elements" that move points, like bones, layers, etc, and bakes them into the actual vector art, creating a new simple vector layer that looks exactly the same as the frame where you activated this script but all its layer numbers will be at 0 like you want. Of course if what you have is an image layer, the Bake into PNG script is what you need, not this. But if you are working with a vector layer you probably don't want to bake it into an image.

You have it here (working fine on 12.5, probably on 13.5 too): http://www.mediafire.com/file/374qob23a ... s_bake.lua

If you don't know how to install scripts, watch this: https://www.youtube.com/watch?v=TUw1dhpBNEs&t=3s

Once installed, you need to be at a different frame than 0 and also on the main timeline (not on an action's timeline) to be able to activate this script. So if you want to bake the frame 0, just make a frame look as the frame 0, and bake that frame pressing the "Bake Frame" button. It will leave that layer exactly as it was, but will create a new vector layer outside of any layer group. That new layer will have its vector art on frame 0 modified to look exactly as the frame you baked but without any layer or bone influence on its points. If you don't want to use this new layer but the original for whatever reason, just create a point keyframe of the new vector layer on frame 1 for example, copy that point keyframe (that contains the position of all those points) and paste it on the frame 0 of the original vector layer, and then put its layer's numbers at 0.
A little bit complex to explain but test it and you will understand. Very useful script that can be used in a lot of ways for a lot of reasons.

I'm going to take this moment to make this a feature request because It would be very cool to have this functionality officially supported and expanded.

There is another useful script made by Dkwroot called Bake Bones that have some similarities and differences. I will leave this link here in case someone wants to look into it: https://www.lostmarble.com/forum/viewtopic.php?p=173732
User avatar
Hoptoad
Posts: 716
Joined: Sun Jan 03, 2016 4:19 pm
Location: Florida

Re: Make all the translations to a layer become 0, without changing the art

Post by Hoptoad »

Daxel wrote: Mon Jun 07, 2021 12:48 pm ...you can use Hayasidist's Bake Frame script
I watched the video and installed the script. It works, thank you. The script's author mentioned the script earlier in the thread, but I was hesitant to try it, since I wasn't sure if it would work on 12.5 and evidently he wasn't sure either (this was discussed in the thread he'd linked). But you said it works, and it does.

By the way, the script doesn't have a button; there is only the default question mark with a green X through it.

This is what I used Hayasidist's Bake Frame script on already...

I used Import>Moho Object to add a switch layer (filled with numerous hands) to a new character. The switch layer arrived in the wrong location and angle, of course, so I translated it and rotated it on frame 0, which altered all the numbers. I then "baked" the switch layer, resetting the numbers to zero. This should eliminate a problem I often encounter: an imported switch layer starts moving and spinning during my animation and I'm like, "Oh no! What's going on with my-? Oh, right...the switch layer was imported."
Daxel
Posts: 1084
Joined: Wed Mar 27, 2019 8:34 pm

Re: Make all the translations to a layer become 0, without changing the art

Post by Daxel »

Hoptoad wrote: Mon Jun 07, 2021 3:43 pm
I watched the video and installed the script. It works, thank you. The script's author mentioned the script earlier in the thread, but I was hesitant to try it, since I wasn't sure if it would work on 12.5 and evidently he wasn't sure either (this was discussed in the thread he'd linked). But you said it works, and it does.

By the way, the script doesn't have a button; there is only the default question mark with a green X through it.

This is what I used Hayasidist's Bake Frame script on already...

I used Import>Moho Object to add a switch layer (filled with numerous hands) to a new character. The switch layer arrived in the wrong location and angle, of course, so I translated it and rotated it on frame 0, which altered all the numbers. I then "baked" the switch layer, resetting the numbers to zero. This should eliminate a problem I often encounter: an imported switch layer starts moving and spinning during my animation and I'm like, "Oh no! What's going on with my-? Oh, right...the switch layer was imported."
Haha the more time you use the sofware the more you'll love that script.

About the button: I think it doesn't have any icon because its meant to be installed as a menu script. I meant going to the menu script and pressing where it says "Bake Frame". You can see these kind of scripts explained on the video at 4:05 (by the way, I forgot to mention it has english subtittles). Menu scripts are usually preferred when you are not going to use the script very frecuently, so it doesn't need to take space on your tool panel (trust me, you will value that space because there are a lot of awesome scripts). And if you hadn't seen the script menu before, take a look at the scripts that you already have there by default, some are cool!
User avatar
Hoptoad
Posts: 716
Joined: Sun Jan 03, 2016 4:19 pm
Location: Florida

Re: Make all the translations to a layer become 0, without changing the art

Post by Hoptoad »

Daxel wrote: Mon Jun 07, 2021 7:31 pm About the button: I think it doesn't have any icon because its meant to be installed as a menu script. I meant going to the menu script and pressing where it says "Bake Frame". You can see these kind of scripts explained on the video at 4:05 (by the way, I forgot to mention it has english subtittles). Menu scripts are usually preferred when you are not going to use the script very frecuently, so it doesn't need to take space on your tool panel (trust me, you will value that space because there are a lot of awesome scripts). And if you hadn't seen the script menu before, take a look at the scripts that you already have there by default, some are cool!
Oops, I put it in the wrong place. I watched a video the other day that said almost all Moho scripts are tools, so I mistakenly guessed that Bake Frame was a tool.

I moved it into the menu. I wasn't sure what sub-folder to put it in, so I made a new sub-folder with a 1 as the first character of its name, so it'll be at the top of the list. The script appeared as expected. Maybe I'll put all the nifty menu scripts I add in there.
Daxel wrote: Mon Jun 07, 2021 7:31 pmAnd if you hadn't seen the script menu before, take a look at the scripts that you already have there by default, some are cool!
I had used the Split Curve, but that's it. I'll be sure to check-out the others. I'm finally in the stage of my Moho education where I'm learning the cool stuff. I used Follow Path the other day. Holy cow, that tool is amazing.
User avatar
SuperSGL
Posts: 381
Joined: Wed Mar 11, 2015 2:55 am
Location: New Hampshire
Contact:

Re: Make all the translations to a layer become 0, without changing the art

Post by SuperSGL »

Greenlaw wrote: Sat Jun 05, 2021 6:05 pm click the muffin button,
The Muffin Button!!
...Sorry couldn't resist (thought of the ginger bread man in 'Shrek' )

now back to your regularly scheduled post
"Animation is not the art of drawings that move but the art of movements that are drawn."
Norman McLaren


My Animations
Post Reply