Cleanup: Remove unused geonode tree lookup if load_nodes node_tree was None
parent
0ab4ffc098
commit
fc34669af7
14
dumper.py
14
dumper.py
|
@ -28,11 +28,6 @@ def get_dumper(bl_object: bpy.types.bpy_struct) -> type[Dumper]:
|
|||
# Fallback to base Dumper if no matches are found
|
||||
return Dumper
|
||||
|
||||
def get_current_node_tree(data):
|
||||
if data.get("_new", {}).get("type") == "GeometryNodeTree":
|
||||
return bpy.context.object.modifiers.active.node_group
|
||||
|
||||
|
||||
def dump_nodes(nodes: list[bpy.types.Node]):
|
||||
"""Generic Recursive Dump, convert any object into a dict"""
|
||||
Dumper.pointers.clear() # TODO: Bad global
|
||||
|
@ -48,14 +43,9 @@ def dump_node(node: bpy.types.Node):
|
|||
return dumper.dump(node) # TODO: Break the recursivity, clear things up
|
||||
|
||||
|
||||
def load_nodes(data, node_tree=None):
|
||||
"""Generic Load to create an object from a dict"""
|
||||
|
||||
def load_nodes(data, node_tree):
|
||||
"""Load/Dump nodes into a specific node tree"""
|
||||
Dumper.pointers.clear()
|
||||
# print(Dumper.pointers)
|
||||
|
||||
if node_tree is None:
|
||||
node_tree = get_current_node_tree(data)
|
||||
|
||||
dumper = get_dumper(node_tree)
|
||||
dumper.load(data, node_tree)
|
||||
|
|
Loading…
Reference in New Issue