Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SpatialMeshExporter] OBJ file format exported not opening #8475

Closed
thibaultgrad opened this issue Sep 4, 2020 · 7 comments · Fixed by #10208
Closed

[SpatialMeshExporter] OBJ file format exported not opening #8475

thibaultgrad opened this issue Sep 4, 2020 · 7 comments · Fixed by #10208
Labels
Bug Urgency-Soon High priority issues to be worked on after Urgency-Now issues Won't Fix A real bug, but Triage feels that the issue is not impactful enough to spend time on

Comments

@thibaultgrad
Copy link

Describe the bug

The SpatialMeshExporter.Save method export a non openable obj file.
After solving the file formatting by replacing the decimalseparator by "." and replacing "/" by "//" , the obj file opens up. The problem is that the objwriterutility doesn't transform the left handed coordinate system so the resulting obj file is a mirror of the actual mapping of the room.

To reproduce

Steps to reproduce the behavior:

  1. Call something like SpatialMeshExporter.Save(_spatialObserver, savepath); where _spatialObserver=CoreServices.GetSpatialAwarenessSystemDataProvider()
    savepath can be application.persistentDataPath
  2. Build to Hololens
  3. Launch
  4. Download the obj file (via the device portal /localappdata/localstate) and try to open it with windows

Expected behavior

The obj file should open correctly and should be mirrored to get the right mapping (not the mirrored one).

Screenshots

If applicable, add screenshots to help explain your problem.

Your setup (please complete the following information)

  • Unity Version 2019.3.4.f1
  • MRTK Version 2.4.0

Target platform (please complete the following information)

  • HoloLens
  • HoloLens 2

Additional context

Add any other context about the problem here.

@david-c-kline david-c-kline added the Urgency-Soon High priority issues to be worked on after Urgency-Now issues label Sep 8, 2021
@david-c-kline david-c-kline added this to Needs Triage in [Retired] MRTK Backlog via automation Sep 8, 2021
@david-c-kline david-c-kline added this to the MRTK 2.x future milestone Sep 8, 2021
@keveleigh
Copy link
Contributor

After solving the file formatting by replacing the decimalseparator by "." and replacing "/" by "//" , the obj file opens up.

What were you trying to open the obj with? I haven't been able to get something to refuse to import/open it (I generated my file from the Unity editor, so maybe it's something about on-device? or I wonder if this is a globalization culture difference, where we're assuming . but sometimes it's represented as ,), using

  1. Paint 3D
  2. 3D Viewer
  3. Unity

I do repro the incorrect coordinate system though. Looks like we get both the coordinate system and the winding order wrong.

@keveleigh
Copy link
Contributor

@thibaultgrad I opened #10208 to try to fix the coordinate space, winding order, and culture-specific formatting issues. I wasn't able to repro any issues with /, so I wasn't sure what to fix there. Please take a look and see if this fixes your issue! Thanks!

[Retired] MRTK Backlog automation moved this from Needs Triage to Fixed - Needs Release Notes Sep 14, 2021
@thibaultgrad
Copy link
Author

Thanks @keveleigh, i tested the culture specific issue and it did the trick. The coordinate space is also correct. The only problem i still have is the one with the "/".
Paint 3D or 3D Viewer won't open the exported obj file. The same file opens up well in SolidWorks or CAD Processor. It might be a Windows tools issue.
I check the obj file format specification and i saw that :

image

When I replace "/" by "//" in the obj file with NotePad++, the OBJ file opens in 3D Viewer.

@keveleigh keveleigh reopened this Sep 15, 2021
[Retired] MRTK Backlog automation moved this from Fixed - Needs Release Notes to In progress Sep 15, 2021
@keveleigh
Copy link
Contributor

When I replace "/" by "//" in the obj file with NotePad++, the OBJ file opens in 3D Viewer.

Huh! For whatever reason, I'm not having the same problem opening in the Windows tools :/ We shouldn't need the // from the spec, since we're writing out all three. Would you be able to drop me a sample obj to test on my end please?

@thibaultgrad
Copy link
Author

thibaultgrad commented Sep 22, 2021

Here are the 2 files the modified is the one that opens with 3D Viewer the other one is the raw file exported by the unity app on Hololens 2.
As I said the raw one opens up well with SW or CAD Processor.

XR SDK Windows Mixed Reality Spatial Mesh Observer.zip

@thibaultgrad
Copy link
Author

My project is using mrtk 2.7.2. what is the best/most smooth solution to benefit the invariant culture formatting while waiting for the next mrtk release ?

@IssueSyncBot
Copy link
Collaborator

We appreciate your feedback and thank you for reporting this issue.

Microsoft Mixed Reality Toolkit version 2 (MRTK2) is currently in limited support. This means that Microsoft is only fixing high priority issues. Unfortunately, this issue does not meet the necessary priority and will be closed. If you strongly feel that this issue deserves more attention, please open a new issue and explain why it is important.

Microsoft recommends that all new HoloLens 2 Unity applications use MRTK3 instead of MRTK2.

Please note that MRTK3 was released in August 2023. It features an all-new architecture for developing rich mixed reality experiences and has a minimum requirement of Unity 2021.3 LTS. For more information about MRTK3, please visit https://www.mixedrealitytoolkit.org.

Thank you for your continued support of the Mixed Reality Toolkit!

@IssueSyncBot IssueSyncBot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 13, 2024
@IssueSyncBot IssueSyncBot added the Won't Fix A real bug, but Triage feels that the issue is not impactful enough to spend time on label Jan 13, 2024
[Retired] MRTK Backlog automation moved this from In progress to Fixed - Needs Release Notes Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Urgency-Soon High priority issues to be worked on after Urgency-Now issues Won't Fix A real bug, but Triage feels that the issue is not impactful enough to spend time on
Projects
[Retired] MRTK Backlog
Fixed - Needs Release Notes
5 participants