Feature request: change export units and auto scale on export

Next
 From:  -ash-
2241.1 
Hi Michael, everyone,

Well, I have been struggling a bit with getting the right size when exporting from MoI to modo. Eventually found out that modo thinks in meters regardless of whether the units are set to mm, cm, etc. The units setting only changes the way these units are displayed in modo. So if I create a 10 mm rad sphere in MoI and export it to modo it becomes a 10 m rad sphere :-(

Then I found the 'Scale on unit system change' setting hidden away in the options. Brilliant, this does the job, change to metres and my model is automatically scaled to the right size. But it is hidden away and would have to be changed every time I export and then set back again to continue working in something other than metres.


So I was wondering if it is possible to have the export mesh dialog have the units option and MoI do the scaling automatically. I imagine the work flow to be something like this:

. Set units to what you want to work in, e.g. mm
. Create model
. Call up export mesh dialog
. Set units for export, e.g. metres
. Export (model is scaled based on new units, exported and then scaled back to original size)

I have no idea if this is lot, or a little, work but it would help speed my work flow when taking things into other apps.

What do you think?

Regards
Tony

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  PaQ
2241.2 In reply to 2241.1 
Hello Tony,

I didn't have any scale problem from MoI to Modo, just using meter as default in both software.



Works in .lwo and .obj. (but maybe I don't understand your problem too)

EDITED: 3 Feb 2010 by PAQ

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  -ash-
2241.3 In reply to 2241.2 
Hi, PaQ,

Thanks for the reply, but, that's because modo works in meters. So you have a one to one correlation. You could also just set both modo and MoI to no units. Then 1 unit in MoI equals one unit in modo.

But I was making a small item less than 50 mm high. I really wanted to work in millimetres. I can visualise that quite well. Michael has provided an answer to this problem with 'Scale on unit change'.

So, what I'm doing now is setting the units to metres in MoI after the modeling is done. MoI will scale my model accordingly before I export. But this has to be done through the options before exporting, and then put back again after exporting.

What I was asking is if Michael can make it so that it is done automatically during the export process :-)

Regards
Tony

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
2241.4 In reply to 2241.3 
Hi Tony, in the moi.ini file there is an option:

[LWO]
ScaleToMeters=n


If you set that to =y instead (make sure to shut down MoI first before editing the moi.ini file) then I think that should do what you want here. When that setting is enabled, it will do the same thing as changing your unit system to meters with the scaling enabled, but do it just for the mesh data that is exported to the .lwo file.

Let me know if that does not do the job that you need for this.

If that handles what you need then maybe I should promote that setting to have some UI for it under Options.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  -ash-
2241.5 In reply to 2241.4 
That did the trick.

Now a 10 mm rad sphere in MoI is a 10 mm rad sphere in modo :-)

>>>If that handles what you need then maybe I should promote that setting to have some UI for it under Options.

I think this would be a good idea - would have saved me a lot of mucking about ;-)

Regards
Tony

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  AW (AWSILVER)
2241.6 
Not to add more work for MG, but it would be really nice if there were a scale factor setting for export...our engineering data is always in inches, and I'm constantly converting (scaling) imported assemblies by 25.4 (love to be able to skip this step for a multitude of reasons). Seems to be a common theme for rendering progs to work better with metric scaling, and a general scale factor on export would really nice and flexible (and global for all exports - possibly???).

Also, while on the exporting subject...any way to tie the mesh angle down? Constantly setting it isn't a show stopper, but would be nice if it was persistent or the default could be user set.

Cheers!
AW
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  yannada
2241.7 In reply to 2241.4 
where is moi.ini ?

Is it possible to have a dummy friendly option and MoI do the scaling automatically?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  -ash-
2241.8 In reply to 2241.7 
> where is moi.ini ?


For a Windows PC:
C:\Documents and Settings\[your username]\Application Data\Moi

Regards
Tony

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  yannada
2241.9 In reply to 2241.8 
thanks Tony
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
2241.10 In reply to 2241.6 
Hi AW,

> Not to add more work for MG, but it would be really nice if
> there were a scale factor setting for export...

There is one currently available for OBJ format export - you can set that under Options > Import/Export > OBJ options > Scale Factor.

Setting that will apply that scale factor to all the data exported to OBJ format files.

Does that do what you need for this?


> our engineering data is always in inches, and I'm constantly
> converting (scaling) imported assemblies by 25.4 (love to be
> able to skip this step for a multitude of reasons).

Do you mean you are manually scaling by 25.4 ? Normally it is intended that you should be able to switch your unit system from Inches to Millimeters which will apply this scale factor for you.

Are you not getting your units set to inches when you bring the data in? (you can check the current unit system under Options > General > Unit system) If not then maybe you are using File/Import instead of File/Open? File/Import is meant to suck in the contents of another file and accumulate / merge it into the current file rather than replacing the whole current file with the given file. But that also means that some file-level settings like the current unit system will not be changed when you do a File/Import. If you do a File/Open then that will bring in the unit system as well.

