Need help with "Sort by Z Scale" script
Posted: Sat Feb 06, 2021 1:35 pm
Hi! I am very interested in this script that Lukas did and posted here: viewtopic.php?f=12&t=33324&hilit=y+sort
I'm not refering to the first script he talks about in that post (sort by Y position) but the second one, that is on the bottom of the page 1 (sort by z scale).
The script can be used to create the best layer sorting system I've seen, that can be controled by smartbones without blocking it like layer order does, and that's why I've always been interested in it.
Unfortunately, I keep getting the same console errors and I've been trying to find why but couldn't. The script itself is short and looks simple so maybe Lukas or, if he's still bussy, someone can help me to fix it.
The error I get is: LK_SortByZScale.lua:10 attempt to call method 'Layer' (a nil value) and I also have the same error but on the line 20, sometimes. The errors seem to happen randomly while the animation is playing and a different layer than the one with the script is selected. If the script layer is selected, I think it doesn't happen.
It happens with a frecuency that varies according to the complexity of the rig. The more complex, the more frecuent. From 1 error per 5 minutes to 1 error per second, and the rate is not fixed.
This can be used as a reproduction project. Here it happens each 2-4 minutes or so, while the animation is looping and you have one layer selected different than "grupo n"
https://1drv.ms/u/s!AiyKCw6Xey5TgZR7YbATmV42kdH5Hg
I'm using Moho 12.5 on Windows 10
I'm not refering to the first script he talks about in that post (sort by Y position) but the second one, that is on the bottom of the page 1 (sort by z scale).
The script can be used to create the best layer sorting system I've seen, that can be controled by smartbones without blocking it like layer order does, and that's why I've always been interested in it.
Unfortunately, I keep getting the same console errors and I've been trying to find why but couldn't. The script itself is short and looks simple so maybe Lukas or, if he's still bussy, someone can help me to fix it.
The error I get is: LK_SortByZScale.lua:10 attempt to call method 'Layer' (a nil value) and I also have the same error but on the line 20, sometimes. The errors seem to happen randomly while the animation is playing and a different layer than the one with the script is selected. If the script layer is selected, I think it doesn't happen.
It happens with a frecuency that varies according to the complexity of the rig. The more complex, the more frecuent. From 1 error per 5 minutes to 1 error per second, and the rate is not fixed.
This can be used as a reproduction project. Here it happens each 2-4 minutes or so, while the animation is looping and you have one layer selected different than "grupo n"
https://1drv.ms/u/s!AiyKCw6Xey5TgZR7YbATmV42kdH5Hg
I'm using Moho 12.5 on Windows 10