Replace image - size issue

Discuss Moho bugs (or suspected bugs) with other users. To report bugs to Smith Micro, please visit support.smithmicro.com

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Replace image - size issue

Post 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.
User avatar
jorgy
Posts: 779
Joined: Sun Sep 05, 2004 8:01 pm
Location: Colorado, USA

Post by jorgy »

Sometimes I use this as a fact. Maybe a checkbox like "Keep current animation in place during import?" is called for?
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Post by rylleman »

I agree, a tick box to choose if I want this or not would be a good solution.
nobudget
Posts: 412
Joined: Wed Aug 04, 2004 5:01 pm
Contact:

Post 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
User avatar
rylleman
Posts: 750
Joined: Tue Feb 15, 2005 5:22 pm
Location: sweden
Contact:

Post 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.
nobudget
Posts: 412
Joined: Wed Aug 04, 2004 5:01 pm
Contact:

Post 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
User avatar
jorgy
Posts: 779
Joined: Sun Sep 05, 2004 8:01 pm
Location: Colorado, USA

Post 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.
Ponio
Posts: 3
Joined: Thu Jan 10, 2019 10:46 pm

Re: Replace image - size issue

Post 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
Last edited by Ponio on Fri Jan 11, 2019 1:58 am, edited 1 time in total.
User avatar
synthsin75
Posts: 10160
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Replace image - size issue

Post 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.
Ponio
Posts: 3
Joined: Thu Jan 10, 2019 10:46 pm

Re: Replace image - size issue

Post 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.
User avatar
Greenlaw
Posts: 9900
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Replace image - size issue

Post 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?
Last edited by Greenlaw on Fri Jan 11, 2019 8:36 pm, edited 1 time in total.
User avatar
synthsin75
Posts: 10160
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Replace image - size issue

Post 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())
User avatar
Greenlaw
Posts: 9900
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Replace image - size issue

Post by Greenlaw »

Thanks for the explanation Wes! Much simpler than what I imagined. :)
Ponio
Posts: 3
Joined: Thu Jan 10, 2019 10:46 pm

Re: Replace image - size issue

Post 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.
Post Reply