Blender 6.0 exporter for Blender 2.80

As far as keeping old docs, it is alright by me. Think you have a typo. Should probably 2.80 or later.

Yes, lights are exported. There are a number of changes highlighted by topic referenced at the top. Light exports vary by whether PBR or STD. Also, lights brought in by Append are not going to be right, especially former Hemi lights. Create a new Area light for a Hemi.

2 Likes

Hello,

I just tried to export a scene with a camera, a light and a bezier curve (I wanted to check if your exporter can export bezier curve); however it seems that the exporter is unhappy about the default camera.

See the error message below:

It seems that the attribute trackToBoundingCenter does not exist on the object Camera; maybe is it due to a recent change in Blender 2.8’s API?

EDIT: to delete the camera does solve the problem.

@Nodragem,

The answer to the export of curves is no. I am not even aware of a BJS equivalent that is also serializable. Any such objects will get the followinf entry in the export log file:
WARNING: The following object (type - CURVE) is not currently exportable thus ignored: name here

On the error part, whoops. Another exporter which generates inline javascript instead of a JSON file has this as an option which is not available in the JSON exporter. Since I use the same .blend files to test both, the property was in all my .blends, even though it is ignored in the JSON exporter.

Will have a fix sometime today, basically a delete of one line & bumping the revision #.

1 Like

Thanks :smiley:

… that’s a shame concerning the curves. I am not sure what you mean by serializable, I am sorry. I think I will try to export the parameters of my bezier curves and re-create them in BabylonJS with Curve3 (Draw Curves - Babylon.js Documentation).

EDIT: I tried to convert the curve into a mesh in blender and then export the file. Unfortunately, my mesh does not get exported (the babylon file is empty, see attachment below) and I get warnings (see exporter log attached).

Babylon file:

Exporter log:

Screenshot of the blender file:

I forgot that the math file had a BezierCurve.class. If you look there is no static parse method which FileLoader can call to get the values from the export file to an actual javascript object.

FYI, it would take a lot more than just adding a parse method, but when I see the lack of this, I know to stop. One of the strengths of the Javascript exporter is anything can be exported if it can be expressed as code from data available from the Blender side. However, I have no interest in adding this for now, and have not published it in quite a while.

As far as a curve converted to a mesh, the exporter does not actually export vertices. It exports faces, or groups of 3 vertices. When you convert the curve to a mesh, it creates some vertices, but no faces. Perhaps the “this is being ignored” message should say faces not vertices. Same problem with converting things like Hair particle systems. I have overcome this, but not without a lot of code on both sides. Not walking into this issue lightly again.

1 Like

In case that can be useful to others, here is my solution to export curves from Blender into a json file:


(I did not write the code to re-create the curves in BabylonJS yet, but it should be straighforward, hopefully :slight_smile: ).

4 Likes

If you find hooking in this json file is too much, generating an inline javascript file instead will also get the job done without making changes to the Repo.

Technically, you could add this without changing the Repo, I guess.

1 Like

Well am in full conversion mode to Blender 2.80 / TOB 6.0 exporter for all my test / demo scenes. I have encountered an error when trying to export any colors of former STD materials appended into a new file. You cannot address fields using .r, .g, or .b. You must do [0], [1], or [2]. Guess we just cannot have nice things. Array indexing always works though.

Back face culling & max simultaneous light were also not being written when not using a Nodes based material. I have corrected these, and will be updating the .babylon exporter in the next day or so.

One good thing I do like about 2.80, is there are new window types for my test scenes which save me time. First is that preference can now be in a window (pink), and info where errors & where I can write to in green. Can save this layout into the .blend file.

3 Likes

Blender ver 6.0-Beta 8

  • Write colors in a way which works for both Nodes based, & converted STD materials.
  • Write backFaceCulling, checkReadyOnlyOnce, maxSimultaneousLights when a non-Nodes material
  • Write shapekeys / morgh targets
3 Likes

Hi,

I detected 2 problems with Instanced Mesh when I active “Check Collisions” or with Array modifier:

  1. “Check Collisions” on same data mesh only works on the one object (the first at the top of the list)

  1. Array modifier applied by error on the second object who have share instanced mesh

Otherwise, thank you very much for the work already done, it’s great.

FYI, there is an old topic in the last forum. The thing drags on and on, but might be helpful.

Blender has different model of sharing to BJS instances. Blender just applies the same properties among all. The purpose is to share data, except position / rotation / scale.

In Babylon.JS, there is a mesh, and all the others are instances. The purpose here is performance by reducing draw calls. The exporter makes the first mesh encountered with shared data the Mesh, and all the rest are the InstancedMeshes. There are many things which cannot be set different on an Instance. I do not know see where to set collisions is on an InstancedMesh. I do not know / remember if InstancedMeshes can participate in collisions / physics.

One thing that could be done as an alternative without increasing draw calls is to merge the meshes, either before or after export. This will work as long as the desks DO NOT move / rotate.

On the Array modifier, must admit I do not even know what that is. You are doing it with instances, so might be the same issue.

Up shot is it might be something which cannot be done.

1 Like

The Babylon exporter works well at InstanceMesh level, because if I create pillars by doing duplications via alt + d to share data. I have one Mesh and three InstanceMeshs. It’s good for Draw calls because egal to 1 and not to 4.
But there is still the problem of collisions. Ideally and logically, it would be necessary to have the collision active on all 4 meshs because under Blender “Check Collisions” is activated on the Mesh Data (Pillar_Reference). If I look with inspector, it’s not the case. Here are the Blender 2.8 and Babylon source files if needed

I can only write into an export file that which is going to be read. That said, I double checked what that is.

I see a little below the line I referenced that checkCollisions are being loaded if present. I do not when this got added, as the history does not go back further than 10/22/18, when @sebavan did his big merge.

No matter, I will put it on my list to address the current things transferrable for instances. Do not know when, & will only be in the 2.80 exporter. Probably under a week.

It’s impeccable, I’m waiting for your news, thank you

Instances now write pickable & checkCollisions. Only missing animations for instances. Not confident about that. I understand that these would not be different for Blender, but could be for other exporters.

For now, if you want animations for instances, cloning them once loaded is up to you. Probably better than duplicating animations in file.

2 Likes

It’s great, the colliders are now activated on all InstanceMesh, really top. Thank a lot
Later, I’ll try on the big scene if the performances are correct with the collider boxes InstanceMeshes compared to an only collider box. I’ll make a comeback.

Hi, I just saw that Visible and Enabled don’t work on the InstanceMeshes, can you correct that?

Short answer is no. If you look at the link to what can be imported for instance from above, re-linked here, those are not consulted.

Indeed, I don’t see any reference to Visible and Enabled:-(
Would it be great if you could consider adding this possibility on Meshes instances?
I really hope not to bother you with my requests for improvement.
In any case, thank you very much for your work on the exporter.

I only do like one PR directly against the framework repo each release. This will not be one. If you do the PR, then I will add it. Think the cut off for 4.0 is quite soon. There are no cut offs for the exports repo.