Blender exporter

Hi,
I’ve been using v. 6.2.3 and trying to exclude an object from exporting. I used the 4 toggle buttons in Blender, yet no matter what I select, the resulting .babylon file size remains the same. Yes, the object appear to be hidden in the viewport, but it it’s still in the .babylon file!

Surely enough, when I put this piece of code:
if (meshes[i].id === "hull") console.log(meshes[i]);,
the mesh is there.

I have read this, but it does not seem to work.

So:

  • Is it possible to exclude an object from exporting without physically deleting it from the Blender scene?

  • Is it possible to hide an object in Blender without affecting its appearance in Babylon? This last one is quite important, as it’s really annoying having to remember to keep changing multiple objects’ visibility in Blender.

I suppose this question is mostly for @JCPalmer as he is the maestro of Blender -> Babylon :wink:

Cheers!
(and Happy New Year!)

The document you reference is old. The Blender API kept changing before 2.80 was released in July '19. The Answer to all your points is Yes.

  • To exclude objects, meshes | cameras | lights, from export, they need to be in a collection that is disabled. This is also very similar to Blender itself, or layers in the old Blender. There is a checkbox to the left of the collection name. Collections disabled are skipped.

There can be problems, when say an armature & mesh are in different collections, and only one collection was enabled, just as there were with layers were used to cull exported items.

  • You were already “hiding” individual meshes using the “eye” icon in Outliner. These will still be exported, as you note. When you Append the .babylon file, they will be loaded, but not enabled. You can then make them visible any time you wish.

As far as multiples is concerned, already taken care of from first question.

Thanks dude for such a speedy reply!
I’ll try the collections thingy now :slight_smile:

So, there’s no way to hide an object in Blender without hiding it in Babylon? This is purely a workflow issue: I’m working on a fairly complex scene and have to hide a bunch of objects to make sure they don’t obscure the view. It really bugs me that I have to go through all of them (sometimes 20+) to toggle their visibility. I can’t keep putting them in various collections either, as I change (viewport) visibility hundreds times a day!

Thanks again, @JCPalmer

Not directly, but what I do in that case is put all the stuff in a collection. Disable it to get it out of the way. One click to re-enable collection, then export.

Roger that!