Menu importing *.obj

Hello everyone, I’m new in this forum.

I’m a beginner in blender scripting and I’m trying to make an addon.

My problem is that I need to make a MENU that IMPORTS some OBJECTS that i made in blender before. For instance, a menu that has to choose between some models of doors, so there is door 1 to N (every model is a .obj), and in the menu you can choose 1 to N, imagine that is choosen ‘i’ model, so i.obj is imported to blender.

Well, I don’t see any information in the web about this issue.

I’m so lost… If anyone could help me, thank you.

A few tips to get started with Python:
Almost all blender functions will show their Python version when you hover over them or they’ll show up in the info window after running them.
You can right click -> edit source on most buttons to have the python script behind it show up in the text editor.
The templates in the text editor are a good start. UI panel/menu are what you’ll want to check out.
Most problems related to python itself can be broken down into problems already solved: google “How to add element to list in python”, “how search a string in python” and similar to get the right answer often on the first result.
And the Python API for blender is of course your friend: https://www.blender.org/api/blender_python_api_current/

For what you want to do you’ll need to look at:

  • getting comfortable with python. -> read some basic tutorials. break your problems down and search them. (google and StackOverflow are your friends)
  • a UI panel -> check the template
  • a List box like used by the material/texture panels -> check templates/source
  • the obj import function “bpy.ops.import_scene.obj()” -> check the API reference
  • python filesystem use. -> google how to get all files in a folder, etc.

Coding isn’t simple, especially not when starting out, but the time spent learning will pay off in time saved using your own addons. Luckily Python is well documented and most problems a beginner runs into have been solved before.