Skip to content

Commit

Permalink
Fixed glTF orphan childs (parent them to root node for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasGorisse committed Dec 20, 2023
1 parent 1ef76d2 commit aa8eda5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ open class ModelNode(
nodes.values.forEach { node ->
node.parent = when (val parentEntity = node.parentEntity) {
this.entity -> this
else -> nodes.values.first { it.entity == parentEntity }
else -> nodes.values.firstOrNull { it.entity == parentEntity } ?: this
}
}
if (autoAnimate && animator.animationCount > 0) {
Expand Down

0 comments on commit aa8eda5

Please sign in to comment.