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

Texture sheet animation module Sprite mode not working #79

Closed
soimy opened this issue Jul 2, 2020 · 8 comments
Closed

Texture sheet animation module Sprite mode not working #79

soimy opened this issue Jul 2, 2020 · 8 comments
Assignees
Labels
bug Something isn't working released on @preview

Comments

@soimy
Copy link

soimy commented Jul 2, 2020

Describe the bug
Texture sheet animation module Sprite mode not working, hole texture of a multi-packed sprite is shown.

To Reproduce
Steps to reproduce the behavior:

  1. Set particle system sheet animation module on, mode to sprite
  2. Assign several sprites from a multi-packed spritesheet.
  3. UI particle set animatable properties to _MainTex_ST
  4. Playback, whole spritesheet shown instead of sprite.

Environment (please complete the following information):

  • Version [3.0.0-preview.11]
  • Platform: [e.g. Editor(Windows)]
  • Unity version: [e.g. 2020.1.0b8]

Additional context
Digging through the code, I found that UIParticle.cs will set textureSheet.uvChannelMask

textureSheet.uvChannelMask = (UVChannelFlags) (sprite && sprite.packed ? -1 : 0);

comment out this line works for me.

@soimy soimy added the bug Something isn't working label Jul 2, 2020
@mob-sakai
Copy link
Owner

@soimy
Sorry for my late reply.
I would like to know more about this issue.
Could you please attach a minimal project that reproduces the issue?

@soimy
Copy link
Author

soimy commented Jul 22, 2020

I will.
Can you tell me why textureSheet.uvchannelMask is set to -1 when using multi packed sprite?
It works when uvChannelMask is untouched(UV0)

@mob-sakai
Copy link
Owner

@soimy
Sorry for my late reply.
The issue is reproduced in my environment.

Can you tell me why textureSheet.uvchannelMask is set to -1 when using multi packed sprite?

To support the Sprite Atlas.

@soimy
Copy link
Author

soimy commented Aug 12, 2020

uvChannelMask is usually handled by the user via the dropdown menu. Multi-packed sprite sheet won't work when uvChannelMask is set to Nothing(-1)

@mob-sakai
Copy link
Owner

Yes, you are right.
I should not have used it as a workaround of any kind.

The problem to begin with was that I couldn't get the actual texture from the sprite.
The sprites in the Sprite Atlas do not return a packed texture in editor mode.

I just found a non-public API that gets the packed textures from sprites.
I'll test it later.

@mob-sakai
Copy link
Owner

I did it! 👍
This API solves the issue!

Before:
Aug-12-2020 21-07-44
After:
Aug-12-2020 21-08-41

github-actions bot pushed a commit that referenced this issue Aug 12, 2020
# [3.0.0-preview.16](v3.0.0-preview.15...v3.0.0-preview.16) (2020-08-12)

### Bug Fixes

* texture sheet animation module Sprite mode not working ([30d1d5d](30d1d5d)), closes [#79](#79)
@github-actions
Copy link

🎉 This issue has been resolved in version 3.0.0-preview.16 🎉

The release is available on:

Your semantic-release bot 📦🚀

@soimy
Copy link
Author

soimy commented Aug 13, 2020

Thank you!

LionelPerrault added a commit to LionelPerrault/Unity-Particle that referenced this issue Jul 25, 2023
# [3.0.0-preview.16](mob-sakai/ParticleEffectForUGUI@v3.0.0-preview.15...v3.0.0-preview.16) (2020-08-12)

### Bug Fixes

* texture sheet animation module Sprite mode not working ([30d1d5d](mob-sakai/ParticleEffectForUGUI@30d1d5d)), closes [#79](mob-sakai/ParticleEffectForUGUI#79)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released on @preview
Projects
None yet
Development

No branches or pull requests

2 participants