mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-26 09:13:53 +01:00
b3d: Return a list of animated bone properties
This commit is contained in:
parent
4e350213a8
commit
4095969890
6
b3d.lua
6
b3d.lua
@ -305,7 +305,7 @@ local binary_search_frame = modlib.table.binary_search_comparator(function(a, b)
|
|||||||
return modlib.table.default_comparator(a, b.frame)
|
return modlib.table.default_comparator(a, b.frame)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
--> [bonename] = { position = vector, rotation = quaternion, scale = vector }
|
--> list of { bonename = string, position = vector, rotation = quaternion, scale = vector }
|
||||||
function get_animated_bone_properties(self, keyframe, interpolate)
|
function get_animated_bone_properties(self, keyframe, interpolate)
|
||||||
local function get_frame_values(keys)
|
local function get_frame_values(keys)
|
||||||
local values = keys[keyframe]
|
local values = keys[keyframe]
|
||||||
@ -343,8 +343,8 @@ function get_animated_bone_properties(self, keyframe, interpolate)
|
|||||||
properties[property] = properties[property] or modlib.table.copy(node[property])
|
properties[property] = properties[property] or modlib.table.copy(node[property])
|
||||||
end
|
end
|
||||||
if node.bone then
|
if node.bone then
|
||||||
assert(not bone_properties[node.name])
|
properties.bonename = node.name
|
||||||
bone_properties[node.name] = properties
|
table.insert(bone_properties, properties)
|
||||||
end
|
end
|
||||||
for _, child in pairs(node.children or {}) do
|
for _, child in pairs(node.children or {}) do
|
||||||
get_props(child)
|
get_props(child)
|
||||||
|
Loading…
Reference in New Issue
Block a user