Author Topic: Animate video?  (Read 2446 times)

justintime

  • Jr. Member
  • **
  • Posts: 18
    • View Profile
Animate video?
« on: October 06, 2024, 03:49:32 PM »
I have been using the animate module to animate image based surfaces.   Is it possible to do the same for a video?   So far I have failed miserably, was hoping I could have a video slide in, or even change some of the pinch parameters etc with an animation.  Yes I have something very specific in mind!

Thanks for any pointers.
« Last Edit: October 07, 2024, 11:21:22 AM by justintime »

zestful

  • Full Member
  • ***
  • Posts: 35
    • View Profile
Re: Animate video?
« Reply #1 on: October 07, 2024, 08:16:46 AM »
Check out: https://github.com/oomek/attract-extra/blob/main/modules/inertia.nut

You could do something like this with a video

   
Code: [Select]
video = Inertia( video , 1500, "y");

    function moveMainVideo( ttype, var, ttime )
    {
        if( ttype == Transition.FromOldSelection || ttype == Transition.EndNavigation )
        {

            video.tween_all = Tween.Elastic;
            video.loop_y = false;
            video.y = -700;
            video.to_y = 0;
            video.delay_y = 0;
        }
        if( ttype == Transition.ToNewSelection){video.y = -700}

    }

    fe.add_transition_callback( "moveMainVideo" )

justintime

  • Jr. Member
  • **
  • Posts: 18
    • View Profile
Re: Animate video?
« Reply #2 on: October 07, 2024, 11:17:39 AM »
Interesting!    I am trying that code but I don't think I am following it.   Are you able to create a version of that example that works with a straight copy/paste?    Sorry I am still learning layouts and nut structure.
« Last Edit: October 07, 2024, 11:23:16 AM by justintime »

zestful

  • Full Member
  • ***
  • Posts: 35
    • View Profile
Re: Animate video?
« Reply #3 on: October 07, 2024, 11:32:01 AM »
You need to download the inertia.nut from the link I shared, and put it in your modules folder in Attract Mode.

You'll then from your layout.nut file for your theme your working on, want to load the module:     fe.load_module("inertia");  place that before the code example I shared and it should work for you.
 

zestful

  • Full Member
  • ***
  • Posts: 35
    • View Profile
Re: Animate video?
« Reply #4 on: October 07, 2024, 11:33:28 AM »
Sorry I'm probably assuming too much here, but make sure your video is named video

e.g.

    local video = fe.add_artwork( "snap", 100,100, 600, 400);

justintime

  • Jr. Member
  • **
  • Posts: 18
    • View Profile
Re: Animate video?
« Reply #5 on: October 07, 2024, 11:38:47 AM »
Well I downloaded their examples at github and nothing seems to animate using THEIR own layout file.  Do I need AM+?

zestful

  • Full Member
  • ***
  • Posts: 35
    • View Profile
Re: Animate video?
« Reply #6 on: October 07, 2024, 01:49:56 PM »
Yeah you need Attract Mode +  Probably better upgrading to it, as there's been so much more functionality added over base attract mode

justintime

  • Jr. Member
  • **
  • Posts: 18
    • View Profile
Re: Animate video?
« Reply #7 on: October 10, 2024, 09:09:04 PM »
Just letting everyone know that if you apply a video to a surface , then you can animate as usual.  Solved!

jakabasej8

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Animate video?
« Reply #8 on: November 15, 2024, 11:34:13 PM »
Yeah you need Attract Mode +  Probably better upgrading to it, https://spartan-agency.com/services/development as there's been so much more functionality added over base attract mode https://www.estela.si/stoli-
I agree