Recommended Posts


Working through the running of the exporter on 2.8, World is the first thing to run.  It seems that Mist & ambient color have bit the dust for 2.8.  I now hard code a mathutils.Color((0.2, 0.2, 0.3)) for ambient.  Mist did not actually error, but there is no-longer a section in the world properties.  I left the code for mist for now, but if there is no UI for it, eventually it will start to error.  Since there is already a section for additional properties for mist by the exporter, the lost properties might be added there, or the additional properties deleted.


Game Engine:

With the removal of game engine, game_settings.face_orientation & game_settings.use_backface_culling are toast.  That corresponds to Billboarding & back face culling in export.  While it does not seem likely culling might really be gone forever, that would be a huge blow, if you could not turn it off when needed.


Everything is changed here.  Am just going to keep the exporter from exporting materials to see if there are any more problems not related to materials.  Stay tuned.

Share this post

Link to post
Share on other sites

After commenting out the 30 or so lines which create the materials, the very next line runs us right into a brick wall:

# process all of the materials required
#recipe = BakingRecipe(object)
self.billboardMode = BILLBOARDMODE_NONE # BILLBOARDMODE_ALL if recipe.isBillboard else BILLBOARDMODE_NONE

#if recipe.needsBaking:
#    if recipe.multipleRenders:
#        Logger.warn('Mixing of Cycles & Blender Render in same mesh not supported.  No materials exported.', 2)
#    else:
#        bakedMat = BakedMaterial(exporter, object, recipe)
#        exporter.materials.append(bakedMat)
#        self.materialId =

#    bjs_material_slots = []
#    for slot in object.material_slots:
        # None will be returned when either the first encounter or must be unique due to baked textures
#        material = exporter.getMaterial(
#        if (material != None):
#            Logger.log('registered as also a user of material:  ' +, 2)
#        else:
#            material = StdMaterial(slot, exporter, object)
#            exporter.materials.append(material)

#        bjs_material_slots.append(material)

#    if len(bjs_material_slots) == 1:
#        self.materialId = bjs_material_slots[0].name

#    elif len(bjs_material_slots) > 1:
#        multimat = MultiMaterial(bjs_material_slots, len(exporter.multiMaterials), exporter.nameSpace)
#        self.materialId =
#        exporter.multiMaterials.append(multimat)
#    else:
#        Logger.warn('No materials have been assigned: ', 2)

# Get temporary version of mesh with modifiers applied
mesh = object.to_mesh(scene, True, 'PREVIEW')

The to_mesh() allows us to export the mesh after any modifiers have been applied, e.g. armatures, edge split, smooth, mirror.  While it is not really a great idea to export a character with the skeleton posed, being force to apply the other modifiers is bad. 

It did not say there was no to_mesh() anymore.  There is now a problem with the first argument:


TypeError: Object.to_mesh(): error with argument 1, "depsgraph" -  Function.depsgraph expected a Depsgraph type, not Scene

There is no API documentation for 2.8, but the current doc clearly wants a scene for arg 1.  I do not know what a Depsgraph is, but in the doc for a scene, has one for a property, or did anyway.  Passing that was not acceptable.


    mesh = object.to_mesh(scene.depsgraph, True, 'PREVIEW')
AttributeError: 'Scene' object has no attribute 'depsgraph'

Google has commenced.  Turns out gltf exporter already reported the problem.  The saga continues.

Share this post

Link to post
Share on other sites

Well, I think they have been saving it up.  Nuking 2 renders got them just re-architecting everything.  They need these temporary meshes themselves.  Did some looking around.  Changing this to get better frame rates.

I am going to switch to developing this branch while running on 2.79.  There was one change I need to make for the first commit, a name change from 'Lamp' to 'Light'.  I un-did this, but not committing.  The rest of the changes to loading still run on 2.79.  In 2.79, they first implemented PrincipledBSDF node.  This is never going to put into the pre-2.80 release.  Going to rip out anything for the old render first.  Just more crap to wade thru.

BTW, if 2 different materials could be expressed as either a BABYLON.StandardMaterial or BABYLON.PBRMaterial, should there be a preference?  Maybe, Standard because:

  • performance
  • WebGL 2
  • Getting boned by Jobs from the grave
  • etc

Share this post

Link to post
Share on other sites
7 hours ago, V!nc3r said:

Is it not still too soon to start porting addon for Blender 2.8? Core devs says that Python API will be update with somes brokes in it, during september (probably) (you can check the Code Quest Workboard, and this task).

No, for anything in dev for a couple of years, less than 30 days is not too early to see what is now broken.  Might be too early to fix problems unless it is easy to guess, though.

Share this post

Link to post
Share on other sites

Just an update as to how the removal of game engine was resolved.  2 new custom properties were added to mesh.  This actually makes them easier to find, rather than switching renderer.  It always was kind of scavenger hunt. 

Also, they used to be defined for a material, not a mesh.  There will be minor differences from before, limited to multi-material meshes only.  Before you could turn off culling on a sub-mesh level, but that will no longer be possible.  Doubt people are doing this though.

Share this post

Link to post
Share on other sites

Until recently I resisted trying out Blender 2.8 as I knew it was changing rapidly but I just tried it and must admit I'm pretty damned impressed. The UX facelift I think will really alleviate that last perceived learning curve barrier that Blender has been criticised for in the past. I don't think long-time users will be hindered all that much by the changes. The devs have struck a great balance IMHO.

I'm now eagerly looking forward to using Blender 2.8 and the Babylon exporter 🙂

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.