So I'm working on an export script and need to implement some extra data... I want to add the extra data when the file browser is open and remove the data when the browser is closed on cancel or export.

The problem is I don't know how the default modal method works, I want to keep the default code, but extend it with the .append and .clear methods for my added data.

So what is the default code for the modal method?


1 Answer 1


Well I managed to make something work with the ExportHelper.invoke source...
This is coming from not knowing about the invoke method because the example doesn't provide it let alone explain where to look for more info.

what I did to access the data was simply to use the invoke method and integrate and modify the code from ExportHelper into my class rather than inherit from it.

to supply the needed data, all I did was create a dedicated PropertyGroup initialized in the scene context, and when invoke was called, clear and update the CollectionProperty items with their associated index IntProperty items in the group.

there may be a better method than this, but it works for me:

I did the dialog with this at the end of invoke before returning {'RUNNING_MODAL'}:

context.window_manager.invoke_props_dialog( this, width=900 )

Would be nice if blender's api was documented as well as they claim it to be...

  • $\begingroup$ If you have got something working please add some details as to what you did so that if others have the same issue as you in future, they can use your answer to help them. At the minute, you can't learn much from this answer. $\endgroup$ Oct 12, 2017 at 13:40
  • $\begingroup$ give me some time to actually get internet (I've only been on a phone) and I'll really spice up this answer ;) $\endgroup$
    – Tcll
    Oct 25, 2017 at 14:52
  • $\begingroup$ Still waiting for that expanded answer. $\endgroup$ Dec 2, 2017 at 19:01
  • $\begingroup$ I don't have internet yet... I'm in a debt hole and hoping to be out of it sometime around February... I will try to see if I can write something to transfer to my phone and copy over... but my phone is not very good at handling code. $\endgroup$
    – Tcll
    Dec 2, 2017 at 23:08
  • $\begingroup$ so I didn't add a src (too complex), but I did transfer the writing, I actually transferred the link from my phone first... hope it helps $\endgroup$
    – Tcll
    Dec 2, 2017 at 23:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .