Crash by a layer script
Posted: Fri Jan 12, 2007 3:18 pm
I tried to create a layer script that dynamically translates a layer inside a bone layer, based on specifically named bones. However, for some reason, the script keeps crashing on me consistently. It could be that I'm asking too much of the layer script, or perhaps (even worse) there is a bug involved.
I have put the relevant files in this zip archive on my .Mac account:
MoveByBoneCrashes.zip (12 KB)
Crash Procedure
The crash occurs both in Anime Studio Pro and Moho 5.3.
The test.anme file has three layers: a bone layer, and two child vector layers, circle and box.
The crash only appears when using MoveByBone.lua and MoveByBoneModded-1.lua, not with MoveByBoneModded-2.lua
If I comment out this piece of code (in lines 70 - 82, as done in MoveByBoneModded-2.lua) the crash does not occur:
If I include the layer selection with the SetSelLayer function (in line 70 and 82, as done in MoveByBoneModded-1.lua), the crash does occur:
This leads me to think that layer selection is somewhat unstable when used in layer scripts, although I can't rule out that I made a mistake in the script. However, that shouldn't lead to a program crash, should it?
I have also included the crash report with the zip archive.
I have put the relevant files in this zip archive on my .Mac account:
MoveByBoneCrashes.zip (12 KB)
Crash Procedure
The crash occurs both in Anime Studio Pro and Moho 5.3.
- Open Anime Studio Pro
- Load test.anme
- Embed the .lua script in the box layer
- Go to any frame other than zero
- Select the bone layer
- Go to another frame
- crash...
The test.anme file has three layers: a bone layer, and two child vector layers, circle and box.
The crash only appears when using MoveByBone.lua and MoveByBoneModded-1.lua, not with MoveByBoneModded-2.lua
If I comment out this piece of code (in lines 70 - 82, as done in MoveByBoneModded-2.lua) the crash does not occur:
Code: Select all
-- moho:SetSelLayer(parent)
-- local skel = moho:Skeleton()
-- local angle = { x = 0, y = 0, z = 0 }
-- if ( bone.x >= 0 ) then
-- angle.x = skel:Bone(bone.x).fAngle - bAng.x
-- end
-- if ( bone.y >= 0 ) then
-- angle.y = skel:Bone(bone.y).fAngle - bAng.y
-- end
-- if ( bone.z >= 0 ) then
-- angle.z = skel:Bone(bone.z).fAngle - bAng.z
-- end
-- moho:SetSelLayer(layer)
Code: Select all
moho:SetSelLayer(parent)
-- local skel = moho:Skeleton()
-- local angle = { x = 0, y = 0, z = 0 }
-- if ( bone.x >= 0 ) then
-- angle.x = skel:Bone(bone.x).fAngle - bAng.x
-- end
-- if ( bone.y >= 0 ) then
-- angle.y = skel:Bone(bone.y).fAngle - bAng.y
-- end
-- if ( bone.z >= 0 ) then
-- angle.z = skel:Bone(bone.z).fAngle - bAng.z
-- end
moho:SetSelLayer(layer)
I have also included the crash report with the zip archive.