Skip to content

Commit 8ef596c

Browse files
committed
Merge remote-tracking branch 'origin/main' into main
2 parents 7565fab + 47d938e commit 8ef596c

File tree

16 files changed

+51
-55
lines changed

16 files changed

+51
-55
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ 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`.
14+
* Added Grasshopper component to draw any COMPAS object.
15+
* Added new icons to Grasshopper components and default to icon style.
1316

1417
### Changed
1518

src/compas/robots/model/geometry.py

Lines changed: 3 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):
@@ -364,6 +366,7 @@ def get_color(self):
364366
('point', 'radius'): compas.geometry.Sphere,
365367
('line', 'radius'): compas.geometry.Capsule,
366368
('attr', 'filename', 'scale'): MeshDescriptor,
369+
('attr', 'filename', 'meshes', 'scale'): MeshDescriptor,
367370
}
368371

369372

src/compas_ghpython/components/Compas_Frame/code.py

Lines changed: 0 additions & 20 deletions
This file was deleted.
-2.69 KB
Binary file not shown.

src/compas_ghpython/components/Compas_Frame/metadata.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/compas_ghpython/components/Compas_FromJson/code.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
class CompasInfo(component):
1010
def RunScript(self, json):
11+
if not json:
12+
return None
13+
1114
try:
1215
return compas.json_load(json)
1316
except: # noqa: E722
-1.73 KB
Loading

src/compas_ghpython/components/Compas_FromJson/metadata.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
"ghpython": {
1010
"isAdvancedMode": true,
11+
"iconDisplay": 2,
1112
"inputParameters": [
1213
{
1314
"name": "json",
-1.44 KB
Loading

src/compas_ghpython/components/Compas_Info/metadata.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
"ghpython": {
1010
"isAdvancedMode": true,
11+
"iconDisplay": 2,
1112
"inputParameters": [
1213
],
1314
"outputParameters": [

0 commit comments

Comments
 (0)