Skip to content

Commit 2396b9c

Browse files
committed
new: serialize/deserialize meshes on mesh descriptors
1 parent 80950ae commit 2396b9c

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
* Added optional `triangulated` flag to `Mesh.to_vertices_and_faces`.
13+
* Added geometry information of active meshes to the serialization/deserialization of robot model's `MeshDescriptor`.
1314

1415
### Changed
1516

src/compas/robots/model/geometry.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,15 @@ def data(self):
173173
'filename': self.filename,
174174
'scale': self.scale,
175175
'attr': _attr_to_data(self.attr),
176+
'meshes': [m.data for m in self.meshes],
176177
}
177178

178179
@data.setter
179180
def data(self, data):
180181
self.filename = data['filename']
181182
self.scale = data['scale']
182183
self.attr = _attr_from_data(data['attr']) if 'attr' in data else {}
184+
self.meshes = [Mesh.from_data(md) for md in data['meshes']] if 'meshes' in data else []
183185

184186
@classmethod
185187
def from_data(cls, data):

0 commit comments

Comments
 (0)