Since Blender 3.5 version, the Python API does not allow overriding base operators.
Now we can’t create operators with the bl_idname parameter value being the same as for the base operators, which were defined in Blender by the developers, and expect that the new operator will replace the base one.
When trying to override the base operator, Blender will throw an error:
RuntimeError: Error: Registering operator class: ‘Override’, bl_idname ‘_bl_idname_’ could not be unregistered
If, for example, we try to create a class with an operator that overrides the base operator for removing an object from the scene:
1 2 3 4 5 6 7 8 9 10 |
class OverrideDelete(bpy.types.Operator): bl_idname = 'object.delete' bl_label = 'Delete' bl_options = {'REGISTER'} def execute(self, context): print('OVERRIDE DELETING') return {'FINISHED'} bpy.utils.register_class(OverrideDelete) |
When registering an operator in the Blender API, it will throw an error:
RuntimeError: Error: Registering operator class: ‘OverrideDelete’, bl_idname ‘object.delete’ could not be unregistered
and the new operator will not be registered.
Be careful when developing add-ons. And if your add-on uses overriding of base operators – make corrections to the code so that the add-on can work in Blender version 3.5 and higher.