Node Wrangler: ui_items
collection renamed to items_tree
#104896
@ -509,7 +509,7 @@ class NWPreviewNode(Operator, NWBase):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_output_sockets(cls, node_tree):
|
def get_output_sockets(cls, node_tree):
|
||||||
return [item for item in node_tree.interface.ui_items if item.item_type == 'SOCKET' and item.in_out in {'OUTPUT', 'BOTH'}]
|
return [item for item in node_tree.interface.items_tree if item.item_type == 'SOCKET' and item.in_out in {'OUTPUT', 'BOTH'}]
|
||||||
|
|
||||||
def ensure_viewer_socket(self, node, socket_type, connect_socket=None):
|
def ensure_viewer_socket(self, node, socket_type, connect_socket=None):
|
||||||
# check if a viewer output already exists in a node group otherwise create
|
# check if a viewer output already exists in a node group otherwise create
|
||||||
@ -586,7 +586,7 @@ class NWPreviewNode(Operator, NWBase):
|
|||||||
next_node = link.from_node
|
next_node = link.from_node
|
||||||
external_socket = link.from_socket
|
external_socket = link.from_socket
|
||||||
if hasattr(next_node, "node_tree"):
|
if hasattr(next_node, "node_tree"):
|
||||||
for socket_index, socket in enumerate(next_node.node_tree.interface.ui_items):
|
for socket_index, socket in enumerate(next_node.node_tree.interface.items_tree):
|
||||||
if socket.identifier == external_socket.identifier:
|
if socket.identifier == external_socket.identifier:
|
||||||
break
|
break
|
||||||
if is_viewer_socket(socket) and socket not in sockets:
|
if is_viewer_socket(socket) and socket not in sockets:
|
||||||
@ -611,7 +611,7 @@ class NWPreviewNode(Operator, NWBase):
|
|||||||
def remove_socket(cls, tree, socket):
|
def remove_socket(cls, tree, socket):
|
||||||
interface = tree.interface
|
interface = tree.interface
|
||||||
interface.remove(socket)
|
interface.remove(socket)
|
||||||
interface.active_index = min(interface.active_index, len(interface.ui_items) - 1)
|
interface.active_index = min(interface.active_index, len(interface.items_tree) - 1)
|
||||||
|
|
||||||
def link_leads_to_used_socket(self, link):
|
def link_leads_to_used_socket(self, link):
|
||||||
# return True if link leads to a socket that is already used in this material
|
# return True if link leads to a socket that is already used in this material
|
||||||
|
@ -170,11 +170,11 @@ def get_internal_socket(socket):
|
|||||||
# get the internal socket from a socket inside or outside the group
|
# get the internal socket from a socket inside or outside the group
|
||||||
node = socket.node
|
node = socket.node
|
||||||
if node.type == 'GROUP_OUTPUT':
|
if node.type == 'GROUP_OUTPUT':
|
||||||
iterator = node.id_data.interface.ui_items
|
iterator = node.id_data.interface.items_tree
|
||||||
elif node.type == 'GROUP_INPUT':
|
elif node.type == 'GROUP_INPUT':
|
||||||
iterator = node.id_data.interface.ui_items
|
iterator = node.id_data.interface.items_tree
|
||||||
elif hasattr(node, "node_tree"):
|
elif hasattr(node, "node_tree"):
|
||||||
iterator = node.node_tree.interface.ui_items
|
iterator = node.node_tree.interface.items_tree
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user