good day, on a simple cube I have a simple material that just uses a gradient applying it depending on the vertical coordinate of the object, and it fails like this, thank you for your help , I use latest blender version 2.91, and latest babylon versions as well:
I have the simple .blend file available (im not allowed to upload because im a new user )
========= Conversion from Blender to Babylon.js =========
Scene settings used :
Inline textures : false
Material Type : PBR
Positions Precision : 4
Normals Precision : 3
UVs Precision : 3
Vert Color Precision: 3
Mat Weight Precision: 2
Keep Z-up r-handed : no
Texture directory : C:\MEDIA
Python World class constructor completed
processing begun of mesh: dbmassive2.0000
processing begun of material: Material
WARNING: unsupported node type(ShaderNodeSeparateXYZ) will trigger baking
WARNING: unsupported node type(ShaderNodeMath) will trigger baking
WARNING: unsupported node type(ShaderNodeValToRGB) will trigger baking
usePassDirectHold False
========= An error was encountered =========
========= end of processing =========
elapsed time: 0 min, 0.01 secs
Python: Traceback (most recent call last):
File “C:\Users\Usuario\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\babylon_js_init_.py”, line 65, in execute
exporter.execute(context, self.filepath)
File “C:\Users\Usuario\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\babylon_js\json_exporter.py”, line 115, in execute
mesh = Mesh(object, scene, self)
File “C:\Users\Usuario\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\babylon_js\mesh.py”, line 146, in init
recipe = BakingRecipe(bpyMesh, exporter)
File “C:\Users\Usuario\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\babylon_js\materials\baking_recipe.py”, line 105, in init
self.bakedMaterial.bake(bpyMesh, self)
File “C:\Users\Usuario\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\babylon_js\materials\material.py”, line 127, in bake
bpy.ops.object.mode_set(mode=‘EDIT’)
File “C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\modules\bpy\ops.py”, line 132, in call
ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.mode_set.poll() failed, context is incorrect
With this new 4 releases a year of Blender process, where the last is an LTS, I am considering the first 3 to be betas. I do not have the time to modify just to keep up with API changes 4 times a year. Also, if I did, I would either have to put in checks to do things multiple ways to support the LTS, or make a separate branch in the repo, so people would not have to be forced to use unstable versions of Blender.
Unlike, GLB which is released bundled inside Blender, and probably a paid gig by Khronos, they can get away with having multiple versions, AND appearing as if there is only one.
My plan is to look at this with the release of the 2.92 beta in its own repo branch. At that time, I am thinking of retroactively changing all the release numbers in the repo to match what version they go with. Incremental changes after release, would have minor-est version number changes, regardless of whether functionality changed or not, the prior scheme.
The next exporter version, for Blender 2.92, would be named 2.93.-1 A negative number would get the word beta added to the custom property section labels. When Blender 2.93 comes out:
The branch would get merged into main,
The initial release number of the exporter would be 2.93.0
The version for 2.83, would get moved to the deprecated directory.
thank you very much @JCPalmer,
what i did in the end is to install Blender 2.82 and it works all well with blender 2.82,
so for now i will use an older blender version to export to babylon i guess
thank you