Skip to content

Conversation

@rguerreiro-kb
Copy link
Contributor

Transparent sprites, when sliced generate this very annoying message from Unity. This PR attempts to fix them by setting the missing metadata.

Screenshot 2023-07-03 at 6 19 30 PM

@codecov
Copy link

codecov bot commented Jul 4, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (84f0f89) 100.00% compared to head (7401425) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #35   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        20           
  Lines          840       840           
=========================================
  Hits           840       840           
Impacted Files Coverage Δ
...ts/SpriteDicing/Editor/Processors/SpriteBuilder.cs 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@elringus
Copy link
Owner

elringus commented Jul 4, 2023

Hey, Thanks for the PR! Can you please specify Unity version which generates the warnings (or repro steps)? I'm using 2019.4 and never seen them.

@rguerreiro-kb
Copy link
Contributor Author

Great question! Yes, it also happens on Unity 2019, and above. I've included a Scene with the transparent image that existed before from another PR, and a newly generated one. You can toggle the GameObjects and you'll see the logs showing this warning.

Nothing else happens other than the warning, but it gets in the way of legitimate logs.

Assets/Samples/Scenes/TransparentTest.unity

@elringus
Copy link
Owner

elringus commented Jul 5, 2023

I've checked your scene and pre-generated asset indeed produce warnings, but after re-generating it in 2019.4 (w/o the proposed changes) there are no warnings. I assume you've generated it with a later Unity version? Can you please specify which exactly?

@rguerreiro-kb
Copy link
Contributor Author

rguerreiro-kb commented Jul 5, 2023

Actually, it's because you've regenerated in this branch, which contains the fix. If you regenerate in master, you'll see the warning message again.
But I've downloaded Unity 2019.4.40 to make the changes to this project, and I can replicate the issue here. Another option might be because I'm using a MacOS.

@elringus
Copy link
Owner

elringus commented Jul 5, 2023

I've commented out the changes before testing. Weird. That said, even though I don't have warnings, generated empty sprite looks like this:

419329779969e62b92f953fe1b579d1e

— which is still obviously a bug. It's probably because the mesh retains data from Unity's internal create sprite method. I'll look into this more.

@rguerreiro-kb
Copy link
Contributor Author

Weird, I don't see these artifacts in the image, but I did see something like that when I was coding it initially and I messed up the vertices, uvs, and triangles. I don't remember the combination, though. I'll try to reproduce that.

@elringus
Copy link
Owner

elringus commented Jul 5, 2023

Weird, I don't see these artifacts in the image, but I did see something like that when I was coding it initially and I messed up the vertices, uvs, and triangles. I don't remember the combination, though. I'll try to reproduce that.

My bad, when testing I didn't comment out the if (vertices.Count > 0) clause (I thought it was there initially). It's now reproducing as you've reported. Sorry for the confusion.

@rguerreiro-kb
Copy link
Contributor Author

Ah, cool. Do you want me to remove the extra scene and all the stuff I added in the last commit? I can regenerate the Flat one that existed before.

@elringus
Copy link
Owner

elringus commented Jul 5, 2023

It's ok I'll brush it up myself and merge the PR. Thanks again for the contribution!

@elringus elringus merged commit 8573507 into elringus:master Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants