Node CustomSocket - Changing shape

Hi guys/girls, i’m currently experimenting writing an addon based on nodes, and i’ve made some custom socket types.
However, i’d like one of those to have a Square connection point, but apart from specifying the display_shape in the node like so socket = and then socket.display_shape = 'SQUARE' i don’t see how to do it in the socket class itself. Is it even possible ?
Thanks :slight_smile:

I have tried now and it worked.

In this template
2020-08-08 21_38_01-Blender

You can change this line and see the effect

Also another note is to keep in mind to forcefully unregister everything each time you update your code otherwise you will append the same classes over and over again.

if __name__ == "__main__":
    try: unregister()
    except: pass

If your code is an addon you will have to write a custom script that will unregister - importlib.reload - register, your addon (instead of doing it manually from the preferences window).

Thanks, unfortunalty i think i haven’t been really clear XD
What i want to do is to define the shape in the custom node class itself, so i don’t have to do it everytime i create a node of that type.
I tried to put an init function as in the node class, and put self.display_shape = 'SQUARE' but even if i don’t get errors, i don’t get results

I have seen in many addons that users who didn’t want to repeat the same code over and over again just used inheritance for their operators. If I remember I see this in Polyquilt. Perhaps this is a good approach.