Skip to content

Commit

Permalink
minor code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanis002 committed Jan 9, 2024
1 parent 93849c1 commit e671ee5
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions fast64_internal/oot/oot_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,18 @@ def upgradeActors(actorObj: Object):
del actorObj["ootTransitionActorProperty"]["dontTransition"]

for obj in bpy.data.objects:
if obj.type == "EMPTY":
if obj.ootEmptyType == "Room":
if actorObj in obj.children_recursive:
transActorProp.fromRoom = obj
if obj.type == "EMPTY" and obj.ootEmptyType == "Room" and actorObj in obj.children_recursive:
transActorProp.fromRoom = obj
break

if "roomIndex" in transActorProp and transActorProp.fromRoom is not None:
for obj in bpy.data.objects:
if obj.name != transActorProp.fromRoom.name and obj.type == "EMPTY" and obj.ootEmptyType == "Room":
if obj.ootRoomHeader.roomIndex == actorObj["ootTransitionActorProperty"]["roomIndex"]:
transActorProp.toRoom = obj
del actorObj["ootTransitionActorProperty"]["roomIndex"]
break
if (
obj.name != transActorProp.fromRoom.name
and obj.type == "EMPTY"
and obj.ootEmptyType == "Room"
and obj.ootRoomHeader.roomIndex == actorObj["ootTransitionActorProperty"]["roomIndex"]
):
transActorProp.toRoom = obj
del actorObj["ootTransitionActorProperty"]["roomIndex"]
break

0 comments on commit e671ee5

Please sign in to comment.