Giter Site home page Giter Site logo

dancovich / libgdx_blender_g3d_exporter Goto Github PK

View Code? Open in Web Editor NEW
56.0 9.0 20.0 7.58 MB

Blender exporter to create G3D text files. The G3D format is a 3D model document format compatible with the LibGDX framework.

License: GNU General Public License v3.0

Python 96.74% Java 3.26%

libgdx_blender_g3d_exporter's Issues

Exporting unused parts

To reproduce:
Create a model that has three materials. Do not assign one of the materials to the model. Export said model.

What happens:
In g3dj, there is an entry in "nodes" and "parts" for the material. Parts has no vertexes. If you try to import said model, g3dj will give you an error saying there's an invalid part. g3db gives a more cryptic error, but I assume it's the same thing under the hood. Manually deleting the node and part in g3dj makes the model work.

Texture file name, and Material.emissive property

This is a good utility, but I encountered a couple of issues that needed to be worked around.

I'm not sure if this was intended, but, the file name for the texture is set to the texture path relative to the blender workspace. So when using the g3d file to a libgdx project, it looks for the texture using the wrong path and will throw an error unless you modify your libgdx project to have the same relative path to the texture. Alternatively, when working in Blender you could probably load your texture from a location that matches the location of the texture relative to your libgdx project texture before exporting, but I haven't tested this yet.

I believe the line is at 503 in g3d_exporter.py:
currentTexture.filename = (self.getCompatiblePath(slot.texture.image.filepath))

The other issue that I had is that exported models seem to always have emissive properties regardless of how their emissive properties are set in Blender. This results in a model that looks washed out if you did not intend for it to be emissive.

I think this stems from line 473 in g3d_exporter.py :
currentMaterial.emissive = [blMaterial.diffuse_color[0], blMaterial.diffuse_color[1], blMaterial.diffuse_color[2]]

I worked around this by removing emissive property in my libgdx project code, but of course that means you can't have an emissive model if you wanted.

Other than that, this has been extremely helpful for using Blender models with LibGDX, thanks!

Cycles node editor

Is it possible to include Cycles Render and node editor materials export in the future? Are there any limitations using such complex materials in libgdx?

Y-up and G3DB support

Without automatic Y-up conversion and possibility to export to G3DB directly, there still needs to be a post-processing step taken before being able to incorporate a model into a game, which makes this even worse solution than using blender->FBX->G3D

I know this ain't easy task, but this exporter isn't very useful without those options. At least the Y-up conversion would make quick prototyping much easier.

Export fail if scene only contains animation

Hello

I have some FBX that only contains animation, and it fail to export because it requeires a model with material

Would be cool if it was able to still export even if it is only for the animation

Dope sheet actions don't get exported

I am using the dope sheet to create keyframe actions, but they are not exported to the g3dj file. It works properly if I use the fbx exporter and convert it afterward, but it would be nice for it to work using this.

bpy.ops.export_json_g3d scene arguments

I can't put an argument to define the scene usint bpy.ops.export_json_g3d.
I had to export the data that is only in the scene I am in. But I want to pass the name of the scene that I need to export in order to export all the scenes separately.
It is for use with the bdx engine.
sorry for my English

G3DB output

Would it be possible to output some g3db files too ?
g3dj is very useful to debug and check, but for database space saving the binary format is very useful.

Thanks !

armature animation error

I found that if you create an animation it saves correctly but if you create two animations the first animation is the sum of the first and the second animation and the second animation is like the sum of that new first animation and the second animation.

Can't export with texture

Not sure if this is even still active but I have a problem that is probably just a settings issue.

I'm using this plug-in conveniently the version it's compatible with is the last version compatible with my dell dimension dinosaur. but every time I try to export my model with textures it throws this error:

Traceback (most recent call last):
File "c:...\io_scene_g3d_\g3d_exporter.py", line 116, in execute
return self.startExport(context)
File "c:...\io_scene_g3d_\profile.py", line 33, in profile_fun
return fun(*arts, **kwargs)
File "c:...\io_scene_g3d_\g3d_exporter.py", line 140, in startExport
materials = self.generateMaterials(context)
File "c:...\io_scene_g3d_\profile.py", line 33, in profile_fun
return fun(*arts, **kwargs)
File "c:...\io_scene_g3d_\g3d_exporter.py", line 495, in generateMaterials
util.debug("found texture {!s}. texture coords are {!s}, texture type is {!s}", slot.name, slot.texture_coords, slot.texture.type)
AttributeError: 'NoneType' object has no Attribute 'type'

location: :-1

2.78 support?

I seem to have a problem to enable the plugin with blender 2.78. Is that version supported?

Export doesn't include animations

I tried exporting the default blender scene with the cube and it works great. However when I add LocRotScale keyframe to frame 1, then scale and add another LocRotScale keyframe to the last frame and export it, there are no animations listed in the g3dj file, same result in the g3db file. The cube still shows fine. The animation works in blender. I tried playing a little with the Action Editor / Fake User in Dope View but couldn't get it to work that way either. What am I missing? Thanks

Export issues

Hello,

I'm attempting to use the Blender G3D plugin to export a animated, textured model using Cycles.

When I click "export", I get the following error message:
https://imgur.com/a/If57S0M

Here's my .blend file:

Let me know if you need any more information.

Another export issue

Hi, I'm getting another export issue and was wondering if you had any insight into why it might be happening.

Why I export my model to a .g3db export, I get the following error message:
https://imgur.com/onc12gd

Here's my .blend file:
https://files.fm/u/576pcnmc

This error occurs in both Blender Render and Cycles Render.

Let me know if you'd like any more information.

Texture missing

Hi,

Here is a new issue, or maybe not but after some tests I do not succeed on exporting a textured model : the picture file (texture) is not referenced in the json output file.
I tried into obj to compare, and the image file is well referenced in the obj mtl file.

Is there a particular way of doing the material or texture ? or to export it ?
Thanks !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.