mirror of
https://github.com/mwpenny/portal64-still-alive.git
synced 2024-10-19 22:27:36 -04:00
Fail explicitly when level armatures nest bones
Level animations use global coordinates, but sk_animation uses relative offsets for child bones. Updating sk_animation to use global coordinates works, but would break support for model animations (which use relative offsets). Although model animation export logic is currently implemented on the C++ side and would not be immediately affected, eventually it'd be worth it to move it over to Lua for simplicity and consistency. So to avoid a future breaking change, and since complex armatures for level animations are not likely to be needed, I'm leaving the current behavior as-is until it is proven to be useful/necessary. Levels which break this rule will now fail to export, to avoid surprises for anyone who tries.
This commit is contained in:
parent
3bcf1371e9
commit
79e77030c1
|
@ -49,6 +49,11 @@ for index, armature in pairs(armatures) do
|
|||
-- build an index used to attached parts of the scene
|
||||
-- to animation nodes later
|
||||
for _, node in pairs(armature.armature.nodes) do
|
||||
local _, parent_index = armature.armature:get_parent_bone(node)
|
||||
if parent_index then
|
||||
error("Nested bones are not supported (found in armature '" .. armature.name .. "')")
|
||||
end
|
||||
|
||||
table.insert(bones_as_array, node)
|
||||
local bone_index = #bones_as_array
|
||||
|
||||
|
|
Loading…
Reference in a new issue