2026-02-16
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
schema_version = "1.0.0"
|
||||
id = "datablock_utils"
|
||||
version = "1.2.3"
|
||||
version = "1.3.0"
|
||||
name = "Data-Block Utilities"
|
||||
tagline = "Show users, merge duplicates, find similar, and more"
|
||||
maintainer = "Leonardo Pike-Excell <leonardopike.excell@gmail.com>"
|
||||
|
||||
@@ -143,7 +143,8 @@ class NodeProperties:
|
||||
self._add_link(root_link, node_map)
|
||||
continue
|
||||
|
||||
if not links[socket].from_node.mute:
|
||||
from_node = links[socket].from_node
|
||||
if not from_node.mute and from_node.name in node_map:
|
||||
self._add_link(links[socket], node_map)
|
||||
continue
|
||||
|
||||
|
||||
@@ -52,15 +52,6 @@ def get_path_to_light(
|
||||
return get_path_to_light(nested_users, users[0]) # type: ignore
|
||||
|
||||
|
||||
def get_node_editor() -> tuple[bpy.types.Area, bpy.types.Region]:
|
||||
assert bpy.context
|
||||
areas = [a for a in bpy.context.window.screen.areas if a.type == 'NODE_EDITOR']
|
||||
area = areas[0] if len(areas) == 1 else next(
|
||||
a for a in areas if not cast(SpaceNodeEditor, a.spaces[0]).pin)
|
||||
region = next(r for r in area.regions if r.type == 'WINDOW')
|
||||
return area, region
|
||||
|
||||
|
||||
def get_geometry_node_group(
|
||||
space: SpaceNodeEditor,
|
||||
id_data: bpy.types.GeometryNodeTree,
|
||||
@@ -198,15 +189,34 @@ class DBU_OT_GoToDatablock(Operator):
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
assert bpy.context
|
||||
areas = [a for a in context.window.screen.areas if a.type == 'NODE_EDITOR']
|
||||
|
||||
try:
|
||||
area, region = get_node_editor()
|
||||
except StopIteration:
|
||||
if not areas:
|
||||
self.report({'WARNING'}, "Node editor not open")
|
||||
return {'FINISHED'}
|
||||
|
||||
area.ui_type = 'GeometryNodeTree' if is_geo else 'ShaderNodeTree'
|
||||
target_ui_type = 'GeometryNodeTree' if is_geo else 'ShaderNodeTree'
|
||||
|
||||
if len(areas) == 1:
|
||||
area = areas[0]
|
||||
else:
|
||||
unpinned_areas = [a for a in areas if not cast(SpaceNodeEditor, a.spaces[0]).pin]
|
||||
|
||||
if not unpinned_areas:
|
||||
self.report({'WARNING'}, "No unpinned node editor")
|
||||
return {'FINISHED'}
|
||||
|
||||
area = next(
|
||||
(a for a in unpinned_areas if a.ui_type == target_ui_type),
|
||||
unpinned_areas[0],
|
||||
)
|
||||
|
||||
area.ui_type = target_ui_type
|
||||
region = next(r for r in area.regions if r.type == 'WINDOW')
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
assert bpy.context
|
||||
with bpy.context.temp_override(area=area, region=region):
|
||||
space = cast(SpaceNodeEditor, context.space_data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user