Fix: Python node_utils.connect_sockets broken after API change #113630

Merged
Hans Goudey merged 2 commits from pioverfour/blender:dp_node_utils_fix_connect into blender-v4.0-release 2023-10-15 20:38:50 +02:00

2 Commits

Author SHA1 Message Date
8c58f03b60 Address review
Instead of trying to find the base class name with a regex, choose
based on socket type.
2023-10-15 20:34:41 +02:00
b81b5d7102 Python API: fix node_utils.connect_sockets after API change
After the recent introduction of node panels, the utility that
allowed scripters to connect sockets to or from a virtual socket was
broken. This happens when creating an interface before connecting
sockets. Sockets can have a subtype, while interfaces cannot.

For instance, the `NodeSocketFloatFactor` type cannot be used
directly, it has to be converted to `NodeSocketFloat`.

This commit makes sure that the socket type gets stripped of their
last part, which indicates the subtype, before creating the new
interface.
2023-10-15 20:34:41 +02:00