MoI discussion forum
MoI discussion forum

Full Version: RefWarp addon

Show messages:  0-19  20-39  40-42

From: krass
1 Sep   [#1]
Dear friends!
I missed this functionality so much in MOI3D... I couldn't resist writing this addon myself (forgive me, Mike!!) – with AI, of course! )))
I submit it for your judgment and criticism.

In a nutshell, it's an add-on to the standard "Image" mechanics that allows you to modify a reference image according to geometry.
You can watch a video of the process here: https://youtu.be/o2xeNbtIfTA?si=rCAc2DcuCPD1l0B5

The script itself is attached in the archive; criticism is welcome.
If anyone can improve this script, I'd be delighted.

So, welcome!

Attachments:
RefWarp_MOI3D_addon.zip


From: Frenchy Pilou (PILOU)
1 Sep   [#2]
you are lucky to success with ai!

I had no success with this paticular problem!
"Select rectangles automatically on the screen"! :)
https://moi3d.com/forum/index.php?webtag=MOI&msg=9689.124

Michael wins the match! ;)

About your script... I have that !
it's the same ? Curves Order


From: krass
1 Sep   [#3] In reply to [#2]
Hi, Pilou!
I'm afraid I'll disappoint you, but my script was written overnight last night in collaboration with Claude.
It didn't work out exactly as I wanted, but it seems to be working as expected.
Which script of yours are you referring to? Please clarify – unfortunately, I'm not familiar with it.
From: Zooen
1 Sep   [#4] In reply to [#1]
Hi Krass,
I’m going to try out your script. I often work with background images.

Often, the images I use, even those with very high resolution, aren’t scaled correctly in the X and Y axes, which is a real problem for me.
From: Zooen
1 Sep   [#5] In reply to [#1]
Hi again, Krass,

I’ve got Python 3.13.15 as an executable, so that’s easy.
As for numPy and pillow, they’re .zip files – I know that, but how do I run them or use them with Python?

Best regards
From: Frenchy Pilou (PILOU)
1 Sep   [#6] In reply to [#3]
Ok all is normal ! I made a false confusing process with folders ! :)

About your script.
It's not like for an image say : 1024 * 716 pixel so 36.12 x 25.56 cm

Draw a rectangle 32.12 x 25.56 cm

With this rectangle and the Edit Frame give it any homothetic measures wanted! Make any adjustments...

Then Menu View / Image / Add in this new rectangle with 2 clicks:)

But maybe I I didn't understand everything of your plugin!


From: Zooen
1 Sep   [#7] In reply to [#6]
Hi,
Pilou, have you watched the video on YouTube ?
Have you read Krass’s post and the instructions for installing the plugin properly ?
From: Frenchy Pilou (PILOU)
1 Sep   [#8]
Seems i must arrive to the same result than the video with my process without plugin ! :)
Draw a rectangle of the proportions of the originale image...
Then Orient Line Line must make the trick ;)
Say we know here the leader size... on the blue axis...
You can repeat the process with Stretch enable on other axes if needing!


From: krass
1 Sep   [#9]
Hello everyone! I really hope Google Translate gets my point across without distorting it too much. So, I'll try to explain again what the addon does.

With it, you can transform a distorted reference image into a more or less correct one.
Yes, something similar can be done in Photoshop. But Photoshop doesn't allow you to set precise dimensions and references.

In the attached images, I've tried to demonstrate the principle of how you can modify an image.

Naturally, I assume that you should know at least some of the parameters—for example, the width or height of an object. You draw a rectangle in MOI3D (for example) and then "pin" the image to the places where it "should be."
Click on the image—click on the corner of the geometry; click on the image—click on the corner.
Placed... Then click Update—the image will be positioned at the designated corners. But your middle section is curved, which should be vertically straight.

Great – click on the points that shouldn't change with the control (they'll turn blue) – they'll "freeze."
And then point to the curved line where it should be vertical – that part of the image will move in the desired direction. Basically, it's like a mix of Distort and Warp in Photoshop.

Image Attachments:
enshot_31.png  enshot_32.png 


From: Frenchy Pilou (PILOU)
1 Sep   [#10]
Yep you right no defomation even Maintain proportion disabled in the Edit Frame Menu Image! :(
Only rotation...



From: krass
1 Sep   [#11] In reply to [#10]
Hi, Frenchy Pilou!
I have a question: were you able to install the addon?
(All files from the archive are placed in the Commands directory, and then you can assign a hotkey as usual, just like any other script.)
If so, were you able to try it out?
What difficulties, if any, did you encounter? Thank you!
From: Frenchy Pilou (PILOU)
1 Sep   [#12] In reply to [#11]
I will install your plugin :)
I believe that now understand! :)

But no Python 3 installed so... :)
From: krass
1 Sep   [#13] In reply to [#12]
Between you and me, I don't know anything about Python and Boa constrictors.
But I asked my AI Claude, and he told me step-by-step what to do to install Python: literally, a couple of console commands.
From: Zooen
2 Sep   [#14]
Hi Krass and Pilou,

For Python, it’s the executable file that needs to be downloaded. However, installing NumPy and Pillow seems a bit less straightforward to me.
From: Frenchy Pilou (PILOU)
2 Sep   [#15]
Yep same for me and not more many free place on my little computer! :)

And Michael confirms that the Edit Frame of the Menu Image will stay in state and will be not transformed!
Better to use a specific Image prog except for a "Style excercie"! (inside Moi! ;)

A process without plugin can be also
Vectorize the image, import it to Moi then use Flow function! ;)
From: Zooen
2 Sep   [#16]
Hi everyone,

Well, I’ve found the best solution for me: I’ve installed GIMP (free and open-source software).
GIMP has transformation tools (13 in total), including the ‘Handle’ tool. Using this tool, I was able to correct the X and Y misalignment in my image, then reshape it into a square (based on the outlines of the objects within my image), and do so with great precision.

I have twenty images that I want to work on. I’m relieved to have found a solution.

I hope my English translation makes sense!
From: Frenchy Pilou (PILOU)
2 Sep   [#17]
...or the free Online Photopea so no need install and no place used! ;)
https://www.photopea.com/
From: Zooen
2 Sep   [#18] In reply to [#17]
...
From: blowlamp
2 Sep   [#19]
This looks useful to me, but I'm getting this error message:




I loaded Python, Numpy and Pillow, but I don't know how to get around the error.
Any help would be appreciated.
Thank you.

Martin.

Image Attachments:
Screenshot 2026-09-02 203114.png 


From: krass
2 Sep   [#20]
I'm sorry you still haven't understood the main feature of this plugin.
I can align images (somehow) in Photoshop, Ngimp, and a bunch of other editors.
But they don't have what MOI3D has: dimension lines, guides, and the ability to precisely align an image to specific parameters. I'm a little tired today, but tomorrow I'll record a video showing how it actually works.
By the way, I've been using it all day – incredibly (for me personally) fast and convenient.

Show messages:  0-19  20-39  40-42