I am building a 3D web app with threejs, in javascript. For renders, i want to use a renderfarm, so :
- i save threejs scenes in .glTF
- i command line blender to import and save these scene in .blend with a blender python script
- so my app will be able to send scenes to the renderfarm for realistic renders
And this works well (firsts 2 points) on my local computer, but when i do the same on my server, it makes the following error :
Traceback (most recent call last):
File "convert_to_blend.py", line 9, in <module>
bpy.ops.import_scene.gltf(filepath=obj_out+'.glb')
File "/usr/share/blender/scripts/modules/bpy/ops.py", line 188, in __call__
ret = op_call(self.idname_py(), None, kw)
AttributeError: Calling operator "bpy.ops.import_scene.gltf" error, could not be found
Blender quit
I use this command line :
blender --background -noaudio --scene blank.blend --python convert_to_blend.py -- render_test
and the python script convert_to_blend.py
contains just :
import bpy
import sys
argv = sys.argv
argv = argv[argv.index("--") + 1:] # get all args after last "--"
obj_out = argv[0]
bpy.ops.import_scene.gltf(filepath=obj_out+'.glb')
bpy.ops.wm.save_as_mainfile(filepath=obj_out+'.blend')
Is someone know how to make blender find what he wants to work ? this :
AttributeError: Calling operator "bpy.ops.import_scene.gltf" error, could not be found
I forget to indicate the Blender version on my server is : 2.72 (sub 0)
And Blender version on my local computer, where my command line works well, is 2.91.0