Hi Raxx and all texture animators
This is a really clever script, I’m using it in my animation challenge in the facebook group. Thanks so much.
I had a couple of random problems –
- it would not animate (no texture was shown)
- when the an8 file opened it complained that the texture file could not be found and it removed the material
I’ve found 2 causes for these issues:
1) If the path anim_controller (multiplier) value goes negative and the an8 file is saved, the texture file name is saved as (example) file0000-3.png. I know I shouldn’t let the value go negative by setting a nice linear gradient in the graph editor (BTW excellent video tutorial) but it took me a while to understand what was happening.
I changed
// Round down to the nearest frame when the multiplier is applied
$texFrame = floor(max($controllerAnimFloat,0) * $numFrames + 0.5);
Of course there is still no animation while the key is negative but I don’t have to redo the texture as a result.
2) This is still puzzling me; I’ve got a work around but don’t really understand the root cause.
When anim8or builds the texture file name, sometimes it prepends the full path to the project dir and with my relative path script parameter of ./sprites/anim1 the texture filename path becomes
C:\pathtomyproject\ ./sprites/anim1/file0000.png
Which anim8or doesn’t complain about but does not appear to load.
Other times anim8or prepends .\ and with my relative path script parameter of ./sprites/anim1 the texture filename becomes
.\ ./sprites/anim1/file0000.png
Similar problem.
When I started play with the script I had a relative path of ./sprites/anim1 and it worked just fine so there must be a third variant (the expected path result), but I can’t recreate it now.
I’m puzzled because I can’t work out what causes each of the different path variants? (I’m on win7 x64)
My work around is either
Use an absolute path C:/pathtomyproject/sprites/anim1/ as the script parameter
Or (this is what I’m using at the moment, EDIT: didn't stay working at file open, but worked while editing / rendering)
"Sprites\\anim1\\" as the script parameter
Hope this helps others that may have similar issues. If its not working the place I look is the object material definition to examine the path to the texture, it should be a valid path to one of your texture files, the file number is approx the last frame you viewed in the scene + starting animation file number.
@Raxx, Thanks again for a great script
A