Skip to content

Commit

Permalink
Improvement on my previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuggy committed Apr 12, 2023
1 parent e53c7c7 commit fe498c2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions TakeManager/TakeManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ def GetTakeByUniqueID(UUID: str) -> FBTake:

def IsBound(Object: FBComponent):
""" Check if an object exists. """
if Object is None:
return False
return "Unbound" not in str(Object.__class__)


Expand Down Expand Up @@ -625,13 +627,13 @@ def OnSceneChanged(self, Scene: FBScene, Event: FBEventSceneChange):
if Event.Type == FBSceneChangeType.kFBSceneChangeSelect:
if not self.bIsSelectingTakesFromTool:
Item = self.GetItemByTake(Event.Component)
if Item is not None:
if IsBound(Item):
Item.setSelected(True)
# Take deselected.
elif Event.Type == FBSceneChangeType.kFBSceneChangeUnselect:
if not self.bIsSelectingTakesFromTool:
Item = self.GetItemByTake(Event.Component)
if Item is not None:
if IsBound(Item):
Item.setSelected(False)
self.bIsUpdatingNatively = False

Expand Down

0 comments on commit fe498c2

Please sign in to comment.