Skip to content

Commit

Permalink
Return early from set_visible_nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
roomrys committed Oct 19, 2023
1 parent 7751925 commit 598da8e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions sleap/gui/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2983,16 +2983,15 @@ def set_visible_nodes(
Whether the new instance has missing nodes.
"""

if copy_instance is None:
return True

has_missing_nodes = False

# go through each node in skeleton
for node in context.state["skeleton"].node_names:
# if we're copying from a skeleton that has this node
if (
copy_instance is not None
and node in copy_instance
and not copy_instance[node].isnan()
):
if node in copy_instance and not copy_instance[node].isnan():
# just copy x, y, and visible
# we don't want to copy a PredictedPoint or score attribute
new_instance[node] = Point(
Expand Down

0 comments on commit 598da8e

Please sign in to comment.