Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animated GIF aren't animated #132

Closed
elcibi opened this issue Jan 5, 2023 · 4 comments
Closed

Animated GIF aren't animated #132

elcibi opened this issue Jan 5, 2023 · 4 comments
Labels
confirmed The issue can be reproduced enhancement New feature or request fixed The issue is already fixed

Comments

@elcibi
Copy link

elcibi commented Jan 5, 2023

Hi and thanks for this wonderful job!

Unfortunately, I have found an issue with animated gif :

Describe the bug
When using an animated gif as "MovieTexture" an error occurs : "Error loading movie: http://.../fire.gif?_=1672934206216.006 error"
When used as ImageTexture, only the first frame of the gif is displayed without any animation.

To Reproduce
Use any animated gif as texture for MovieTexture (error, not displayed) or ImageTexture (no error, but no animation)

Shape {
  appearance Appearance {
    texture MovieTexture {
      url "transparent-flame-video-5.gif"
    }
  }
  geometry Box {
    size .8 1.5 .001
  }
}

Expected behavior
Animated gif should be displayed and animated as movies, but with the benefit of the gif transparency
eg. https://jsl-online.com/wp-content/uploads/2019/07/transparent-flame-video-5.gif
This animated fire gif applied to a box shape should be transparent and animated :)

@elcibi elcibi added the bug Something isn't working label Jan 5, 2023
@create3000 create3000 added enhancement New feature or request confirmed The issue can be reproduced and removed bug Something isn't working labels Jan 5, 2023
@create3000
Copy link
Owner

create3000 commented Jan 6, 2023

I spend some hours on this issue, now it's finally done. ;) Now, you can use GIFs with MovieTexture. Because it is hard to determine if the GIF is transparent, you must do it manually by setting Appearance.alphaMode to "BLEND" as shown below. Please test the new MovieTexture, and drop me a line if it is working for you.

#X3D V4.0 utf8

PROFILE Interchange

Shape {
  appearance Appearance {
    alphaMode "BLEND"
    texture MovieTexture {
      loop TRUE
      url "transparent-flame-video-5.gif"
    }
  }
  geometry Box {
    size .8 1.5 .001
  }
}

@create3000 create3000 added the fixed The issue is already fixed label Jan 6, 2023
@elcibi
Copy link
Author

elcibi commented Jan 6, 2023

It works fine, many thanks for this fast enhancement! :)

I've encountered an issue with a two framed gif (light on/light off) which wasn't playing the animation, but simply added a third frame to it and it runs well. Transparency works fine with the alphaMode setting!

Great job! Thanks to you I can dust off some pretty old vrml scripts. You're my hero! :)

@elcibi elcibi closed this as completed Jan 6, 2023
@create3000
Copy link
Owner

Have fixed frame number determination. Should work better now when GIF has only two frames.

@elcibi
Copy link
Author

elcibi commented Jan 10, 2023

Works perfectly :)
Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed The issue can be reproduced enhancement New feature or request fixed The issue is already fixed
Projects
None yet
Development

No branches or pull requests

2 participants