MoI discussion forum
MoI discussion forum

Full Version: MoI file to Blender > MoI

Show messages: All  1-3  4-10

From: Michael Gibson
2 Jul 2019   [#4] In reply to [#3]
Hi mat,

re:
> However...OJB created in Blender to MoI...loses the original quads with the "create > SubD" button...

Yes, that's a feature of the SubD importer that it combines patches to make larger surfaces where possible.


> but keeps the quads with the MoI V4 "ImpObj" button/script. However, the scale size is different.

The scale size is also a feature of how Max's ImportOBJ script works by default. But there is an option you can use to change that and maintain the original size, see here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=6674.453

- Michael
From: mat10x
2 Jul 2019   [#5] In reply to [#4]
Hi Michael,

> Yes, that's a feature of the SubD importer that it combines patches to make larger surfaces where possible.

Ah I see how it works now with an actual model part. Yeah big difference, much better without hundreds of quads. Very cool.

So how do I get the "SubD > create > from file" to import at the same scale and X/Y/Z position as the Blender created OBJ? I was able to scale it up by just changing the decimal place but...is there an automatic way to do it?

I looked at the Import/Export options in MoI "OBJ options"...scale factor is at "1". I'm assuming that means 1:1 scale? Blender test model is 430.0mm wide...but imports to MoI at 0.43mm.

> Max's ImportOBJ script
Tried Max's "exact" trick..."_ImportOBJ exact.htm" and "_ImportOBJ exact.js" Command files...but I get an error message.

Thx,

M
From: Michael Gibson
3 Jul 2019   [#6] In reply to [#5]
Hi Mat,

re:
> I looked at the Import/Export options in MoI "OBJ options"...scale factor is at "1". I'm assuming that means 1:1 scale?

That option is only for OBJ export out from MoI, it doesn't have any effect for the SubD importer.


> Blender test model is 430.0mm wide...but imports to MoI at 0.43mm.

That's for your "Box_2_subD_test.obj" file? I opened that file in several other applications like Rhino and Silo and get the same result as in MoI.

It sounds like this could be a bug or quirk in the Blender OBJ exporter, it seems like it might be rescaling the output to be in meters units instead of just keeping the existing coordinates without any modification. But there is nothing in the OBJ spec that says that it should be in meters.

Or perhaps you are actually working in meters in Blender and not in mm like you think you were?

One way you can solve it would be to switch your MoI units to meters before you do the import, then switch it back to mm after you've done the import.

Another solution would be to set the Blender option for scaling the output, the control for it is shown in the lower left area of the Blender window when you do the export. Scroll down to the bottom and set the Scale option there, set it to 1000. There is a description of this here:
https://blender.stackexchange.com/questions/17966/blender-units-vs-metric


> > Max's ImportOBJ script
> Tried Max's "exact" trick..."_ImportOBJ exact.htm" and "_ImportOBJ exact.js" Command files...but I get an error message.

The error message is coming from adding the .htm or .js at the end there. You need it to be: "_ImportOBJ exact" without any additional stuff added to the end.

- Michael
From: mat10x
3 Jul 2019   [#7] In reply to [#6]
Hi Michael,

A. Blender > MoI scale

"That's for your "Box_2_subD_test.obj" file?"
I tested a particular project file. The Blender units are set in Millimeters....and I have MoI set up in MM as well. If I switch MoI to Meters...I get the same scale issue import result.

Switching Blender export scale to 1,000 as you suggested works...and the x/y/z position is now also correct. Now the MoI import is much closer...still off by a tad though.

Blender
X: 210mm
Y: 428mm
Z: 42.4mm

MoI
X: 210.41 (Measures 210.38 when measured point to point in MoI, but 210.41 general measurement, see image).
Y: 427.79
Z: 42.37

Center to center measurement of the bars seems spot on at 403.55mm.

B. Import OBJ
- Took off the .htm and .js...still no go. Image attached.

Thanks Michael.

M

Image Attachments:
Blender_measurements.png  Blender_Units.png  ImpObj_command_files.png  MoI_Measurements.png  MoI_Units.png  MoI_width.png  MoI_X_measurement.png 


From: Michael Gibson
3 Jul 2019   [#8] In reply to [#7]
Hi mat,

re:
> B. Import OBJ
> - Took off the .htm and .js...still no go. Image attached.

It looks like you're renaming the file names in your commands folder. That won't do what you need - the link above (http://moi3d.com/forum/index.php?webtag=MOI&msg=6674.453) is about setting up a shortcut key, you do that inside MoI in the Options dialog Shortcut keys
section, not inside the macOS Finder.

If you set up a shortcut key (in the MoI Options dialog) with "_ImportOBJ exact" as the command part of the shortcut key, then you would trigger the command by pressing the shortcut key.

But also another way you could get it set up would be to modify the _ImportObj.js script file in a text editor so that the "exact" behavior is the default. Then you would not need to set up a parameter for it and you would also be able to use the button for it instead of a keyboard shortcut.

To do that, open up _ImportObj.js in a text editor and go to line number 10 which has this currently:

code:
if ( moi.command.getCommandLineParams() ==='exact' ) { moi.ui.commandUI.normalizeObj( false ) } else { moi.ui.commandUI.normalizeObj( true ) }


replace it with this instead:

code:
if ( true ) { moi.ui.commandUI.normalizeObj( false ) } else { moi.ui.commandUI.normalizeObj( true ) }


Hope that works for you!

- Michael
From: Michael Gibson
3 Jul 2019   [#9] In reply to [#7]
Hi mat,

re:
> Now the MoI import is much closer...still off by a tad though.

Maybe your bounding box measurement in Blender is giving you the bounding box of the control polygon hull, while in MoI it's giving you the bounding box of the smoothed subdivision surface?

- Michael
From: mat10x
6 Jul 2019   [#10] In reply to [#8]
Hi Michael,

Hope you had a great 4th!

- ImpOBJ text editor script change works great!

- "Maybe your bounding box measurement in Blender is giving you the bounding box of the control polygon hull, while in MoI it's giving you the bounding box of the smoothed subdivision surface?"
Hmm, I'll have to look into that possibility.

Thanks so much for all your help!

M

Show messages: All  1-3  4-10