TransWikia.com

Is it possible to write a script which opens Blender's existing FBX exporter window?

Blender Asked by Milun on November 7, 2020

I’m wondering if there’s a way to programmatically open Blender (2.79)’s FBX exporter UI with Python script.

Basically, what I’m trying to make is a script which, when ran:

  • Modifies all the UVs for each selected mesh.
  • Opens the existing FBX exporter and allows the user to export the modified mesh.
  • Once the user closes the FBX exporter window, for the mesh to revert back to its original state prior to running the script.

I know there’s a way to export FBX in script using bpy.ops.export_scene.fbx, but I was wondering if it was possible to open the UI’s FBX exporter instead.

Thank you so much in advance!

One Answer

Use bpy.ops.export_scene.fbx('INVOKE_DEFAULT').

More info about "Execution Contexts": https://docs.blender.org/api/2.79/bpy.ops.html?highlight=invoke#execution-context

I'm not sure what the best way to run something after the operator is complete is though. Maybe try: Running code after a modal operator finished its job

Answered by scurest on November 7, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP