sp614x / optifine

1.81k stars 416 forks source link

[Suggestion] Modular Item Models? #2573

Open rayblon opened 5 years ago

rayblon commented 5 years ago

So, we get custom item models already, but I'm hoping that we might be able to also have it able to load in multiple models/alterations at once.

Say you have a dynamic sword crafting system where you can forge different blades, crossguards, pommels, and so on. Usually that would mean creating a 3D model for each individual combination, but with modular item models, you'd be able to make a small collection of models that fit into hundreds of different combinations, by loading in each of the individual crossguard, blade, and pommel models that apply at once.

Granted, this is mostly for the benefit of servers, map makers, and maybe modders, but giving us the framework for a level of customization like that would be incredible.

sp614x commented 5 years ago

Combining parts to make a custom sword is game mechanics. Changing the game mechanics is out of the OptiFine's scope.

rayblon commented 5 years ago

Combining parts to make a custom sword is game mechanics. Changing the game mechanics is out of the OptiFine's scope.

Oh no, I mean the crafting system in the context of a server or map, not optifine. Sorry for any confusion there. The 'crafting' is just for the sake of example and how it might be used.

The suggestion just uses the swords example to explain the idea of mixing and matching multiple 3D model parts together -- hence modular models. Right now, you can't call the models crossguard1.json, blade2.json and pommel3.json onto the same item at once; you can only apply one model at any given time. As a resource pack maker, you'd have to combine these 3d models manually and create a predefined model for each combination you want to support in the pack, in the event of custom crafting.

sp614x commented 5 years ago

Custom Items could be extended to allow several replacements models: https://github.com/sp614x/optifine/blob/master/OptiFineDoc/doc/cit_single.properties#L62

The models could be merged together with the first model controlling ao/transforms/overrides.