Fix imported Java Entity models exploding when there are multiple nested groups#3627
Open
JoshieGemFinder wants to merge 1 commit into
Open
Fix imported Java Entity models exploding when there are multiple nested groups#3627JoshieGemFinder wants to merge 1 commit into
JoshieGemFinder wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
This pull request fixes a particularly annoying bug that would cause imported modded entity models to "explode" when there were multiple nested model groups.
This was because Blockbench would re-apply the model group transformations multiple times, causing part offsets to get way too big the further they got from the origin.
Additionally, the model would be exploded in different ways depending on the order that cubes, origin points, and children were assigned.
Example
Here's an example of what used to happen to such a model when imported from Java code (pictured model code here; viewed from the default "Isometric Right" angle):

Solution
This pull request fixes that by breaking up the import into two parts:
This fixes the issue with transforms being applied multiple times during an import, as they are all processed at once in the second step.
Example
Here's that same model from earlier, imported with the new code from this pull request (same model as before; viewed from the default "Isometric Right" angle):

This is what the model was originally intended to look like (and how it renders in-game), showing that the bug has been fixed.
Note
Admittedly, I haven't tested this with many models from other versions, but I do not believe it should cause any issues.