Blender Exporter does not export groups properly?
There is something weird going on with the blender exporter. Running on blender 2.69. Almost completely randomly some embedded meshes either disappear or are exported with wrong names. For instance, embedded mesh ending with 002 below is not even present in the geometries array. And some meshes in the geometries array that should be exported, are not present in the embeds array.
"geometries" :
{
"geo_Cube.003" : {
"type" : "embedded",
"id" : "emb_Cube.003"
},
"geo_Cube.001" : {
"type" : "embedded",
"id" : "emb_Cube.001"
},
"geo_Cube.000" : {
"type" : "embedded",
"id" : "emb_Cube.000"
},
"geo_Cube.005" : {
"type" : "embedded",
"id" : "emb_Cube.005"
},
"geo_Cube.004" : {
"type" : "embedded",
"id" : "emb_Cube.004"
}
},
"embeds" :
{
"emb_Cube.002": { "scale" : 1.000000,
},
"emb_Cube.001": { "scale" : 1.000000,
},
"emb_Cube.000": { "scale" : 1.000000,
},
"emb_Cube.005": { "scale" : 1.000000,
...
}
Found the problem. Must use "object.name" in places where you use "object.data.name" in the blender exporter. Otherwise you get wrong data. When I switched out object.data.name to object.name I was able to export scenes correctly.
As an additional note: I had the same problem because I renamed my cameras and had to make this change. for cameraobj in cams:
-
camera = bpy.data.cameras[cameraobj.name] -
camera = bpy.data.cameras[cameraobj.data.name]
Do you guys mind doing a PR that fixes this?
@mrdoob actually (wasn't going to announce it for another week or so) I am in the middle of re-writing the entire exporter API (scalable, re-usable API across multiple applications, actual JSON serialization, unit tests, etc). In this I was going to patch these Blender bugs.
With that said, I can do a PR on this since the fixes are small and quick
A rewrite sounds great! But yeah, for such a "small" fix it would be good to have a PR and let the rewrite take its time.