mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-14 02:58:44 +08:00
[lua] Parsing of skin bones and constraints was incorrect. Fixes #1492.
This commit is contained in:
parent
d66d3daef0
commit
e9f816a8ad
@ -251,6 +251,39 @@ function SkeletonJson.new (attachmentLoader)
|
||||
if root["skins"] then
|
||||
for skinName,skinMap in pairs(root["skins"]) do
|
||||
local skin = Skin.new(skinMap["name"])
|
||||
|
||||
if skinMap["bones"] then
|
||||
for _, entry in ipairs(skinMap["bones"]) do
|
||||
local bone = skeletonData:findBone(entry)
|
||||
if bone == nil then error("Skin bone not found: " .. entry, 2) end
|
||||
table_insert(skin.bones, bone)
|
||||
end
|
||||
end
|
||||
|
||||
if skinMap["ik"] then
|
||||
for _, entry in ipairs(skinMap["ik"]) do
|
||||
local constraint = skeletonData:findIkConstraint(entry)
|
||||
if constraint == nil then error("Skin IK constraint not found: " .. entry, 2) end
|
||||
table_insert(skin.constraints, constraint)
|
||||
end
|
||||
end
|
||||
|
||||
if skinMap["transform"] then
|
||||
for _, entry in ipairs(skinMap["transform"]) do
|
||||
local constraint = skeletonData:findTransformConstraint(entry)
|
||||
if constraint == nil then error("Skin transform constraint not found: " .. entry, 2) end
|
||||
table_insert(skin.constraints, constraint)
|
||||
end
|
||||
end
|
||||
|
||||
if skinMap["path"] then
|
||||
for _, entry in ipairs(skinMap["path"]) do
|
||||
local constraint = skeletonData:findPathConstraint(entry)
|
||||
if constraint == nil then error("Skin path constraint not found: " .. entry, 2) end
|
||||
table_insert(skin.constraints, constraint)
|
||||
end
|
||||
end
|
||||
|
||||
for slotName,slotMap in pairs(skinMap.attachments) do
|
||||
local slotIndex = skeletonData.slotNameIndices[slotName]
|
||||
for attachmentName,attachmentMap in pairs(slotMap) do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user