trimesh
trimesh copied to clipboard
`node_data` not preserved during `append_scenes()`
I'm not sure if this is expected behavior:
import trimesh
# create two scenes and add info to node_data
s = trimesh.Scene()
s.graph.update(frame_from='world', frame_to='foo')
s.graph.transforms.node_data['foo'].update({'upsi': 'foo'})
print(s.graph.transforms.node_data)
# defaultdict(<class 'dict'>, {'world': {}, 'foo': {'upsi': 'foo'}})
s2 = trimesh.Scene()
s2.graph.update(frame_from='world', frame_to='bar')
s2.graph.transforms.node_data['bar'].update({'upsi': 'bar'})
print(s.graph.transforms.node_data)
# defaultdict(<class 'dict'>, {'world': {}, 'bar': {'upsi': 'bar'}})
# append both
result = trimesh.scene.scene.append_scenes([s, s2])
print(result.graph.transforms.node_data)
# this results in loosing the 'upsi' information:
# defaultdict(<class 'dict'>, {'world': {}, 'foo': {}, 'bar': {}})
If this is expected, what's the recommended way to store node-specific data?
It looks like preserving node data just isn't implemented in append_scenes, PR's welcome! Seems like it would be reasonable to do something like combined.update(node_data) for every node during append?