Comments (7)
You placed it in the right folder. It seems there is an import error in the JSON exporting script I use. I'll do some testing in Blender 2.77 and report back. Thanks for the report.
from libgdx_blender_g3d_exporter.
Sorry for taking so long to respond. I tested this on Blender 2.77 and 2.78 in Ubuntu Linux 16.04 and this error didn't occur.
The import error (cannot import name 'FLOAT_REPR') is being given to a Python library, this constant should be present on the "json" module which is part of Python.
I don't know why your combination of Blender and Manjaro Linux is giving this error, as far as I know Blender searches for it's own bundled Python library before using the system library but your error might be coming from Blender using Manjaro's Python and not finding this particular constant declared in the json module.
If you're still having this issue (or even using my library at all) in Blender 2.78 try making sure you're using the bundled Python in Blender.
from libgdx_blender_g3d_exporter.
I am having the same problem in Blender 2.76 on Ubuntu 16.04:
Problem Source
It looks like 'FLOAT_REPR' was removed from json.encoder in the transition from Python 3.5.1 to 3.5.2, according to the following diff:
https://fossies.org/diffs/Python/3.5.1_vs_3.5.2/Lib/json/encoder.py-diff.html
Blender 2.76 seems to default to Python 3.5.2, which is probably why some of us are getting this issue.
Temporary Solution (not really reccomended)
I was able to get around the issue by opening the Python console in Blender (Shift + F4), and manually setting the 'FLOAT_REPR' value by entering the following in the console:
import json
json.encoder.FLOAT_REPR = float.__repr__
I was then able to enable and use the g3d exporter plugin in the user preferences without any error. However, the steps in this method need to be repeated every time you restart Blender.
Permanent Solution
I was able to fix this permanently by modifying g3dj_json_encoder.py in the main io_scene_g3d plugin directory.
The problem is the following line in that file does not work in Python 3.5.2 (around line 20):
from json.encoder import encode_basestring_ascii, encode_basestring, FLOAT_REPR, INFINITY
So I just changed it to the following:
from json.encoder import encode_basestring_ascii, encode_basestring, INFINITY
Also, I needed to change the FLOAT_REPR usage (around line 63):
from
_repr=FLOAT_REPR
to
_repr=float.__repr__
I then saved the file, restarted Blender, enabled the plugin, and it worked as intended. I have not tested this with Python versions lower than 3.5.2, but I will submit a pull request once I verify that it works with versions below that.
Edit: merge request #10 submitted, as this code looks to work with Python 2.7. The recent Blender versions seem to support Python 3+, so this should be fine.
from libgdx_blender_g3d_exporter.
I'll just do some final testing but it seems you where on point on the cause. I'll accept the pull request after this final test.
Thanks for contributing.
from libgdx_blender_g3d_exporter.
Hello! I'm looking into using this exporter, but I stumbled on this same bug. Is the PR being held up for some reason?
from libgdx_blender_g3d_exporter.
@SolarLune, I swear I though it was already merged as it was already tested.
Done now, it should work. Please report if it's still giving an error.
from libgdx_blender_g3d_exporter.
Hey, that solved it. Thanks!
from libgdx_blender_g3d_exporter.
Related Issues (18)
- G3DB output HOT 7
- Cycles node editor HOT 2
- 2.78 support? HOT 4
- Exporting unused parts
- Export fail if scene only contains animation HOT 4
- Export issues HOT 4
- Another export issue HOT 5
- Texture missing HOT 2
- Texture file name, and Material.emissive property HOT 3
- Can't export with texture HOT 2
- bpy.ops.export_json_g3d scene arguments HOT 1
- Won't work with blender 2.8 HOT 2
- armature animation error
- Needs an update to blender 2.74 HOT 4
- Y-up and G3DB support HOT 2
- Dope sheet actions don't get exported HOT 10
- Export doesn't include animations HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libgdx_blender_g3d_exporter.