What I am trying to accomplish is to move a mesh with an arbitrary position, rotation, and scale to become a child of a nested transform node (also with an arbitrary position, rotation, and scale) without the mesh visually changing.
I believe this should happen with setParent() but I am having problems if the parent nodes have scale and rotation/position changes
Reference this Playground: https://playground.babylonjs.com/#JW8W52#9
In the scene you will see a knot with no parent and an arbitrary position, rotation, and scale set.
Pressing 2 will move that knot to become a child of a nested tree of 2 transforms, each with arbitrary positions and rotations. When you press 2, nothing visually changes in the scene, which is what is expected. You can use the inspector to verify that is has been re-parented.
Pressing 1 will move the knot back to have no parent. Again, nothing visually changes in the scene, which is what is expected. You can use the inspector to verify that is has been re-parented to the root.
Pressing 3 will move that knot to become a child of a nested tree of 2 transforms, each with arbitrary scales. When you press 3, nothing visually changes in the scene, which is what is expected. You can use the inspector to verify that is has been re-parented.
Jumping between 1,2, and 3 work fine. There is no visual change to the scene but the knot is indeed moving around in the hierarchy.
Pressing 4 will move that knot to become a child of a nested tree of 2 transforms but this time the transforms have arbitrary positions, rotation, AND scales. You will see a visual change in the knot.
This is not what I expected. Can someone help me understand why this is happening and what I can do to get around it?
Another observation:
I added one more tree (press key 5) where the first node had position and rotation changes, and the second node has scale changes. This one works as expected with no visual changes.
The problems only seems to happen if a transform has rotation changes AND OR position changes AND scale changes