AssetRipper / AssetRipper

GUI Application to work with engine assets, asset bundles, and serialized files
https://assetripper.github.io/AssetRipper/
GNU General Public License v3.0
4.2k stars 553 forks source link

Unified Sprite Export #779

Open ds5678 opened 1 year ago

ds5678 commented 1 year ago

Context

Current handling of sprites is a mess. There's 3 equally broken export modes. I didn't write code for any of them and cannot contact the authors. Code documentation is sparse and does not include strong/thorough justification for decisions made. We need one ring to rule them all export mode that handles all cases.

Sprite.RenderDataKey and SpriteAtlas.RenderDataMap

Although I haven't done any investigation yet, I suspect these are critically important for this endeavor. In particular, RenderDataKey is an AssetPair<GUID, long>, which is an editor PPtr.

Related Issues and Pull Requests

ds5678 commented 1 year ago

Currently, textures have an injected property Dictionary<ISprite, ISpriteAtlas?> SpriteInformation that is used to store references collected during processing. I do not like this property and feel that an artificial asset would be cleaner and more maintainable.

public sealed class SpriteInformationObject : UnityObjectBase
{
    public ITexture2D Texture { get; }
    public IReadOnlyDictionary<ISprite, ISpriteAtlas?> Sprites { get; }
}
awsdert commented 4 months ago

Even if it's temporary and just a poorly done export I'd like to still be able to export the sprites with some option like "Use outdated sprite export scripts (only try if you don't mind corrupt/incorrect result) - This option will be removed when new ones are confirmed to be working correctly" For me I don't need perfect sprites at the moment, as long as it looks similar to the expected result then it's good enough for my mods

ds5678 commented 4 months ago

Even if it's temporary and just a poorly done export I'd like to still be able to export the sprites with some option like "Use outdated sprite export scripts (only try if you don't mind corrupt/incorrect result) - This option will be removed when new ones are confirmed to be working correctly" For me I don't need perfect sprites at the moment, as long as it looks similar to the expected result then it's good enough for my mods

I have no idea what you're asking for.

awsdert commented 4 months ago

You still have the old broken code right? I would like an option to use that even if the output isn't perfect. The option would need a note of some sort attached to it for users that are unaware of the code not perfectly doing as expected but besides that there should be no problem in allowing it's use if the API it used is still available.

ds5678 commented 4 months ago

You still have the old broken code right?

What code?

awsdert commented 4 months ago

Current handling of sprites is a mess. There's 3 equally broken export modes. I didn't write code for any of them and cannot contact the authors

ds5678 commented 4 months ago

So you're asking me to keep unmaintainable code before you even see the results of this change?

awsdert commented 4 months ago

Only until you have outputs other than *.unreadable being produced. Since once those outputs exist I'll have some way of getting the sprites I need that doesn't involve old broken code.

ds5678 commented 4 months ago

*.unreadable being produced

That has nothing to do with this issue. That's an asset reading problem.

awsdert commented 4 months ago

I thought that was the result of disabling the old code, if it's possible to do could you compile an upto date version with the code enabled to see if it'll read those assets for me? Because I remember in an older version of AR I was able to see those sprites in app and even export them.

ds5678 commented 4 months ago

No code has been disabled.

awsdert commented 4 months ago

Oh, darn. In that case is there already an issue about *.unreadable assets that I can add my issue to or will I have to make a new thread for it?

ds5678 commented 4 months ago

Make a new issue.

awsdert commented 4 months ago

Done: #1417