iimachines / Maya2glTF

Maya to glTF 2.0 exporter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support Cameras and keep textures outside glb?

1fth3n3ls3 opened this issue · comments

The readme file specifies camera export it is not in the current roadmap of this project. I hope my vote can count to reconsider this and add this feature.
Quite selfish by my side but having the option of exporting cameras is a requirement in the use I would give to the glTF files.

The latest release candidate (Release candidate 3) should already have partial support for this, could you try it out?

You just have to make sure to include the camera(s) in your selection before exporting.

I just could try a fast test. If I try to export only the camera I get an error message a nothing gets exported. I select mesh with the camera, then the camera gets exported but I can't verify if the data exported it's accurate.

Oh you have found a bug.

Ah yes, we currently only export cameras as separate files, without geometry.

So this needs fixing. Will look at this ASAP.

Thanks for testing!

Thanks for testing!
No, thank you for the fast answer and support.

Turns out you can currently export a single camera (say persp) by passing the flag -cam persp... Exporting multiple cameras doesn't work yet. The exported camera properties aren't that well tested either, this is new stuff.

I'm going to refactor the code so more than a single camera can be exported, by providing multiple -cam arguments.

Could you try Release candidate 4? This might work for you.

Hi, I tried several things. First I export a character with two cameras. The way I got both cameras exported was reapeating -cam flag for each camera. I don't know if this is the intended way to do it.
Then I exported only an animated camera with 3 keys and fov animated between second and third keyframe. The exporter didn't throw any error in the process. Exporting to glb or gltf format.
One thing that happens when I try to export the camera, with animation option set to none, the exporter throw an error when I export to gltf. It doesn't when I use -glb flag.

One question not related with cameras. When I export with -glb flag is there a way to exclude textures from the final glb file?

Thanks for testing. Cameras should be exported if you select them, or if you pass them as -cam flags.

I don't support animating fov yet, I am not sure if GLTF supports that, will look into it.

Having an option to exclude textures from the glb file would indeed be handy. I will make an issue for that.

Could you share a scene that crashes when exporting to GLTF?

Hi, maya doesn't crash but exporter throw this error: !!! maya2glTF: failed at 10:44:47 !!!
I had provided the scene but the error is easy to reproduce. Just create a camera, try to export without animation and the error mentioned before is throw. I'm working with maya 2019 in windows 10 platform.

camera.zip

Could you try the latest release? (rc5)

Passing the extra flags -glt -ext should keep the textures external from the glb.

I also tried to fix the camera export crashing.

As for animating FOV, note that GLTF doesn't support this.

Everything seems to be working fine.
I had tried both things and I no longer get errors exporting camera alone in glTF format. Also the option to export to .glb, textures are copied to the export folder but they are not included in the .glb file.
About fov animation, it could be an issue but it's nothing you can do if glTF doesn't support it.
Thanks a lot for the great and responsive support.

Thanks for the help and for using Maya2glTF!