This might be a misunderstanding on my part, but from the comments in Transform.attach, it seems like local positions (and maybe rotation) are always transformed so that the PositionWorld is kept. In the following example, I make a simple tree, where I expect the PositionWorld of device to be (3, 3, 3):
base = Transform("base")
room = Transform("room", position=(1, 1, 1))
device = Transform("device", position=(2, 2, 2))
base.attach(room)
room.attach(device)
base.printTree()
for item, index, depth in base.layout():
print(f"{item.Position} {item.PositionWorld} {item.Name}")
However, the Position of device has changed and now its PositionWorld is (2, 2, 2):
base
+- room
+- device
vec3( 0, 0, 0 ) vec3( 0, 0, 0 ) base
vec3( 1, 1, 1 ) vec3( 1, 1, 1 ) room
vec3( 1, 1, 1 ) vec3( 2, 2, 2 ) device
This seems to be related to attaching, even without keep set, because if I set Position after attaching, the result is as expected:
...
base.attach(room)
room.attach(device)
device.Position = (2, 2, 2)
...
+- room
+- device
vec3( 0, 0, 0 ) vec3( 0, 0, 0 ) base
vec3( 1, 1, 1 ) vec3( 1, 1, 1 ) room
vec3( 2, 2, 2 ) vec3( 3, 3, 3 ) device
Is this the expected behavior? The logic in attach makes sense, so I'm not quite sure why this happens.