Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Pages: 1 [2] 3

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

fefe01

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

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: 322
  • Me : Anim8or RULLZ \m/
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #16 on: November 14, 2017, 12: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: 1482
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #17 on: November 19, 2017, 02: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: 27
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #18 on: February 27, 2018, 04: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: 2124
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #19 on: March 02, 2018, 04:05:44 pm »

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

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2124
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #20 on: March 04, 2018, 09:27:30 pm »

@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: 27
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #21 on: March 13, 2018, 10:21:59 am »

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: 240
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #22 on: April 01, 2018, 04: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, 09:01:25 am by AlecJames »
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2124
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #23 on: April 01, 2018, 12: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: 240
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #24 on: April 02, 2018, 03: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: 27
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #25 on: April 07, 2018, 08:15:40 am »

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: 240
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #26 on: April 07, 2018, 06: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

bayinghound

  • Full Member
  • ***
  • Posts: 210
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #27 on: September 12, 2020, 04:28:10 am »

For the life of me, I can't get this script to work. Maybe I'm not understanding the step by step instructions? I just doesn't do anything. Also, the ANI_setup spits out an error, Line 54
Error: Error in expression
Logged

AlecJames

  • Full Member
  • ***
  • Posts: 240
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #28 on: September 13, 2020, 03:08:34 am »

I made an example in this thread   https://www.anim8or.com/smf/index.php/topic,5728.msg43026.html#msg43026

I just tested it on version 1393 and it worked (I saw the splash in scene mode), if you want to test it, copy the zip contents (use v2) to c:\temp\ because I have some hard coded paths. 

What do you have in your script on line 54?
Logged

bayinghound

  • Full Member
  • ***
  • Posts: 210
    • View Profile
Re: Animated Textures Using Controller Scripts
« Reply #29 on: September 13, 2020, 08:50:14 am »

I was using the generator to create the animated texture, but it didn't work and that error kept popping up. I'll try your example. Thanks.
Logged
Pages: 1 [2] 3