How to set the world positions of bones from other meshes' world positions?

I have a SkinnedMesh and I want to set the positions of its bones from other meshes’ world positions (children of scene). The grey cubes on the screenshot are placed at the bones’ world positions (by calling bone.getWorldPosition(receptorVector)), I want to then move any cube and set the corresponding bone’s world position to the cube’s new world position (maybe this would require setting the rotation too).