Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.8] Dynamic Joining of Model Files [Solved-Not Recomended]


ShetiPhian
 Share

Recommended Posts

I'm so frustrated and mentally exhausted am not sure what I type here will make since.  :-\

 

My block has a few base models and several overlay models.

Before 1.8 I rendered the needed base, then rendered the needed overlay on top.

 

I have my json files build for both the bases and overlays, and tested (by directly setting them in the blockstate json, they load correctly).

My blocks BlockStates are correctly functioning.

 

I'm just down to rendering, but everything so far has failed.

 

I'm trying to read two json model files, and create a merged model from them, that I then can register to a blockstate.

 

I'm back to a blank slate.

 

Currently in ModelBakeEvent, I've grabbed all my base & overlays as ModelBlock.

 

 

 

EDIT:

Looks like I just needed a break ;)

 

Not sure if there is a better way but I did get it working.

 

 

Summery:

TextureStitchEvent.Pre

- Read json files to ModleBlock's

- Set parents for ModelBlocks's

- Read textures from ModelBlocks's and register for stitching

 

ModelBakeEvent

- Generate ModelResourceLocation

- Grab and bake needed base model and overlay model

- Merge models, new SimpleBakedModel based on base model with GeneralQuads and FaceQuads copied from both base and overlay

- Register to ModelRegistry

 

 

Edit2:

After further testing this method is not recommended.

It is much slower then having Minecraft load models listed the BlockState jsons.

 

While this would be useful for a large amount of possible combinations the ~2sec load time per model ends up being a significant delay and with few combinations there is no point in not using json files.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.