Describe the bug
Currently invoking the operator from python doesn't use context overriding as described here: Operators (bpy.ops). At least for "use_selection" setting.
To Reproduce
Steps to reproduce the behavior:
Create some mesh primitives: (Cubes, Cylinders, etc.)
Select the Camera or create one and select it if your default scene doesn't have one
Go to scripting tab
Use this
import bpy
omeshes = [obj for obj in bpy.data.objects if obj.type == 'MESH']
context = bpy.context.copy()
context['active_object'] = omeshes[0]
context['selected_objects'] = omeshes
bpy.ops.export_scene.gltf(context, filepath="./tmp.glb", use_selection=True)
Expected behavior
To export Meshes Primitives to ./tmp.glb. Instead of this, currently, the operator is exporting the camera as if the context isn't being override.
Version
OS: Windows 10
Blender Version 2.90 2020-05-21 21:20
Additional context
After a quick look to the code, it seems that is not using the context at all for retrieve object selection: file line<108>. I could do a quick and dirty patch to fix it but I don't know well the code and design to do a clean one.
Describe the bug Currently invoking the operator from python doesn't use context overriding as described here: Operators (bpy.ops). At least for "use_selection" setting.
To Reproduce Steps to reproduce the behavior:
Expected behavior To export Meshes Primitives to ./tmp.glb. Instead of this, currently, the operator is exporting the camera as if the context isn't being override.
Version
Additional context After a quick look to the code, it seems that is not using the context at all for retrieve object selection: file line<108>. I could do a quick and dirty patch to fix it but I don't know well the code and design to do a clean one.