After you have opened the file and your units are set to Inches, you can also set up a keyboard shortcut for switching to Millimeters to make that scaling easier. To do that go to Options / Shortcut keys, and add in a new entry. For the command put in this:

script:moi.geometryDatabase.units = 'Millimeters';

With that in place you should be able to convert to millimeters and apply your scale factor with one keystroke. Maybe check under Options > General > Unit options to see that "Scale on unit system change" is enabled, it is by default.


> Also, while on the exporting subject...any way to tie the mesh angle
> down? Constantly setting it isn't a show stopper, but would be nice
> if it was persistent or the default could be user set.

It should be remembered automatically while inside the same program session.

But there is not currently a way to set the initial default for the initial use. I'll add in an option to enable setting the default for this in the moi.ini file.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
2241.11 In reply to 2241.7 
Hi yannada,

> Is it possible to have a dummy friendly option and
> MoI do the scaling automatically?

What kind of scaling do you need to do?

There is a system already built in to apply scaling automatically when you change your unit system, is that not working for you or do you need some particular kind of scaling for some kind of special purpose?

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  yannada
2241.12 In reply to 2241.11 
I am sorted with the moi.ini trick for now, I had the some problem with Tony but with a different software. thanks
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
2241.13 In reply to 2241.12 
Hi yannada, that is for making the .lwo export scaled to use meters units in the exported file?

For the next v2 beta I have added this to the Options dialog under Options > Import/Export > LWO options > "Scale output units to meters" to make it easier to set this one on or off.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  yannada
2241.14 In reply to 2241.13 
Cool thanks
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  AW (AWSILVER)
2241.15 In reply to 2241.10 
>> Do you mean you are manually scaling by 25.4 ? Normally it is intended
>> that you should be able to switch your unit system from Inches to Millimeters
>> which will apply this scale factor for you.

Opening the STEP file in Rhino/MoI auto sets the scaling to inches (no problem there). What I've done in the past is change the unit (and let it scale) and works great. I hate working in mm however (since any changes are relayed in inches...the original STEP file is in inches) as well as "add on geometry" is relayed in inches. I'd prefer to keep the geometry in inches...so I'm just picking at "nits"...

>> There is one currently available for OBJ format export - you can set that under
>> Options > Import/Export > OBJ options > Scale Factor.

I looked for that -- musta missed it! That'll probably do the trick, a question on that however...does it translate the scaling before or after meshing? This is getting into a whole other realm, but I do know from past experience there is a HUGE difference in output (with our geometry at least) between a mesh in inches vs millimeter (hopefully I'm not blurring Rhino and MoI experiences).

>> It should be remembered automatically while inside the same program session.

Single session it works as advertised, for some reason we're constantly dumping in and out of MoI and other apps so a tween-session/default value would be awesome!

Thanks Michael!!!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
2241.16 In reply to 2241.15 
Hi AW,

> I looked for that -- musta missed it! That'll probably do the
> trick, a question on that however...does it translate the scaling
> before or after meshing?

It scales after meshing is done - the scaling is applied to mesh vertices just as they are being written into the OBJ file.

Please let me know if that does not handle what you need!


> This is getting into a whole other realm, but I do know from past
> experience there is a HUGE difference in output (with our geometry
> at least) between a mesh in inches vs millimeter (hopefully I'm
> not blurring Rhino and MoI experiences).

There normally shouldn't be a difference in MoI, when you are only using the "Angle" parameter, which is independent of size - unlike some other parameters such as "Divide larger than" which take a distance value (distances are sensitive to scale factors but angle measurements are not).

But there is one bug that I have fixed up for the next v2 beta that did affect polygons that were pretty small in size though (like around 0.001 units in size).


> Single session it works as advertised, for some reason we're
> constantly dumping in and out of MoI and other apps so a
> tween-session/default value would be awesome

In the next v2 beta, there will be some new values you can set in the moi.ini file to control the initial default values of the meshing options.

These will be in the moi.ini file under [Mesh Export] :

[Mesh Export]
Angle=
DivideLargerThan=
DivideLargerThanApplyTo=
AvoidSmallerThan=
AspectRatioLimit=

So setting whatever you want there should handle this part for you in the next v2 beta.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  AW (AWSILVER)
2241.17 In reply to 2241.16 
>> It scales after meshing is done - the scaling is applied to mesh vertices just as they are being written into the OBJ file.

I'll check this out -- again, it mighta been a Rhino thing, the "mesher" you have in MoI has MUCH better output so hopefully those little anomalies won't show up in the first place. :D

>> In the next v2 beta...

Plus the speed of the new meshing routines! Drooling in anticipation!

Cheers!
AW
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Michael Gibson
2241.18 In reply to 2241.17 
Hi AW,

> Plus the speed of the new meshing routines! Drooling in anticipation!

:) You're not going to even believe how much faster it is.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All