From a99cc8f4971c52b55104eade2cac6c679db76d0f Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Tue, 28 Jun 2022 21:30:22 +0200 Subject: [PATCH] Fix iterator --- openpype/hosts/maya/api/lib.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/maya/api/lib.py b/openpype/hosts/maya/api/lib.py index 637f9e951b..43f738bfc7 100644 --- a/openpype/hosts/maya/api/lib.py +++ b/openpype/hosts/maya/api/lib.py @@ -3272,11 +3272,12 @@ def iter_visible_in_frame_range(nodes, start, end): cmds.currentTime(start) visible = cmds.ls(nodes, long=True, visible=True) + for node in visible: + yield node if len(visible) == len(nodes) or start == end: # All are visible on frame one, so they are at least visible once # inside the frame range. - for node in visible: - yield node + return # For the invisible ones check whether its visibility and/or # any of its parents visibility attributes are animated. If so, it might