General Category > ASL Scripts

Animated Textures Using Controller Scripts

<< < (5/8) > >>

Steve:
@daniel99 OK here's a build that should fix the crash. Give it a try and let me know if it works.

http://www.anim8or.com/download/preview/files/animcl1318plus.zip

dancingshoes:
Steve

Thank you for the response and please excuse my tardy reply.

Don't know if the plus program was supposed to fix my issue. It fixes the test.an8 I posted but, for me, does not fix Raxx's script which still crashes.

Not to get you too bogged down in this, but I editted Raxx's example 2 an8 file and moved the "sprites_enabled" controller from the world, for a test, to "Camera01" (and of course changed the "mouthe_script" references from world to Camera01) and it doesn't crash, with nonplus 1318.

However I get inconsistent results as to whether the sprite works. The object mode texture selector is updated via the script, but the scene mode object texture is not always updated. If it works, it works thru out the scene but mostly does not work. I can't characterize when it works and doesn't.

Minor issue: The Object Mode Materials Texture Selector load button at the bottom doesn't update the static text window to show the newly selected file name. Caused confusion for me.

Thanks again for Anim8or!

Dan

AlecJames:
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

Steve:
Oops!  I hadn't thought about relative paths when I was writing the texture file open code. I'll have to give this some more thought. It's pretty crazy the way it is now.

AlecJames:
Thanks Steve - I can't work out the cause and effect when the file path changes to something I didn't expect.  I set up a repeatable test and all looks good, then some time later my test setup does not have the same result. I can't be sure when something changes whether I changed something in my test project or left something in an odd state or whether something changed in anim8or?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version