attachment.RegionOffsetX = * (0.5f - Mathf.InverseLerp(,, 0)) / sprite.pixelsPerUnit do some math and assign UVs and sizesĪttachment.SetUVs(texRect.xMin, texRect.yMax, texRect.xMax, texRect.yMin, rotated) This hack feels so dirty, but I may stick with it. On the attachment, I also flipped the width and the height, and it now seems to be working. I added the 'rotated = true' again, so the UVs are rotated. Hopefully without rotating all of my sprite assets. So I have to figure out how to deal with this rotation better. This means it is placing an upright UV onto a rotated mesh, resulting in the stretching. When rotating does happen, the mesh itself is not rotated, only the UVs. Now, the sprite is rotated 90 degrees again, but the scaling looks to be correct. I disabled the 'rotate' flag I have been using in SpriteAttacher. ![]() ![]() (Edit: Found it under 'Advanced' texture type, but still doesn't fix it.)Īlso, do you have excess alpha pixels around your sprite? I figured this setting only helped in that case. The only way I could see to change it was via an asset post processor during import, so I think it actually changed. Thanks for the suggestion, but I did try that. Creating my own attachments, whether through atlas regions or unity sprites, just isn't working. The only way it seems to work is if I use attachments that are built into the skeleton data. But I still see the squished sprite, and the scaling seems wrong. I rotated the UVs on the attachment, so that's fine. The Atlas Region Attacher shows the sprite rotated when I swap to the second attachment. All transforms are zero, except the bones rotation to make it go upwards at 90 degrees. A single slot is on the bone, with 2 attachments under it. A single bone, stretching from the origin up. I am also seeing this scaling issue with the Atlas Region Attacher. ![]() I'm a bit nervous that I won't be able to find a workaround for this one. My sprite doesn't have alpha around it, so I guess it doesn't really apply. Well, I took a stab at the sizing issue using the method proposed in the "Bug in SpriteAttachmentLoader" post, but no luck. I saw the Attaching Unity Sprites to Skeletons thread yesterday and will scan it again, but the Bug thread looks particularly helpful. To be clear though, the sprite atlas packed by Unity did not rotate my sprite.Īwesome, thanks for the link. I wonder if my bone has to be the exact size of the image.Įither way, I'm not sure that I'm on the right track. To keep it in roughly the same position, I had to set the pivot of my sprite to 'Left', which is certainly not what I'd expect. I'm not sure if that is a result of my hack, or if I just need to solve my own pivot issues. This change made the sprite properly rotated, but the pivot point is pretty funky. The 'TODO' is not mine, and seems pretty relevant. rotated = sprite.packingRotation = SpritePackingRotation.Any < I have tried disabling rotation in the texture atlas, checking the sprite packingRotation (which is None), all sorts of stuff, but it is still rotated 90 degrees to the left when I attach it.Įdit: I changed the following in SpriteAttacher.cs, just to see what would happen: //TODO: make sure this rotation thing actually works Whenever I attach a Unity sprite, using AttachUnitySprite directly or with the SpriterAttacher component, my sprite ends up rotated. sandemo on Blender 3.1+ True-Assets v4.I am using Unity 5.1.francoT on UnrealEngine 5.1 FluidNinja Live v1.8.51.3 Crack 2023 Download. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |