I am using [VarDef, ret, [Mesh3DGet, 4,,,uvtile]] to start iteration over the uvtiles on a mesh, and subsequent [VarDef, ret, [Mesh3DGet, 5,,,uvtile]] in a loop. This works fine the first time it is executed, and the loop executes and gets the correct uvtile index.
The second time the user pushes the button to execute this code, the [VarDef, ret, [Mesh3DGet, 4,,,uvtile]] call has a ret != 0. In my case ret is -1.
What does this error code mean?
How do I get more information on the error?
How do I prevent this error from occurring on subsequent calls to Mesh3dGet after the first iteration loop?
There are no specific error codes for that command; -1 is likely to always be returned. In this case I think it's probably due to you using [VarDef] . Use [VarSet] instead and it should work OK. However, I did find that the command sometimes returned -1 even when correctly setting the variable.