Page 1 of 1

Replace image - size issue

Posted: Tue Jun 21, 2005 2:57 pm
by rylleman
When replacing bitmap artwork through "source image..." the new bitmap is stretched/squashed to fit the same space the old one occupied which means that if you make any changes to a piece which involves making it a different size you have to import it as a completely new image and go through the setup process for that part all over again, position/rotation/scale, bone rigging etc.

Posted: Tue Jun 21, 2005 4:04 pm
by jorgy
Sometimes I use this as a fact. Maybe a checkbox like "Keep current animation in place during import?" is called for?

Posted: Tue Jun 21, 2005 5:23 pm
by rylleman
I agree, a tick box to choose if I want this or not would be a good solution.

Posted: Tue Jun 21, 2005 6:44 pm
by nobudget
Right now I just make sure the dimensions are the same when I replace it. If I use a transparent .png for example I create it on a canvas with identical size.

Reindert.
www.nobudgetvideo.com

Posted: Tue Jun 21, 2005 7:11 pm
by rylleman
I try to do that as much as possible as well but sometimes that is impossible.
It only works if you change the part to a smaller size. I guess that you could always work with an empty safe area around your images but that would add unessesary weight to them as well as some extra steps when creating your artwork.

Posted: Tue Jun 21, 2005 7:18 pm
by nobudget
You're right, but planning will always be an important part of animation. I should know, I never plan ahead and have to work myself out of problems constantly! Storyboards? We don't need no stinkin' storyboards!

Reindert.
www.nobudgetvideo.com

Posted: Tue Jun 21, 2005 8:03 pm
by jorgy
I'm thaaaaaaaaaaaat close to having my first animation done. And I swear, as God as my witness, that I will not do another animation without storyboards or an animatic.

Re: Replace image - size issue

Posted: Thu Jan 10, 2019 11:31 pm
by Ponio
This bug is still alive in 2019 (Moho 12.5) huh...

"Set Source Image" doesn't help at all, but I found out that if you do this "Set Source Image" routine via script, it fixes broken proportions.
I wrote a VERY simple script. There are two versions: first one fixes only selectad image layer and the second versoion fixes all the image layers.
To install it, just unpack all the files from ZIP archive to "...\Moho content\Moho Pro\scripts\tool\" folder and restart Moho. You will notice shrtcuts in the tools panel.

Hope it will help someone, cause I couldn't find any solutions for this annoying bug for a long time.

Script files: https://yadi.sk/d/UakPmCqbJUdO6w
or topic on the other forum if filehosting link is dead: http://2danimator.ru/showthread.php?t=10178

Re: Replace image - size issue

Posted: Fri Jan 11, 2019 1:17 am
by synthsin75
I, and probably many others here, don't remember my login for the Russian forum, so we can't download your script.
If you want to share it here, please upload it to somewhere like Dropbox, Mediafire, filedropper, etc. and post the link here.

Re: Replace image - size issue

Posted: Fri Jan 11, 2019 2:03 am
by Ponio
synthsin75 wrote:I, and probably many others here, don't remember my login for the Russian forum, so we can't download your script.
If you want to share it here, please upload it to somewhere like Dropbox, Mediafire, filedropper, etc. and post the link here.
Oh thanks. I forgot that it won't work without authorization. Added link to file hosting.

Re: Replace image - size issue

Posted: Fri Jan 11, 2019 7:23 pm
by Greenlaw
@Ponio, the script sounds very useful, thanks for posting it! Like everybody else here, I wish there was native solution for replacing differently proportioned artwork with its correct proportions, so I'm looking forward to trying it out.

I won't be able to download the script until this weekend but I was wondering, what does the script do to adjust the replacement image to correct proportions? I'm assuming it locks either the x- or y-size to the previous image's size, and then adjusts the other size-axis to fit the new image's proportions. If so, which size-axis gets locked?

Re: Replace image - size issue

Posted: Fri Jan 11, 2019 7:54 pm
by synthsin75
Greenlaw wrote:I won't be able to download the script until this weekend but I was wondering, what does the script do to adjust the replacement image to correct proportions? I'm assuming it locks either the x- or y-size to the previous image's size, and then adjusts the other size-axis to fit the new image's proportions. If so, which size-axis gets locked?
It just resets the source image, but doing it by script seems to have some advantage over doing it manually. I think this just centers the image, instead of stretching it to the former dimensions.

It's basically only doing:
local image = moho:LayerAsImage(moho.layer)
image:SetSourceImage(image:SourceImage())

Re: Replace image - size issue

Posted: Fri Jan 11, 2019 8:36 pm
by Greenlaw
Thanks for the explanation Wes! Much simpler than what I imagined. :)

Re: Replace image - size issue

Posted: Sat Jan 12, 2019 1:15 pm
by Ponio
Greenlaw wrote:Thanks for the explanation Wes! Much simpler than what I imagined. :)
Yup, it was really that easy! I wonder why the same function works differently in UI and in script API.