[OoT] Add support for importing/exporting SkinLimbs - #720
Conversation
Dragorn421
left a comment
There was a problem hiding this comment.
Thanks for the PR! this has been attempted before without success, nice that you got it (I didn't test yet, just glanced at the code a bit)
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Dragorn421
left a comment
There was a problem hiding this comment.
UX note: I think it would be better to add an entry to the skeleton import/export "Mode" that spells "Skin (horses)" in order to import/export cpu-skinned skeletons.
Currently the switch between skin and standard limbs is made based on having multi-assigned vertices (cf ootDetermineLimbType), but that would probably be surprising to a user who expects the much more common (possibly flex) skeletons. Also the skin skeletons should be avoided as they seem more expensive, so it should be an opt-in rather than an automatic choice
Yeah, I was thinking about that too |
|
I guess an armature property could work yeah |
Dragorn421
left a comment
There was a problem hiding this comment.
Tested epona skeleton import and animation import, works beautifully
Tested epona skeleton export and animation export, also works
Tested various oot things on blender 3.2 and 4.2
- flex skeleton import/export and anim import/export works
- scene import is broken, eg this is on importing deku tree:
Traceback (most recent call last):
File "/home/dragorn421/.config/blender/3.2/scripts/addons/fast64_gitlinked/fast64_internal/z64/scene/operators.py", line 102, in execute
run_ops_without_view_layer_update(parseSceneFunc)
File "/home/dragorn421/.config/blender/3.2/scripts/addons/fast64_gitlinked/fast64_internal/z64/scene/operators.py", line 28, in run_ops_without_view_layer_update
func()
File "/home/dragorn421/.config/blender/3.2/scripts/addons/fast64_gitlinked/fast64_internal/z64/scene/operators.py", line 36, in parseSceneFunc
parseScene(settings, settings.option)
File "/home/dragorn421/.config/blender/3.2/scripts/addons/fast64_gitlinked/fast64_internal/z64/importer/scene.py", line 195, in parseScene
sceneObj = parseSceneCommands(sceneName, None, None, sceneCommandsName, sceneData, f3dContext, 0, sharedSceneData)
File "/home/dragorn421/.config/blender/3.2/scripts/addons/fast64_gitlinked/fast64_internal/z64/importer/scene_header.py", line 574, in parseSceneCommands
roomObjs = parseRoomList(sceneObj, sceneData, roomListName, f3dContext, sharedSceneData, headerIndex)
File "/home/dragorn421/.config/blender/3.2/scripts/addons/fast64_gitlinked/fast64_internal/z64/importer/scene_header.py", line 258, in parseRoomList
roomObj = parseRoomCommands(
File "/home/dragorn421/.config/blender/3.2/scripts/addons/fast64_gitlinked/fast64_internal/z64/importer/room_header.py", line 117, in parseRoomCommands
parseMeshHeader(roomObj, sceneData, meshHeaderName, f3dContext, sharedSceneData)
File "/home/dragorn421/.config/blender/3.2/scripts/addons/fast64_gitlinked/fast64_internal/z64/importer/room_shape.py", line 38, in parseMeshHeader
parseMeshList(roomObj, sceneData, meshListName, roomShapeIndex, f3dContext, sharedSceneData)
File "/home/dragorn421/.config/blender/3.2/scripts/addons/fast64_gitlinked/fast64_internal/z64/importer/room_shape.py", line 132, in parseMeshList
meshObj = importMeshC(
File "/home/dragorn421/.config/blender/3.2/scripts/addons/fast64_gitlinked/fast64_internal/f3d/f3d_parser.py", line 2392, in importMeshC
parseF3D(data, name, transformMatrix, name, name, drawLayer, f3dContext, True)
File "/home/dragorn421/.config/blender/3.2/scripts/addons/fast64_gitlinked/fast64_internal/f3d/f3d_parser.py", line 2033, in parseF3D
f3dContext.processCommands(dlData, processedDLName, dlCommands)
File "/home/dragorn421/.config/blender/3.2/scripts/addons/fast64_gitlinked/fast64_internal/f3d/f3d_parser.py", line 1613, in processCommands
self.addTriangle(command.params[0:3] + command.params[4:7], dlData)
File "/home/dragorn421/.config/blender/3.2/scripts/addons/fast64_gitlinked/fast64_internal/f3d/f3d_parser.py", line 755, in addTriangle
verts = [self.getTransformedVertex(math_eval(index, self.f3d)) for index in indices]
File "/home/dragorn421/.config/blender/3.2/scripts/addons/fast64_gitlinked/fast64_internal/f3d/f3d_parser.py", line 755, in <listcomp>
verts = [self.getTransformedVertex(math_eval(index, self.f3d)) for index in indices]
File "/home/dragorn421/.config/blender/3.2/scripts/addons/fast64_gitlinked/fast64_internal/z64/model_classes.py", line 982, in getTransformedVertex
position, normal = self.getVertexTransforms(bufferVert, has_normal, has_packed_normals)
File "/home/dragorn421/.config/blender/3.2/scripts/addons/fast64_gitlinked/fast64_internal/z64/model_classes.py", line 964, in getVertexTransforms
transform = self.matrixData[self.getLimbName(limbIndex)]
File "/home/dragorn421/.config/blender/3.2/scripts/addons/fast64_gitlinked/fast64_internal/z64/model_classes.py", line 865, in getLimbName
return self.limbList[index]
IndexError: list index out of range
|
Should be fixed with 955c9a5 |
Dragorn421
left a comment
There was a problem hiding this comment.
Tested:
- Blender 3.2 deku tree import
- Blender 3.2 temple of time import-export
- Blender 3.2
gGerudoRedSkel,gGerudoRedSpinAttackAnimimport-export - Blender 3.2
gEponaSkel,gEponaWalkingAnimimport-export - Blender 3.2
gBoulderFragmentsDLimport-export
This PR adds support for importing/exporting to C the limbs and meshes used by Epona and other horses in OoT
There's nothing particularly special about how OoT handles smooth skinning so imports and exports work by just using an armature modifier
Currently the exporter is set up to export any mesh that has multiple weights per vertex in the format used by skinlimbs
To test out the importer you can change Import Skeleton settings to: