1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

Animations in the GUI

Discussion in 'Scripting Workshop' started by guyburt, Feb 29, 2012.

  1. guyburt

    guyburt NI Product Owner

    Messages:
    137
    Hi folks! I want to tart up my GUIs a bit with some animations, if I can. Two quick questions:
    • In Kontakt 4.2.3, is it possible to put e.g. an animated GIF on the GUI and script it so that the animation only kicks in when a note is played? (I was wondering if the way to do this might be to treat the animation as a slider and have it automatically run through all its values... but that seems kludgy. Is there a more elegant solution?)
    • Is having an animation running on the GUI going to slow things down / cause crashes / mess things up for the user? Because if so, then I won't even go there :D

    I've seen at least a couple of GUIs that have animated elements to them, so clearly it can be done...

    Thanks in advance for any tips!
     
  2. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    Kontakt doesn't support GIF format. You can only use PNG (TGA too, but I suggest PNG all the same).

    What I would ask is do you really want to run an animation when a note is played? That could end up taking a fair bit of CPU, depending on image size and amount of frames...
     
  3. guyburt

    guyburt NI Product Owner

    Messages:
    137
    If it would take up a ton of CPU, I won't do it. I know from bitter personal experience what it's like trying to squeeze every bit of power out of your laptop to finish a track, and fancy graphics that hog cycles might push me over the edge :D

    So I think on balance I'll skip the idea. Would've looked damn cool, though ;)
     
  4. kotori

    kotori NI Product Owner

    Messages:
    1,153
  5. guyburt

    guyburt NI Product Owner

    Messages:
    137
    I'm nervous now, because of the CPU thing. So I may back off from it.

    But of course it could be switchable from the UI, so people could turn it off... I'll give it some thought ;)
     
  6. Levitanus

    Levitanus Member

    Messages:
    85
    I have a problem:
    tryed to remake animation folowing tutorial http://dummyworld.net/media/?pageid=67
    but, kontakt don't recognize png, as sprite animation Untitled_004.jpg
    i supporse, that it's haven't found txt file, but i don't know, where problem is

    png+txt are put into directory of saved nki, in subdirectories resources/pictures
     
  7. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    Make sure that the TXT has one empty line at the end, and it also needs to be created with Notepad on Windows for best compatibility, or any text editor that can convert line endings to LF format (so, not CR, and not CR/LF).
     
  8. showard

    showard NI Product Owner

    Messages:
    69
    Which is it?
    -- LF format?
    OR
    -- Notepad ... which only saves in CR/LF format?
     
  9. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    Hm, wait. All the TXT files that I have are LF format. I did read recommendation about Notepad in Kontakt Player Developer Guide (IIRC), but now I see Notepad is in fact saving CR/LF format.


    I'm using Notepad++ personally - it can convert various newline formats.
     
  10. Levitanus

    Levitanus Member

    Messages:
    85
    EvilDragon, Showard, Thank you very much!
    I found, that problem not only in txt, but also in png. With Knobman conversion it works correctly, but it makes only 31 frame) now i'm finding way to do it without KnMn, may it should be uncompressed... )
    May, problems with txt gone away, when i took your txt example from other same theme.
    Thank You one more time! :)
     
  11. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
  12. Levitanus

    Levitanus Member

    Messages:
    85
  13. henrik242

    henrik242 NI Product Owner

    Messages:
    50
    Argh! Why is something as vital as this not written clearly in the documentation? I've spent 2 hours figuring out why my image was not correctly split into animations, just to find out that it was because of a stupid line break...

    Thanks a lot for sharing this! :)

    I'll have to make my own tutorial for this, I guess :)
     
  14. henrik242

    henrik242 NI Product Owner

    Messages:
    50
    Last edited: Mar 10, 2014
  15. Jean-Thomas Cloutier

    Jean-Thomas Cloutier New Member

    Messages:
    3
    Did the tutorial as well, but it doesn't play the animation. It seems to only play the first frame...
     
  16. Jean-Thomas Cloutier

    Jean-Thomas Cloutier New Member

    Messages:
    3