OpenGEX icon indicating copy to clipboard operation
OpenGEX copied to clipboard

OpenGex Blender exporter updated

Open miguelcartaxo opened this issue 2 years ago • 6 comments

This is based on @joeld42 pull request (here). Created a new one because that one was never accepted or updated after comments. To be clear, this is the original blender exporter made by @EricLengyel with the updates made by @joeld42 plus the following:

  • Fixed crash "Scene.frame_set(): required parameter "subframe" to be a keyword argument!" when exporting animations;
  • Fixed crash when exporting with "Selection Only" option is set;
  • Fixed crash when exporting mesh with vertex colors;
  • Added option to export floats as hexadecimals;
  • Added option to export Vertex Colors (off by default);
  • Added option to export UVs (on by default);
  • Added option to export Normals (on by default);
  • Added option to export Materials (on by default);
  • Log the file name being exported and how long it took to export it;
  • Re-enable morph targets export, after a couple of fixes;
  • Updated calls to free allocated mesh to 2.80 api;

I've tested with a couple of free 3d assets on Blender 2.93 and 3.3 for these fixes. Obviously this is not battle tested, but I think it's in a basic useful state for people wanting to work with OpenGex.

miguelcartaxo avatar Apr 25 '23 14:04 miguelcartaxo

@miguelcartaxo @miguelcartaxoZPX Thanks for the blender script. I tried and wondering if animation are still working. Importing works but with animation I have some trouble at least with models downloaded from mixamo. Did you encountered something similar or any issues with animation?

neises avatar Sep 29 '24 07:09 neises

Hello, unfortunately, animation is not well tested. I didn't have animation models to tested on, I only recently grabbed some from a humble bundle to test but I have not gotten to it. Since this pull request was never accepted, and it's been more than a year, I've only made a couple more fixes on my private repos and been spending my time creating a OpenGex Blender importer, so I could have a .blend or .fbx file with animation and/or other stuff, import it to Blender, then exported as .ogex, see if it looks reasonable, then imported and compared with the original.

EDIT: It is a shame really, I wish the OpenGex support was better and more people were interested in it, I've done some quite thorough research looking for 3d file formats and this one seems the most reasonable and sane one with a good feature set, but no one uses it or supports it.

miguelcartaxo avatar Sep 29 '24 10:09 miguelcartaxo

@miguelcartaxo Thanks. I still investigating and try to fix the animation issues I currenlty have BUT I haven´t worked with blender or python a lot so I don´t have big insides of it. Will see how it goes.

neises avatar Sep 29 '24 10:09 neises

What is the issue? Does it fail to export? Or exports successfully but there is missing data on the file?

I was in the same boat, I have never worked with Blender before this (code-wise), and my experience with python was very limited, so I had to research how to properly debug a plugin in blender, figure out the Blender API and all of that stuff.

miguelcartaxo avatar Sep 29 '24 11:09 miguelcartaxo

@miguelcartaxo I tried a few models from the mixamo website. Import the fbx into blender and exported the file with the ogex blender file ( I did modify it a bit - but nothing special so far). After I exported it I used the c4 engine to import the model into the world. The model itself was looking good BUT I encoutered issue when I export animation from Blender and import them into the c4 engine. The issue was mainly that the animation has some offset applied and keeps the model jiggling.

neises avatar Sep 30 '24 06:09 neises

@miguelcartaxo

Does it fail to export?

Mostly works BUT I suspect it depends on which option you choose. However I think animation are broken but not entirly sure.

Does it fail to export?

The export itself is succesful

Or exports successfully but there is missing data on the file? I´m looking into the ogex file but from what I can tell it looks good - only the animation part is something that I´m not 100% sure.

Cheers

neises avatar Sep 30 '24 06:09 neises