Create a Pop-Up menu to call a custom exporter (Blender 2.6 API)?

1.1k views Asked by At

am trying to create a friendlier menu to export models using a file format I created, using the python scripts in Blender 2.63.

Have been checking the API documentation for Blender, also the template examples and haven't figured out how to actually call the Exporter I created, which works ok.

Let me describe a bit more the problem; to export I have to go to File->Export->select the desire format->give a name->Press Export button. I want to automate this process through a menu (like the one provived in the templates, ui_menu); just load/run the script and select Export, the rest should be handled by the script it self. Lets suppose the blend file is MyCoolModel.blend, it will assume the exported file will be placed in the same location, taking the name MyCoolMode appending the correct extension.

By having the Custom menu, which is in one file. Don't know how to call the proccess of the exporter giving the described parameters, don't even know if that's possible.

On the other hand, it might be easier to move the code of the exporter to another module, the Custom Menu, add a button and call a function executing what was described, I just one to get feedback if someone already coded this, and re-use the export module.

In the end I would want to preserve the original export module, in case the artist needs to change the default name of the exporting process, or simply 'cause he wants to do it manually.... Having both versions, trying to re-use the Export would be the best if that's possible, no duplication of code really ;).

1

There are 1 answers

0
MichalisB On

I am looking to do something similar, they only thing that I have found that is close enough is the following Scripts/Cookbook/Interface:popup. Of course is still far away from anything close to the export menu, but hopefully it can be extended a lot more.