Overhaul Texture_Converter.py and Conversion_Table.csv #4133

Merged
the-real-herowl merged 40 commits from Impulse/MineClone2:texture-conversion-120 into master 2024-01-21 03:25:57 +01:00
Member

This PR updates the conversion tool which converts resource packs from minecraft to mineclone(also supported games, mineclonia, etc) to Support MC 1.20 resource packs, refactors code to be more pythonic and idiomatic.

Tasks:

  • Update Support to MC 1.20
  • Replace getopt argparsing with argparse making it less prone to error and easier to define behavior.
  • Detect Minetest and Minecraft directories based on OS.
  • Support Converting the Default MC texturepack with the --default flag
  • Support converting all MC texturepacks with the --all flag
  • Make a GUI version of the program, written in Tkinter.
  • Split up the codebase into separate files for readability still having the same named script though for ease of use.

Extra (Not needed for merge):

  • Add Debug logging with logging module to most entrypoints.
  • Write a script to create binary for Texture_Converter, for ease of use. for people that don't know how to run python scripts.
  • Replace os.system calls with more pythonic and system indiependent function calls.

Testing:
I go ingame on my server, to see if the textures look right and are matched up correctly.
I also print out the textures that were not converted so know which ones to add next.

This PR updates the conversion tool which converts resource packs from minecraft to mineclone(also supported games, mineclonia, etc) to Support MC 1.20 resource packs, refactors code to be more pythonic and idiomatic. Tasks: - [x] Update Support to MC 1.20 - [x] Replace `getopt` argparsing with `argparse` making it less prone to error and easier to define behavior. - [x] Detect Minetest and Minecraft directories based on OS. - [x] Support Converting the Default MC texturepack with the `--default` flag - [x] Support converting all MC texturepacks with the `--all` flag - [x] Make a GUI version of the program, written in Tkinter. - [x] Split up the codebase into separate files for readability still having the same named script though for ease of use. Extra (Not needed for merge): - [ ] Add Debug logging with `logging` module to most entrypoints. - [ ] Write a script to create binary for Texture_Converter, for ease of use. for people that don't know how to run python scripts. - [ ] Replace `os.system` calls with more pythonic and system indiependent function calls. Testing: I go ingame on my server, to see if the textures look right and are matched up correctly. I also print out the textures that were not converted so know which ones to add next.
Impulse changed title from Update Texture_Converter.py and Conversion_Table.csv to support MC 1.20 to Overhaul Texture_Converter.py and Conversion_Table.csv 2024-01-09 09:21:42 +01:00
Impulse changed title from Overhaul Texture_Converter.py and Conversion_Table.csv to WIP: Overhaul Texture_Converter.py and Conversion_Table.csv 2024-01-09 09:21:44 +01:00
Impulse changed title from WIP: Overhaul Texture_Converter.py and Conversion_Table.csv to Overhaul Texture_Converter.py and Conversion_Table.csv 2024-01-14 13:21:27 +01:00
Author
Member

Its ready to merge, just some minor stuff i wanted to do, like making the conversion platform independent, but i might not have time to do that before the next MCL release. Could you merge this please?

Its ready to merge, just some minor stuff i wanted to do, like making the conversion platform independent, but i might not have time to do that before the next MCL release. Could you merge this please?

Its ready to merge, just some minor stuff i wanted to do, like making the conversion platform independent, but i might not have time to do that before the next MCL release. Could you merge this please?

You may have the time before release, but I don't know if I will have the time to review before release. That's a lot of code!

But if you do have the time, the os-independent code may be the main thing to target.

> Its ready to merge, just some minor stuff i wanted to do, like making the conversion platform independent, but i might not have time to do that before the next MCL release. Could you merge this please? You may have the time before release, but I don't know if I will have the time to review before release. That's a lot of code! But if you do have the time, the os-independent code may be the main thing to target.
Impulse force-pushed texture-conversion-120 from 14eb2ba15b to 033ae2c892 2024-01-15 02:00:14 +01:00 Compare
Impulse force-pushed texture-conversion-120 from 033ae2c892 to 223f7c9fe3 2024-01-15 02:01:51 +01:00 Compare
Author
Member

Its ready to merge, just some minor stuff i wanted to do, like making the conversion platform independent, but i might not have time to do that before the next MCL release. Could you merge this please?

You may have the time before release, but I don't know if I will have the time to review before release. That's a lot of code!

But if you do have the time, the os-independent code may be the main thing to target.

Thanks for the reply, if i get that done, will you try and merge it?
I really want to see it in the next release.

> > Its ready to merge, just some minor stuff i wanted to do, like making the conversion platform independent, but i might not have time to do that before the next MCL release. Could you merge this please? > > You may have the time before release, but I don't know if I will have the time to review before release. That's a lot of code! > > But if you do have the time, the os-independent code may be the main thing to target. Thanks for the reply, if i get that done, will you try and merge it? I really want to see it in the next release.

Its ready to merge, just some minor stuff i wanted to do, like making the conversion platform independent, but i might not have time to do that before the next MCL release. Could you merge this please?

You may have the time before release, but I don't know if I will have the time to review before release. That's a lot of code!

But if you do have the time, the os-independent code may be the main thing to target.

Thanks for the reply, if i get that done, will you try and merge it?
I really want to see it in the next release.

I'll try to review it.

> > > Its ready to merge, just some minor stuff i wanted to do, like making the conversion platform independent, but i might not have time to do that before the next MCL release. Could you merge this please? > > > > You may have the time before release, but I don't know if I will have the time to review before release. That's a lot of code! > > > > But if you do have the time, the os-independent code may be the main thing to target. > > Thanks for the reply, if i get that done, will you try and merge it? > I really want to see it in the next release. I'll try to review it.
Impulse force-pushed texture-conversion-120 from 223f7c9fe3 to 033ae2c892 2024-01-15 14:32:10 +01:00 Compare
Impulse force-pushed texture-conversion-120 from 033ae2c892 to 6b9980c1b8 2024-01-16 16:23:35 +01:00 Compare
Contributor

Haven't really looked much but at a quick glance the textures that stood out quickly are some of the leaves texture that have no transparency.

Here are some that I found:

default_acacia_leaves.png
default_jungleleaves.png
default_leaves.png
flowers_waterlily.png
mcl_core_leaves_big_oak.png
mcl_core_leaves_birch.png
mcl_core_leaves_spruce.png

EDIT:

After a bit more look at it here are some weird textures that I found:

  • Side of doors and trapdoors have different textures
  • Top of chests both trapped and normal and in chest boats too
  • Top of book shelf is different colored wood
  • Top of respawn anchor looks weird especially when charged
  • Top of all variants of non-red sandstone is the side texture
  • Leather armor is grey and looks like iron armor
  • Base of all the anvil variants have black lines at either side
  • Some side of item frames both glowing and normal have different colors
  • Front of shield in 3rd person is white

More textures that have no transparency:

  • Vines
  • Large Fern (Item wield/Inventory)
  • Double Tallgrass (Item wield/Inventory)
  • Fern (Item wield/Inventory)
  • Lily Pad (Both as Item wield/Inventory and when placed as well)

Missing textures:

  • HUD GUI
  • Boss bars
  • Double chests
  • Floating book of Enchanting table
  • Bell
  • Lectern
  • Lime Dye
  • Shield (Item wield/Inventory)
  • Villagers and Zombie Villagers
  • Piglin and Piglin Brute
  • Rail intersections
  • Paintings
  • Horse
  • Vex
  • mcl_signs_default_sign_greyscale.png
  • mcl_signs_sign_greyscale.png
  • mcl_books_book_bg.png
  • mcl_shield_hud.png
  • mcl_farming_pumpkin_face.png
  • mobs_mc_wither_half_health.png

These are most likely not all of it but it's a start.

Used on 1.20.4 textures

Haven't really looked much but at a quick glance the textures that stood out quickly are some of the leaves texture that have no transparency. Here are some that I found: default_acacia_leaves.png default_jungleleaves.png default_leaves.png flowers_waterlily.png mcl_core_leaves_big_oak.png mcl_core_leaves_birch.png mcl_core_leaves_spruce.png EDIT: After a bit more look at it here are some weird textures that I found: - Side of doors and trapdoors have different textures - Top of chests both trapped and normal and in chest boats too - Top of book shelf is different colored wood - Top of respawn anchor looks weird especially when charged - Top of all variants of non-red sandstone is the side texture - Leather armor is grey and looks like iron armor - Base of all the anvil variants have black lines at either side - Some side of item frames both glowing and normal have different colors - Front of shield in 3rd person is white More textures that have no transparency: - Vines - Large Fern (Item wield/Inventory) - Double Tallgrass (Item wield/Inventory) - Fern (Item wield/Inventory) - Lily Pad (Both as Item wield/Inventory and when placed as well) Missing textures: - HUD GUI - Boss bars - Double chests - Floating book of Enchanting table - Bell - Lectern - Lime Dye - Shield (Item wield/Inventory) - Villagers and Zombie Villagers - Piglin and Piglin Brute - Rail intersections - Paintings - Horse - Vex - mcl_signs_default_sign_greyscale.png - mcl_signs_sign_greyscale.png - mcl_books_book_bg.png - mcl_shield_hud.png - mcl_farming_pumpkin_face.png - mobs_mc_wither_half_health.png These are most likely not all of it but it's a start. Used on 1.20.4 textures
Contributor

I think I should reply to this
First, introduction: I encouraged the creation of this PR through my texture pack, and my role here is an advisor + the maintainer of conversion_table.csv (CT), and also I have no python experience and just learned very basic git for this PR here's my first ever PR if you missed it

  • The leaves - and the lily - can be easily implemented in the CT but I think Impulse's reason for using the python script to do it is use MC's default color palette instead of MCL's.

  • (Trap)door sides and top and bottom parts are waiting to be implemented in the python code.

  • The top texture for anvils is apparently 2 pixel wider in MCL (why? 3d model difference? if so, why?), I found a solution through multiplying the outer texture to make it 2 pixels wider.

  • Item frames, MCL's system of texturing these apparently is different from MC's, I wasn't able to implement them (in my pack)

  • The floating enchanting table book doesn't use different textures for the inside and the outside, even though the default MCL texture contains different ones for both.

  • Horses are hard (really, I wasn't able to add even 1 horse even with manual photoshopping)

Now for the interesting part: (suggestions on changing how textures and handled in general)

  • Edit the anvil model.
  • Change 'Big_Oak' to 'Dark_Oak' in the texture names.
  • Make the floating book model use all of its textures properly.

My opinion is that the conversion tool in its current state (at least the CT) is strictly better than the older version, and should be included in 0.87 even with the aforementioned flaws.

I will fix some of these once I manage to fix git (You have divergent branches and need to specify how to reconcile them.)

Edit: Also some textures like some axolotl colors are absent from vanilla MC so we can not implement them.

I think I should reply to this First, introduction: I encouraged the creation of this PR through [my texture pack](https://lemmy.world/post/10323520), and my role here is an advisor + the maintainer of conversion_table.csv (CT), and also I have no python experience and just learned very basic git for this PR [here's my first ever PR if you missed it](https://git.minetest.land/MineClone2/MineClone2/commit/1a67a78f8f5ad3d38a47b9a880c0794503ff54b2) - The leaves - and the lily - can be easily implemented in the CT but I think Impulse's reason for using the python script to do it is use MC's default color palette instead of MCL's. - (Trap)door sides and top and bottom parts are waiting to be implemented in the python code. - The top texture for anvils is apparently 2 pixel wider in MCL (why? 3d model difference? if so, why?), I found a solution through multiplying the outer texture to make it 2 pixels wider. - Item frames, MCL's system of texturing these apparently is different from MC's, I wasn't able to implement them (in my pack) - The floating enchanting table book doesn't use different textures for the inside and the outside, even though the default MCL texture contains different ones for both. - Horses are hard (really, I wasn't able to add even 1 horse even with manual photoshopping) Now for the interesting part: (suggestions on changing how textures and handled in general) - Edit the anvil model. - Change 'Big_Oak' to 'Dark_Oak' in the texture names. - Make the floating book model use all of its textures properly. My opinion is that the conversion tool in its current state (at least the CT) is strictly better than the older version, and should be included in 0.87 even with the aforementioned flaws. I will fix some of these once I manage to fix git (You have divergent branches and need to specify how to reconcile them.) Edit: Also some textures like some axolotl colors are absent from vanilla MC so we can not implement them.
Impulse force-pushed texture-conversion-120 from 6b9980c1b8 to 34bf062bf4 2024-01-20 12:06:03 +01:00 Compare
the-real-herowl added this to the 0.87.0 - Prismatic milestone 2024-01-21 00:16:42 +01:00
the-real-herowl added the
Testing / Retest
tools
labels 2024-01-21 00:30:24 +01:00
the-real-herowl added the
#P4 priority: medium
label 2024-01-21 00:45:24 +01:00
the-real-herowl removed the
Testing / Retest
label 2024-01-21 03:13:18 +01:00
the-real-herowl approved these changes 2024-01-21 03:17:59 +01:00
the-real-herowl left a comment
Owner

This generally works.

GUI could be larger, especially the target folder selection window.

As already mentioned, some things lack from the Conversion Table, this can be expanded later.

The requirements.txt file could make it clearer what the requirements are for (there are more tools than just this in the folder, and placing them in your lib folder still won't be enough, because the main file is not there and most people won't look there), and could use markdown instead, but this can be done later.

Overall, good work! Merging this.

This generally works. GUI could be larger, especially the target folder selection window. As already mentioned, some things lack from the Conversion Table, this can be expanded later. The `requirements.txt` file could make it clearer what the requirements are for (there are more tools than just this in the folder, and placing them in your lib folder still won't be enough, because the main file is not there and most people won't look there), and could use markdown instead, but this can be done later. Overall, good work! Merging this.
the-real-herowl force-pushed texture-conversion-120 from 5ae62f2bb1 to b944a70059 2024-01-21 03:21:19 +01:00 Compare
the-real-herowl merged commit b507838e13 into master 2024-01-21 03:25:57 +01:00
Contributor
  • Horses are hard (really, I wasn't able to add even 1 horse even with manual photoshopping)

The converter previously works for the 1.12 version of the horses if that helps in solving this @Doods

> * Horses are hard (really, I wasn't able to add even 1 horse even with manual photoshopping) The converter previously works for the 1.12 version of the horses if that helps in solving this @Doods
Contributor

So, every texture that was added to MCL follows the same layout MC uses at the time of adding, so converting at that time is just a matter of renaming, and from that I conclude that Mojang completely reworked the layout from scratch sometime after MCL added horses.

Searching the wiki confirms my theory: the 3D model for horses was changed in 1.13 and they no longer open their mouths, which means 1 - MC lacks a mouth texture and 2 - the 3d model is different altogether. (also searching the old script code confirms it was only a renaming process back then)

I appreciate your attempt at helping.

So, every texture that was added to MCL follows the same layout MC uses at the time of adding, so converting at that time is just a matter of renaming, and from that I conclude that Mojang completely reworked the layout from scratch sometime after MCL added horses. Searching the wiki confirms my theory: the 3D model for horses was changed in 1.13 and they no longer open their mouths, which means 1 - MC lacks a mouth texture and 2 - the 3d model is different altogether. (also searching the old script code confirms it was only a renaming process back then) I appreciate your attempt at helping.
Member

So, every texture that was added to MCL follows the same layout MC uses at the time of adding, so converting at that time is just a matter of renaming, and from that I conclude that Mojang completely reworked the layout from scratch sometime after MCL added horses.

Searching the wiki confirms my theory: the 3D model for horses was changed in 1.13 and they no longer open their mouths, which means 1 - MC lacks a mouth texture and 2 - the 3d model is different altogether. (also searching the old script code confirms it was only a renaming process back then)

I appreciate your attempt at helping.

This... hmmn. Horses, like all modeled entities were hand built, and used in mineclone. They do not follow the Minecraft Texture / texturing for their models. And it would be unreasonable to expect that it would. (As that would mean that we sniped their model, and we didn't.)

@Impulse does your texture converter update do textures for entities? (I'm guessing not, but never hurts to ask.)

> So, every texture that was added to MCL follows the same layout MC uses at the time of adding, so converting at that time is just a matter of renaming, and from that I conclude that Mojang completely reworked the layout from scratch sometime after MCL added horses. > > Searching the wiki confirms my theory: the 3D model for horses was changed in 1.13 and they no longer open their mouths, which means 1 - MC lacks a mouth texture and 2 - the 3d model is different altogether. (also searching the old script code confirms it was only a renaming process back then) > > I appreciate your attempt at helping. This... hmmn. Horses, like all modeled entities were hand built, and used in mineclone. They do not follow the Minecraft Texture / texturing for their models. And it would be unreasonable to expect that it would. (As that would mean that we sniped their model, and we didn't.) @Impulse does your texture converter update do textures for entities? (I'm guessing not, but never hurts to ask.)
Contributor

@Michieal the textures for all entities - except horses - roughly follow the same layout MC uses, and copying skeleton.png - for example - and renaming it to mobs_mc_skeleton.png makes the MCL skeleton look identical to MC's, and I also read somewhere, in this repo, that seamless compatibility with copied MC textures was a goal when making textures for MCL.

I know that because I copied the textures for almost every entity from MC when making my pack with no issues, and while some required very basic photoshopping.

The ender dragon literally has the wing texture copied twice in the same PNG and only uses 1 of them, just to look different from MC I persume, and just for the record, it uses the right one while MC has the wing texture on the left.

Saying you sniped the models is an understatement, you seem to have copied them outright for almost everything - except for the trident.

Are the MC models are too basic to be copyrightable? They are either a few pixels in a basic layout (Trident) or something that takes all its shape from the texture (skeletons)

And for question on the script, it mostly renames and copies PNGs as my comment suggests.

And to conclude, I feel this reply is somewhat insulting, so I apologize if you did feel insulted.

@Michieal the textures for all entities - except horses - roughly follow the same layout MC uses, and copying skeleton.png - for example - and renaming it to mobs_mc_skeleton.png makes the MCL skeleton look identical to MC's, and [I also read somewhere, in this repo, that seamless compatibility with copied MC textures was a goal when making textures for MCL](https://git.minetest.land/MineClone2/MineClone2/issues/2784#issuecomment-46478). I know that because I copied the textures for almost every entity from MC when making my pack with no issues, and while some required very basic photoshopping. The ender dragon literally has the wing texture copied twice in the same PNG and only uses 1 of them, just to look different from MC I persume, and just for the record, it uses the right one while MC has the wing texture on the left. Saying you sniped the models is an understatement, you seem to have copied them outright for almost everything - [except for the trident](https://git.minetest.land/MineClone2/MineClone2/issues/2784#issuecomment-46478). Are the MC models are too basic to be copyrightable? They are either a few pixels in a basic layout (Trident) or something that takes all its shape from the texture (skeletons) And for question on the script, it mostly renames and copies PNGs as my comment suggests. And to conclude, I feel this reply is somewhat insulting, so I apologize if you did feel insulted.
Member

@Doods
Actually, Foss was complaining that it wasn't like MC. They really wanted this project to be a 1 to 1 copy of minecraft, and IIRC they got upset a few times when that was not the goal of the project. I mean, there's a reason why a new name is being discussed... And part of that is because as "Mine[craft]clone" everyone expects to have all of the numbers be like the wiki. The demand that nothing else be added, except for what is in MC. (I know, I encountered this when I made the Hamburger food item.)

The models are supposed to be similar, but not copies. We are actually going to be changing things around some so that they are more original.

But yeah, the goal of the project is to emulate gameplay... even if the numbers are "off" -- sometimes they have to be, because of minetest. Also, we're trying to make a good gameplay experience.

And, Initially when I read this it did come across as a bit... yeah... so I took a minute and then came back to this. The MC models are copyrighted. And, because someone blindly allowed in direct rips of MC assets, or recolors, we've had to change things out. And, we couldn't use most of the Pixel Perfection textures.

@Doods Actually, Foss was complaining that it wasn't like MC. They really wanted this project to be a 1 to 1 copy of minecraft, and IIRC they got upset a few times when that was not the goal of the project. I mean, there's a reason why a new name is being discussed... And part of that is because as "Mine[craft]clone" everyone expects to have all of the numbers be like the wiki. The demand that nothing else be added, except for what is in MC. (I know, I encountered this when I made the Hamburger food item.) The models are supposed to be similar, but not copies. We are actually going to be changing things around some so that they are more original. But yeah, the goal of the project is to emulate gameplay... even if the numbers are "off" -- sometimes they have to be, because of minetest. Also, we're trying to make a good gameplay experience. And, Initially when I read this it did come across as a bit... yeah... so I took a minute and then came back to this. The MC models *are* copyrighted. And, because someone blindly allowed in direct rips of MC assets, or recolors, we've had to change things out. And, we couldn't use most of the Pixel Perfection textures.
Sign in to join this conversation.
No reviewers
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: VoxeLibre/VoxeLibre#4133
No description provided.