Enhancements for Blender 2.93 LTS

This is the topic for changes to the Exporter for Blender 2.93 LTS. At this point, I am just getting my thoughts together. To get this out of the way, any changes to the Blender Python API, since 2.83 LTS, are probably going to an throw exception. Any found will be changed.

That just leaves enhancements. My time budget for this is very small. I have not seen much in the way of Blender changes which easily translate, with the exception of using the Emission & Emission Strength field on the Principled node.


@gryff, I have doubts about adding shapekey animation. I am going need to a .blend that has some animation in it, made as simple as possible, but has simultaneous changes of multiple keys in the animation. It is also important that some faces overlap on these keys, like on a mouthOpen & mouthWide key pair. I am not convinced BJS truly supports composite poses of shared faces. You or I can then export using GLB exporter & see what happens before any decision is made.


I might look into using limited dissolve to implement LOD from Blender. This is to automate the doing of multiple meshes in different resolutions in the exporter.

The trigger distance would also get saved along with the % dissolve of each resolution in the .blend file. This could both simplify doing LOD, and be able to still edit the mesh later without having to remember the settings or do all the lower res meshes all over again manually. Would also remove the need for JS code to establish the LOD relationship, as it would be in the export file.


I am going to support writing out both albedo color and texture for a material. Right now the color is defaulted on (white) when a diffuse texture is also encountered. Blender does not actually allow this with a single Diffuse or Principled node, but who cares the data for the color is still there, when a texture is connected.

There will be an opt in checkbox in export material properties to turn this on. There is also a way with 2 Diffuse nodes that Blender does support, and it should also work. Here shows all 3. The yellow fields are doing double duty:


Speaking of export materials properties, there are a bunch of things inside of PBR materials that I have never seen before. Think about adding some of these:

  • directIntensity
  • specularIntensity
  • linkRefractionWithTransparency
  • useSpecularOverAlpha
  • lightFalloff
  • useRadianceOverAlpha
  • useParallax
  • useParallaxOcclusion
  • parallaxScaleBias
  • disableLighting
  • forceIrradianceInFragment
  • twoSidedLighting
  • useAlphaFresnel
  • useLinearAlphaFresnel

I do not understand all these, and I also left some off. There are a bunch of of camera related properties having to do with contrast, exposure, & color grading. No clue how a camera can effect a material.

While there is no direct space problem having everything as an export property, this is a lot.

Adding @PirateJC who played a bit with Blender and might have feedback ?

1 Like

I was under the impression that possibly 3DMax or Maya , possibly both, could export shape key animations. I really think it would be an asset. I know that I have files somewhere as I have done shape key animations with Daz Studio, and Unity - just have to find them. If not, I can probably create a new one.

Not a big fan of GLB - all those nodes wrapping around the meshes - reminds me of my old VRML days

Anyway, here is something from 8 years ago - just before I switched to BJS :

Hamlet done with shape keys

Hope you can come up with something - does not have to be 10 phonemes(shapekeys)

Stay Safe, gryff :slight_smile:

The purpose for the GLB was for testing as to what BJS did with the shared faces across keys, without actually coding anything.

Well, I think I can probably find a file - but it was done with earlier versions of Blender, so I will need to play with file and materials to get it into Blender 2.90.

Stay Safe, gryff :slight_smile:

If I want to have the colour and the texture, I use a “Mix Shader” and bake out a new texture. Use it to mix two textures as well for use with the Mix Material Script. Can produce all kinds unique new textures.

Stay Safe, gryff :slight_smile:

I am showing the mix shader as one of the ways to write both the color & the texture. The exporter goes through all the nodes & gets all the stuff to write, but when it goes to write, colors are not written when there is a texture of the same type. If you are doing that for the same type now, the color is never getting written.

The reason for using a connection for both texture & color is to keep Principled simple.

