0
$\begingroup$

I guess I need help. I have a plugin (not my code, no OSL) that was written for Blender 2.7x and was working well. It was importing and exporting certain game specific mesh formats. Now I am trying to convert that script for my personal use to Blender 2.8x. Never been written some Blender addon at all, so my first attempt. A lot of changes I've done already and the plugin is flawlessly activating/deactivating in Preferences now, which is good. My problem was: I was checking import/export menu (like I am used from Blender 2.7) but the addon doesn't show the options there. First I thought it was not working but I've noticed now it is in the Shift+A menu (where it adds a new type, which is working as well). But it's very unusual to have importer/exporter options in that menu? :) Can someone point me in the right direction why it is doing that and how I can get it in the exporter menu properly?

$\endgroup$
5
  • $\begingroup$ Take a look at the implementation of existing import/export add-ons, e.g. for .obj. You likely want to use ImportHelper or ExportHelper for your operator. $\endgroup$
    – Robert Gützkow
    Jun 16, 2020 at 16:48
  • $\begingroup$ I was googling for ImportHelper before but found only entries about having it a filebrowser function. $\endgroup$
    – flth
    Jun 16, 2020 at 16:50
  • $\begingroup$ The plugin is working now, but the import/export entries are still in the Shift+A menu, still working from there. I don't see a way how ImportHelper could help me to get the entries to the import/export sub menues? $\endgroup$
    – flth
    Jun 19, 2020 at 19:53
  • 2
    $\begingroup$ It would help if you could add your code to the question. Otherwise I would have to guess what you're doing wrong. $\endgroup$
    – Robert Gützkow
    Jun 20, 2020 at 11:12
  • 1
    $\begingroup$ Agree please always, if you have it, post code. When editing Q could be more appropriately titled "Why is my Addon appending item to Add Object Menu not Import / Export Menu" It is courteous to add a link , if code is sourced from elsewhere. $\endgroup$
    – batFINGER
    Jun 21, 2020 at 9:09

1 Answer 1

-1
$\begingroup$

and to answer my own question, finally I found it via Texteditor. The needed command is TOPBAR_MT_file_import e.g. bpy.types.TOPBAR_MT_file_import.append(menu_func_import)

$\endgroup$
2
  • 1
    $\begingroup$ Right, I thought that was obvious from my link to the .obj add-on. I'm sorry if that wasn't the case. $\endgroup$
    – Robert Gützkow
    Jun 20, 2020 at 21:50
  • 2
    $\begingroup$ Could you please explain why this is the "needed command" Related blender.stackexchange.com/questions/110095/… $\endgroup$
    – batFINGER
    Jun 21, 2020 at 9:08

You must log in to answer this question.

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