Skip to content

Commit

Permalink
check if any old props is present
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanis002 committed Jan 22, 2024
1 parent e671ee5 commit fb2cba9
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions fast64_internal/oot/oot_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,23 +315,23 @@ def upgradeActors(actorObj: Object):
break
elif actorObj.ootEmptyType == "Transition Actor":
transActorProp = actorObj.ootTransitionActorProperty
if "dontTransition" in transActorProp:
transActorProp.isRoomTransition = actorObj["ootTransitionActorProperty"]["dontTransition"] == False
del actorObj["ootTransitionActorProperty"]["dontTransition"]

for obj in bpy.data.objects:
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:
if "dontTransition" in transActorProp or "roomIndex" in transActorProp:
for obj in bpy.data.objects:
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"]
if obj.type == "EMPTY" and obj.ootEmptyType == "Room" and actorObj in obj.children_recursive:
transActorProp.fromRoom = obj
break

if "dontTransition" in transActorProp:
transActorProp.isRoomTransition = actorObj["ootTransitionActorProperty"]["dontTransition"] == False
del actorObj["ootTransitionActorProperty"]["dontTransition"]
elif 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"
and obj.ootRoomHeader.roomIndex == actorObj["ootTransitionActorProperty"]["roomIndex"]
):
transActorProp.toRoom = obj
del actorObj["ootTransitionActorProperty"]["roomIndex"]
break

0 comments on commit fb2cba9

Please sign in to comment.