Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support context override #1073

Open
ridlimod opened this issue May 22, 2020 · 1 comment
Open

support context override #1073

ridlimod opened this issue May 22, 2020 · 1 comment
Labels
enhancement New feature or request exporter This involves or affects the export process

Comments

@ridlimod
Copy link

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:

  1. Create some mesh primitives: (Cubes, Cylinders, etc.)
  2. Select the Camera or create one and select it if your default scene doesn't have one
  3. Go to scripting tab
  4. 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<gltf2_blender_gather_nodes.py> 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.

@julienduroure julienduroure added enhancement New feature or request exporter This involves or affects the export process labels May 23, 2020
@julienduroure
Copy link
Collaborator

Confirmed. This is not implemented yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request exporter This involves or affects the export process
Projects
None yet
Development

No branches or pull requests

2 participants