0

I'm trying to learn how to create simple add-ons, but I'm not able to make it work on other computers other than the one on which the add-on has been written.

Here is a simple example :

import bpy

bl_info = { "name": "Example Addon", "author": "Riccardo", "blender": (2, 93, 4), "category": "User", }

def lift_selected_objects():

objects = bpy.context.selected_objects
for object in objects:
    object.location.z += 10

class OBJECT_lift_selected_objects(bpy.types.Operator):

bl_idname = "object.lift_selected_objects"
bl_label = "Lift Selected Objects"

def execute(self, context):
    lift_selected_objects()
    return {'FINISHED'}

def register(): bpy.utils.register_class(OBJECT_lift_selected_objects)

def unregister(): bpy.utils.unregister_class(OBJECT_lift_selected_objects)

The actual add-on I'm working on is a little bit more complex (but I can't share it right now) but it still involves 3 operators, 2 of them operates on bpy.context.selected_objects, and still has (apparently) the same issue.

The issue is:

I can install it from file, and it appears in the add-on list, I can even activate it but when I search for it in the f3 menu, I can't find the operator.

The strange thing is that this happens on two different PCs, but on the PC where it was written It gets installed and I can use it correctly via f3 menu.

The machines are all Windows 10 machines.

When I install and activate the add-on I get this in the console:

enter image description here

NOTE: i uninstalled and reinstalled the add-on to replicate the message in the console, I don't know if it's important.

What am I doing wrong? (I just started using python so I'm very inexperienced in both python in general and blender API)

RBancone
  • 41
  • 4
  • 4
    WIthout 'REGISTER' in the operator class's bl_options set, it will not show in F3. – batFINGER Sep 15 '21 at 16:58
  • Thanks, I added that, but still doesn't shows in f3 menu , for some reason If i install it on the 3.0 alpha today build, and I enable developer extras in the preferences, it works. Any Ideas? – RBancone Sep 16 '21 at 10:09
  • 1
    That reminded me of (possible duplicate) https://blender.stackexchange.com/questions/209219/cant-find-registered-python-addon-inside-blender-2-91-2-tutorial-example – batFINGER Sep 16 '21 at 10:17
  • It actually works on the current stable 2.93.4 build with developer extras on when I install the add-on – RBancone Sep 16 '21 at 10:20
  • Thanks, I discovered that just casually changing settings one by one... so It's expected. I guess the question is solved. – RBancone Sep 16 '21 at 10:47

0 Answers0