MoI discussion forum
MoI discussion forum

Full Version: Images in the Object Library

Show messages: All  1-5  6-13

From: fcwilt
11 Aug   [#6] In reply to [#5]
Hi Martin,

It may well be.

I don't remember installing it.

Let me do a bit of research...

OK I got it from here:

https://moi3d.com/wiki/MaxScriptArchive

It's the item at the type: Custom UI

As you can see Max S has been a source of many good things.

The Object Library that is part of it came with a few demo items but you can add your own - it's quite simple.

The great thing is when you pick a part to use, it appears ready to adjust it's orientation to whatever surface you need, at whatever point you need it.

Frederick
From: BurrMan
11 Aug   [#7] In reply to [#1]
Hey Frederick,
Amateur answer for you here....

The "size" of your object seems to matter with how Max coded the image generation. So if a single object, small enough is the target, then you get a great image.

If its "larger"-"Offset"-"Multiple objects" in viewport, then it gets truncated like you show...

This part of the configuration code seems to control a "Zoom Factor" which controls how much can fit in a "centered view"

........
vp.zoom(1.2);
...........

Look in the ObjLibrary.menu.htm file

So my amateur answer is you can set a larger value to "zoom out" and have it fit your larger object or scene

An "expert answer" could take a better look at the code and see if it could be a more "dynamic size" for all related scenarios...

Anyway.... Thats all i got.

Maybe someone else will jump on it....
From: BurrMan
11 Aug   [#8] In reply to [#7]
If you are a "code reader" and want to experiment with results, I would look at this line:

..................
moi.ui.mainWindow.viewpanel.getViewport('3D').render(400, 320).save(savepath+fileName+".png");
..................

And fool around with the render size of the screengrab in relation to the zoom value to get better results for the type of objects you use
From: fcwilt
11 Aug   [#9] In reply to [#8]
Hi BurrMan,

Thanks for the reply.

I wonder if the (400, 320) is the ideal size for the image I am supposed to create.

Maybe it's the proportions that are important.

Time to experiment.

Frederick
From: BurrMan
11 Aug   [#10] In reply to [#9]
I fooled around with it a bit....

Changing the resolution of the created png file didnt change the behavior you are after

Changing the zoom factor seems to control it better

I found a setting of "2.0" to work as you asked

The line:

...........
vp.zoom(2.0);
...............

With that said, I have no idea what that means
From: fcwilt
11 Aug   [#11] In reply to [#8]
Hey BurrMan,

You provided the solution.

Making sure the image ratio is 5:4 (400 divided by 320) and the image comes out nicely centered.

And Windows (I think it is part of Windows) happens to have a tool which allows adjusting an image to exactly 5:4.

Thanks.

Frederick
From: Michael Gibson
11 Aug   [#12] In reply to [#6]
Hi Frederick,

re:
> The great thing is when you pick a part to use, it appears ready to adjust it's orientation
> to whatever surface you need, at whatever point you need it.

That's using the ImportPart command, you can run it by right clicking on File > Import.

- Michael
From: fcwilt
12 Aug   [#13] In reply to [#12]
Hi Michael.

Good to know.

Before encountering that feature in the Object Library, I was importing parts and messing around with aligning them using move/rotate which was tedious.

Frederick

Show messages: All  1-5  6-13