Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into ootlvlparser_reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanis002 committed Jul 22, 2023
2 parents de8aa98 + bca6651 commit 163c606
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 17 deletions.
3 changes: 1 addition & 2 deletions fast64_internal/oot/oot_anim.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def ootConvertLinkAnimationData(anim, armatureObj, convertTransformMatrix, *, fr
def ootExportNonLinkAnimation(armatureObj, convertTransformMatrix, skeletonName):
if armatureObj.animation_data is None or armatureObj.animation_data.action is None:
raise PluginError("No active animation selected.")

anim = armatureObj.animation_data.action
stashActionInArmature(armatureObj, anim)

Expand Down Expand Up @@ -448,7 +448,6 @@ def ootImportNonLinkAnimationC(armatureObj, filepath, animName, actorScale, isCu
for frame in range(frameCount):
rawTranslation = mathutils.Vector((0, 0, 0))
for propertyIndex in range(3):

if jointIndex[propertyIndex] < staticIndexMax:
value = ootTranslationValue(frameData[jointIndex[propertyIndex]], actorScale)
else:
Expand Down
3 changes: 1 addition & 2 deletions fast64_internal/oot/oot_collision.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def exportCollisionCommon(collision, obj, transformMatrix, includeChildren, name
addCollisionTriangles(obj, collisionDict, includeChildren, transformMatrix, collision.bounds)
for polygonType, faces in collisionDict.items():
collision.polygonGroups[polygonType] = []
for (faceVerts, normal, distance) in faces:
for faceVerts, normal, distance in faces:
assert len(faceVerts) == 3
indices = []
for roundedPosition in faceVerts:
Expand Down Expand Up @@ -203,7 +203,6 @@ def ootCameraDataToC(camData):
posC = CData()
camC = CData()
if len(camData.camPosDict) > 0:

camDataName = "BgCamInfo " + camData.camDataName() + "[" + str(len(camData.camPosDict)) + "]"

camC.source = camDataName + " = {\n"
Expand Down
6 changes: 0 additions & 6 deletions fast64_internal/oot/oot_level_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ def ootCombineSceneFiles(levelC):
def ootExportSceneToC(
originalSceneObj, transformMatrix, f3dType, isHWv1, sceneName, DLFormat, savePNG, exportInfo, bootToSceneOptions
):

checkObjectReference(originalSceneObj, "Scene object")
isCustomExport = exportInfo.isCustomExportPath
exportPath = exportInfo.exportPath
Expand Down Expand Up @@ -315,7 +314,6 @@ def readSceneData(scene, scene_properties, sceneHeader, alternateSceneHeaders):


def getConvertedTransform(transformMatrix, sceneObj, obj, handleOrientation):

# Hacky solution to handle Z-up to Y-up conversion
# We cannot apply rotation to empty, as that modifies scale
if handleOrientation:
Expand Down Expand Up @@ -466,7 +464,6 @@ def readCamPos(camPosProp, obj, scene, sceneObj, transformMatrix):


def readCrawlspace(obj, scene, transformMatrix):

splineProp = obj.ootSplineProperty
index = splineProp.index

Expand Down Expand Up @@ -496,7 +493,6 @@ def readPathProp(pathProp, obj, scene, sceneObj, sceneName, transformMatrix):


def ootConvertScene(originalSceneObj, transformMatrix, f3dType, isHWv1, sceneName, DLFormat, convertTextureData):

if originalSceneObj.data is not None or originalSceneObj.ootEmptyType != "Scene":
raise PluginError(originalSceneObj.name + ' is not an empty with the "Scene" empty type.')

Expand Down Expand Up @@ -621,7 +617,6 @@ def getEnclosingSphere(self) -> tuple[float, float]:
def ootProcessMesh(
roomMesh, DLGroup, sceneObj, obj, transformMatrix, convertTextureData, LODHierarchyObject, boundingBox: BoundingBox
):

relativeTransform = transformMatrix @ sceneObj.matrix_world.inverted() @ obj.matrix_world
translation, rotation, scale = relativeTransform.decompose()

Expand Down Expand Up @@ -691,7 +686,6 @@ def ootProcessMesh(
def ootProcessLOD(
roomMesh, DLGroup, sceneObj, obj, transformMatrix, convertTextureData, LODHierarchyObject, boundingBox: BoundingBox
):

relativeTransform = transformMatrix @ sceneObj.matrix_world.inverted() @ obj.matrix_world
translation, rotation, scale = relativeTransform.decompose()
ootTranslation = ootConvertTranslation(translation)
Expand Down
3 changes: 1 addition & 2 deletions fast64_internal/oot/oot_model_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def getRenderMode(self, drawLayer):
def addFlipbookWithRepeatCheck(self, flipbook: TextureFlipbook):
model = self.getFlipbookOwner()

def raiseErr(submsg):
def raiseErr(subMsg):
raise PluginError(
f"There are two flipbooks {subMsg} trying to write to the same texture array "
+ f"named: {flipbook.name}.\nMake sure that this flipbook name is unique, or "
Expand Down Expand Up @@ -490,7 +490,6 @@ def handleApplyTLUT(
tlut: bpy.types.Image,
index: int,
):

flipbook = getattr(material.flipbookGroup, "flipbook" + str(index))
if usesFlipbook(material, flipbook, index, True, ootFlipbookReferenceIsValid):
# Don't apply TLUT to texProp.tex, as it is the same texture as the first flipbook texture.
Expand Down
6 changes: 3 additions & 3 deletions fast64_internal/oot/oot_texture_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
ootGetLinkData,
)


# Special cases:
# z_en_xc: one texture is not stored in any array.
# skeletonName only used for en_ossan (shopkeepers) and demo_ec (end credits party), which have multiple skeletons
Expand Down Expand Up @@ -93,10 +94,9 @@ def ootReadTextureArraysGeneric(
f3dContext: OOTF3DContext,
):
# find gSPSegment() calls that reference texture arrays
for (flipbookKey, segmentParam, spSegmentMatch) in getSegmentCallsFunc(actorData):

for flipbookKey, segmentParam, spSegmentMatch in getSegmentCallsFunc(actorData):
# check for texture array reference
for (arrayName, flipbook) in flipbookList.items():
for arrayName, flipbook in flipbookList.items():
directArrayReference = findDirectArrayReference(arrayName, segmentParam)
indexIntoArrayReference = findIndexIntoArrayReference(arrayName, segmentParam, actorData)

Expand Down
1 change: 0 additions & 1 deletion fast64_internal/oot/oot_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
def upgradeObjectList(objList: CollectionProperty, objData: OoT_ObjectData):
"""Transition to the XML object system"""
for obj in objList:

# In order to check whether the data in the current blend needs to be updated,
# we look for the ``objectID`` property, which has been removed in the current version.
# If we find ``objectID`` it means that it's an old blend and needs be updated.
Expand Down
1 change: 1 addition & 0 deletions fast64_internal/oot/skeleton/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# - list of tuples, first is root position, rest are euler XYZ rotations
# 5. Add object to ootSkeletonImportDict


# Link overlay will be "", since Link texture array data is handled as a special case.
class OOTSkeletonImportInfo:
def __init__(
Expand Down
1 change: 0 additions & 1 deletion fast64_internal/oot/spline/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def spline_props_register():


def spline_props_unregister():

for cls in reversed(oot_spline_classes):
unregister_class(cls)

Expand Down

0 comments on commit 163c606

Please sign in to comment.