1
$\begingroup$

Here is my problem:

I'm making a Class A. This Class A, has some common functionality that I need to also add to another class (bpy.types.GPencilLayer).

Since that functionality is going to be common, I thought about implementing it using some kind of interface (abstract class (since python dont have interfaces)).

The thing I can make my Class A to implement that abstract class. But what about an alrady existing Blender class? Would it be possible to implement that abstract class in the GPencilLayer type?

Thank you so much.

$\endgroup$
2
  • 1
    $\begingroup$ AFAIK Blender custom types don't support inheritance, but they can support polymorphism. Inherit from bpy.types.GPencilLayer AND A $\endgroup$
    – Gorgious
    Jul 7, 2023 at 14:57
  • 1
    $\begingroup$ Didn't thought about that, I think it could solve some of my problems. Thank you much @Gorgious, always helpful 🍀 $\endgroup$
    – Ommadawn
    Jul 7, 2023 at 15:33

0

You must log in to answer this question.

Browse other questions tagged .