Ok, while thrashing about with Blender 2.92, I pieced together my files on using shapekeys and is a Blender 2.90 version (files go back to ver 2.70!)

Here is the file

I have packed all files I used, speech, phonemes I used (the image), and a breakdown of the speech done with Papagayo software. to create an animation. The animation runs from 1->122 frames, The actual shape keys used are Basis, open, wide, upper (lip) and use that graphic to define them. Beyond frame 122 you will find the definition of each phoneme (far left window) defined by those 3 shapekeys

Hope that maybe of some use in being able to export a shapekey animation.with the babylon exporter. Let me know if you need anything or if something did not pack.

Stay Safe, gryff :slight_smile:

1 Like

@gryff , I looked at your .blend, and exported it to .GLB. In sandbox, it played, though no sound. Do not think that format handles sound.

It seems BJS does do composite keys, which is when multiple keys, which share vertices, have a non-zero values, and it is not just a matter of the last key applied wins.

I cannot really go further with this sample though, as I am iterating through actions during export, but there does not seem to be any. I am not really that familiar with Blender’s animation system, since I have my own Javascript based animation system, and I only generate the source for the keys, myself.

Ok, I found the action(s). They are shown in ShapeKeyEditor mode. No need to change anything. I added a 2nd one called another. Your action is called keyAction.

Coming from the other direction, I took the GLB into the sandbox, and exported it as a babylon file. While that was a real mess, with no line breaks, & every number had 16 digits of precision :roll_eyes:, they did show that at the key level there is an animations block. That means, multiple actions for each key are possible

,"morphTargetManagers":[{"MaleHead":[
     {"name":"open","influence":0.0006,
          "positions":[-0.0370, ..., ,-0.3362] ,
          "animations": [
               {"name":"KeyAction","property":"influence","dataType":0,"loopBehavior":1,"keys":[{"frame":0,"values":[0.3]}]},
               {"name":"another","property":"influence","dataType":0,"loopBehavior":1,"keys":[{"frame":0,"values":[.4]}]},
          ],
     {"name":"wide","influence":0", ...

Now how you actually run KeyAction, or another, I have not got a clue. That would be the users problem.

We’ll see how far I get, trying to write this.

Well Jeff, I gave that a try too. Same result as you, all the code in one long line - compressed as JSON? Here is what my JSON viewer showed for the morphTarget Managers (Image 1 below). All the frames are included, each with a huge numberof decimal places. I don’t understand the fps setting of 1. Is that a real frame rate, or is 1 somehow indicating a “maximum”? The materials are exported at PBR materials.

So how does one play an animation in an array? The sandbox seems able to do it - but my coding skills say ??

Thanks for suggesting that idea of exporting as a .babylon file - hopefully you will be able to get something in the babylon exporter as I am no fan of GLB.

So make it doable Jeff !! :slight_smile:

Stay Safe, gryff :slight_smile:

MorphTarget Managers from Notepad++

Do not be concerned with the FPS thing. I’ll be writing bpy.context.scene.render.fps for that. As far as running, I double checked, it is going to be a pain in the ass.

I would recommend that you create a Feature request that asked that a method of morphTargetManager be added. Something like:

beginAnimation(name : string, from : number, to : number, loop : boolean, speed : number);

Even though the animation is at the target level, there are going to multiple keys with the same animation. The manager should then iterate through the keys, and if an animation is found by that name, start it.

You could then do something like

const manager = scene.getMeshByName('MaleHead').morphTargetManager;
manager.beginAnimation('KeyAction', 0, xxx);

You would probably want to load the audio file first. There you are on your own. I have spent months building my voice font, so that I can generate the webaudio using the same timeline as the animation. I am not dinking around with your sync issues.

1 Like

@JCPalmer : OK I will give it a shot. Always load my sound files separately as I am often loading many files. And will add a feature request - though I still would like to know how some kind of animation plays in the sandbox.

Stay Safe Jeff, gryff :slight_smile: