Custom Item Model Transformation and Depth #3125
Replies: 2 comments 2 replies
-
You'll need to override |
Beta Was this translation helpful? Give feedback.
-
For anyone looking at this later. Luckily there is a ItemModelGenerator class, that can be paired with a little functionality of the ModelLoader class to get the desired result. I'm too lazy to try and fix the code above, but I'll give some code to point people in the right direction.
For this to work you will also have to have dummy implementations for Baker. . . There are also some local variables I'm just assuming you'll figured out. Note: from what I can tell, fabric ( and several mods I've torn apart ) all make sure to implement some kind of cache in this process to avoid re-creating BakedModels for the same items twice. So it's highly suggested you make some kind of cache as well to avoid making these over and over again. Lastly, answering the specific question here. . . from the sounds of things you want to render the armor, and render a trim sprite over top. . . |
Beta Was this translation helpful? Give feedback.
-
Description
I am trying to generate custom item models for armour such that I can render the trims on top of them for any colour, thus, I am using a custom model for "generating" the texture via
FabricBakedModel#emitItemQuads
However, the model appears different to what I expect when rendered in the world / in the player's hands as the vanilla model:Actual:
Video: https://github.com/FabricMC/fabric/assets/18416784/474e20f7-8a1a-44c5-86e8-8406feeef61c
Expected:
Video: https://github.com/FabricMC/fabric/assets/18416784/5978f04a-6883-4663-a7cc-11d58a7a6e09
== Model Class ==
Any help would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions