I decided to restructure this post, since I learned new stuff:
I wrote a script, which I want to use as an addon. I wrote the necessary code for that and it works like a charm...
...until I want to install the .py
Installing works fine, since I can check for it in the scrips\addons dir. It just doesnt show up in the addons menu, where I need to tick the box to activate it.
I tried:
removing dots and spaces from the .py name
deleting and reinstalling it multiple times
moving it in the dir manually
changing the .py name to all sorts of stuff
changing the "Version" in bl_info to all sorts of stuff
Code, containing the error:
#################################################
# Ive cut all the stuff you guys dont care about.
# The error must be in the remaining code
# since this still does not install
#################################################
bl_info = {
"name" : "DOM Importer",
"description" : "Import a STL file and do the DOM Stuff with it",
"author" : "Alex",
"version" : (1, 0, 0),
"blender" : (2, 80, 0),
"location" : "View3D",
"warning" : "",
"support" : "community",
"doc_url" : "",
"category" : "3D View"
}
import bpy, sys
from bpy.types import Operator
from bpy.types import Panel
from bpy.props import StringProperty, CollectionProperty
from bpy_extras.io_utils import ImportHelper
from pathlib import Path
from mathutils import Matrix
import math
class DI_OT_domimporter(Operator, ImportHelper):
""" Import an STL and do things with it"""
bl_idname = "import.domimporter"
bl_label = "Import DOM as STL"
bl_options = {"REGISTER", "UNDO"}
filter_glob: StringProperty(
default='*.stl',
options={'HIDDEN'}
)
files: CollectionProperty(type=bpy.types.PropertyGroup)
@classmethod
def poll(cls, context):
return context.mode == "OBJECT"
def execute(self, context):
return {'FINISHED'}
class DI_PT_sidebar(Panel):
"""Display Process STL"""
bl_label = "STL"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "DOM Importer"
def draw(self, context):
col = self.layout.column(align=True)
prop = col.operator(DI_OT_domimporter.bl_idname)
classes = [
DI_OT_domimporter,
DI_PT_sidebar,
]
def register():
for c in classes:
bpy.utils.register_class(c)
def unregister():
for c in classes:
bpy.utils.unregister_class(c)
if name == 'main':
register()
Old Post:
I wrote an Script, which works fine (thanks to you all btw :D)
Now, I want to use it as an Addon. I have seemingly everything set up.
I have my bl_info and the register and unregister funcs. When I want to install the .py, it looks like its working. When I check my installed addons, however, it does not show up. Same is for the button I want to appear in the 3D View.
Opening the Console, I see the following:
Modules Installed (my addon 1.0) from 'path\\my addon 1.0.py' into 'path\\Blender Foundation\\Blender\\3.1\\scripts\\addons'
Which is indicating, it worked(?)
The baffling thing is, that it DID work some time ago, but idk what I did -.-
Using Windows, if its gonna be important.
Edit: I watched this Video and I think I did everything he did
https://www.youtube.com/watch?v=Fr1HN0XgB58
Another Edit: Following this post:
Troubleshooting when Addons don't show up
I substituted all dots in the file name (and spaces for good measure) with underscores. The post states, I am not allowed to use dots in the file name, which I hope excludes the .py^^?


bl_infobut it is impossible to diagnose without looking at the script. Can you paste the script into your question? – Marty Fouts May 24 '22 at 13:40