Rhino.FileIO.FileObj.Write bug

Hi @tim,

when exporting meshes using Rhino.FileIO.FileObj.Write using the overload which uses an Array of Rhino.Geometry.Mesh, the following write option seems to be ignored:

obj_options.MapZtoY = True

Meshes in the resulting obj file always are in the same orientation regardless of the MapZtoY value. If i export the whole scene instead, the MapZtoY value is correct.

_
c.

Hi Clement,

I see what you mean. Please see https://mcneel.myjetbrains.com/youtrack/issue/RH-85213 to track the progress.

Tim

1 Like

thank you @tim for fixing this so fast.

_
c.

RH-85213 is fixed in Rhino 8 Service Release 16 Release Candidate

1 Like

Hi @tim, i’m sorry but your recent fix with the obj export goofed up the geometry orientation for the obj export. To repeat this, (using the Release Candidate version (8.16.25021.13001, 2025-01-21), please use below steps, no scripting is required:

  1. Select eg. a planar mesh in the XY plane and export to obj
  2. In the export dialog, enable “Map Rhino Z to OBJ Y”
  3. Click OK to export
  4. Import the obj file back to Rhino
  5. In the import dialog, enable “Map OBJ Y to Rhino Z”

the result is that the imported mesh comes in with the wrong orienation, even when you do not make step 5, the orientation is wrong. So to conclude, the axis swap you do on export is not the inverse axis swap you do on import.

I can repeat the same error when i export using Rhino.FileIO.FileObj.Write with the option obj_options.MapZtoY = True.

thanks,
c.

Hi Clement,

I see what you mean. There were several fixes recently having to do with the YtoZ stuff recently.

https://mcneel.myjetbrains.com/youtrack/issue/RH-85213
https://mcneel.myjetbrains.com/youtrack/issue/RH-85535 https://mcneel.myjetbrains.com/youtrack/issue/RH-85534

I guess I must have gotten one of them not quite right. I’ll dig into it tomorrow. Sorry for the inconvenience.

Tim

1 Like

It may take me a wee bit to figure this out because, I do see the problem in the release build but, it does not happen when I run it in the debugger.

I’m pretty sure I understand what the problem is. I checked the fix for https://mcneel.myjetbrains.com/youtrack/issue/RH-85535 into 8.x after we had branched for 8.16 stabilization. This means the fix is in 8.17 and beyond and it’s the bug you’re experiencing now. The bug you reported initially, https://mcneel.myjetbrains.com/youtrack/issue/RH-85213, actually was fixed in 8.16. Try this build and see if it works better for you. https://files.mcneel.com/dujour/exe/20250123/rhino_en-us_8.17.25023.14001.exe

Hi @tim, yes this version works, either manually export/import or using the API. When will this build be official ? (Just so i can tell the client to update).

thanks,
c.

Hi @clement,

It looks like 8.16 is scheduled for release on February 11, 2025. At the same time a release candidate for 8.17 will be available too. So it will be available on the 11th (as a release candidate) but it won’t be officially released until March 11, 2025. If that’s too far out let me know and I’ll see if it’s possible to get RH-85534 and RH-85535 into 8.16.

Tim

Hi @tim, this would be really great.

thanks,
c.

OK. Those fixes were cherry-picked into 8.16 and should be in the next 8.16 release candidate on January 28, 2025.

1 Like

Thanks Tim, I just ran into the same problem with .obj export axis mapping and scratched my head for a bit.
Pleased to report that 8.16 release candidate has fixed that issue

RH-85213 is fixed in Rhino 8 Service Release 16