MCprep icon indicating copy to clipboard operation
MCprep copied to clipboard

Rig file texture migration

Open StandingPadAnimations opened this issue 6 months ago • 3 comments

With #656, we no longer need to distribute MCprep with the base Minecraft resource pack. However, #656 doesn't yet apply to rigs (currently working on it, but it's not a blocker and thus could be done in a separate PR). Thus, while a good majority of Mojang copyrighted material can be removed (which has been a gray area in terms of GPL compatibility), we would still have some in rigs.

I've created a basic process below on how we might be able to migrate rigs:

  1. Gather image texture names with bbatch
  2. Find files from image texture names (i.e. given a random image texture, find it in what would be the base resource pack once the user has refreshed resources)
  3. Remove texture (and add clear notice to end users in files on why textures aren't included)
  4. Apply that as a property to armatures
  5. When spawning mobs, the spawner should check if said property exists
  6. Add texture from the path specified in the property, if it exists
  7. User can then decide to pack it with their scene (Graphical version below)

Graph of migration process

Once done, this would mean we can distribute MCprep without any Mojang assets at all (which again is a bit of a gray area).

StandingPadAnimations avatar Jun 13 '25 05:06 StandingPadAnimations

As an aside, I've already done steps 1 and 2 locally. Step 3 might be a bit long as we can't fully automate the process (and some rigs have different file names for textures, so I have to manually inspect them anyway), but at least we got the paths out the way.

Note that all rigs would be edited in 2.83, as that's the new minimum version for MCprep.

I've also set the milestone as MCprep 4.0, but ideally this should be done much earlier.

StandingPadAnimations avatar Jun 13 '25 05:06 StandingPadAnimations

Tagging @TheDuckCow

StandingPadAnimations avatar Jun 13 '25 05:06 StandingPadAnimations

2 things as I start to further work on this:

  1. Some rigs use very old textures no longer provided in the game files (such as the villager). Should we exclude these or perhaps do some sort of "legacy texture ripping" where we grab the textues from an older version of the game?
    • Alternately, we could perhaps provide a separate download (to avoid issues the GPL with distributing MC textures in the base addon) and make an "asset install" feature.
  2. We need some way to remove facial information from textures in a way that A. doesn't rely having even a portion of the MC textures and B. is easy to do. Maybe we can do this through some sort of texture similar to a normal map but instead defines what to replace pixels with based on neighboring pixels. Or perhaps we could go even simpler and average neighboring pixels entirely for a set mask

StandingPadAnimations avatar Jun 16 '25 23:06 StandingPadAnimations