Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Pages: 1 [2]

Author Topic: Animated Textures Using Controller Scripts  (Read 10131 times)

fefe01

  • Newbie
  • *
  • Posts: 32
  • make professional works only using simple softwares
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #15 on: November 12, 2017, 04:57:01 pm »

Thank you very much raxx! I think that it it would be helpful even though i am not really good at scripting language! :)
Logged

daniel99

  • Sr. Member
  • ****
  • Posts: 319
  • Me : Anim8or RULLZ \m/
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #16 on: November 14, 2017, 05:48:29 am »

@Raxx  I tried to replace the screen images with my sequence, and that's the only way I can make it kinda work. And all the crashing. I dunno what's the problem. Maybe I'm idiot  :) :) :)
   I've been using terranim8or 6 for the urgent project, but it's a pain in the ass because it doesn't have normal maps. I had to edit all 150 materials of it.
   Maybe Steve will do something about animated material soon. I mean, it's a useful and much-needed function anim8or should have. And maybe a displacement map.
   Maybe a possible way to solve this problem sooner would be the creator of Terranim8or to add the normal maps...
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1461
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #17 on: November 19, 2017, 07:47:12 pm »

@daniel99 Sorry, haven't been able to get to this. Have you been switching between the Scene editor and the other editors a lot? I recommend disabling animation using the sprites_enabled controller and saving before leaving the scene editor, to avoid crashing as much as possible.
Logged

dancingshoes

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #18 on: February 27, 2018, 09:49:51 am »

In trying to see why your animation script crashes Anim8or for me (build 1318, Win 7 64 bit) I discovered, at least for me, the following:
1. Start a new project.
2. Go to Scene mode and create a Controller under World and assign a new Key in the time line.
3. Save and close the project.
4. Reopen the project.

Anim8or crashes either on opening the project or when selecting Scene mode. This is in part why your script fails for me.

Doesn't seem to matter if it's a boolean controler or float, first key frame or later.

I atttached an example an8 file.
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 1658
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #19 on: March 02, 2018, 09:05:44 pm »

dancingshoes: thanks for the sample project. I'm working on a fix.
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 1658
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #20 on: March 05, 2018, 02:27:30 am »

@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
Logged

dancingshoes

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #21 on: March 13, 2018, 02:21:59 pm »

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
Logged

AlecJames

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #22 on: April 01, 2018, 08:54:46 am »

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
« Last Edit: April 01, 2018, 01:01:25 pm by AlecJames »
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 1658
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #23 on: April 01, 2018, 04:00:52 pm »

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.
Logged

AlecJames

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #24 on: April 02, 2018, 07:33:28 am »

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?

Logged

dancingshoes

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #25 on: April 07, 2018, 12:15:40 pm »

Here's a program that automatically creates an an8 file for animating a texture using a sequence of still images per Raxx's design. Setup only involves selecting, in Anim8or, the first texture file in an animation sequence, naming the texture, and then running this program which creates a new, animated An8 file. See the readme for details.

It's not as versatile as Raxx's but it is a no brainer to use. It can handle looped and unlooped sequences.

Like everything, it's experimental. If it works for you, great.

(I believe there's an error in Raxx's script that may have caused my earlier problems: it doesn't seem to handle the numbering of the 0th image properly. It adds an extra '0' (????) making the 0th texture unfindable.)
Logged

AlecJames

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #26 on: April 07, 2018, 10:36:32 pm »

Thanks - looks like you've been busy!

I've got Raxx's script working well in my project. At the moment I've only got one animated texture in my project but I l really like the effect so I'd like to squeeze in some others.  In my scene I wanted "clutter" and it's taking ages to model all the stuff so not sure if I'll have time.

I will try it out, thanks for the hard work :)


 
Logged
Pages: 1 [2]