Skip to content

Commit 9b617a1

Browse files
authored
Merge pull request #1382 from tetov/fix_expected_Array
Fix error in ghpython draw_mesh where an System.Array was expected
2 parents ebaaa77 + 6de0bbe commit 9b617a1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
### Changed
1313

1414
* Fixed args for `SceneObject` on Grasshopper `Draw` component.
15+
* Replaced use of `Rhino.Geometry.VertexColors.SetColors` with a for loop and `SetColor` in `compas_ghpyton` since the former requires a `System.Array`.
1516

1617
### Removed
1718

@@ -31,7 +32,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3132

3233
### Removed
3334

34-
3535
## [2.4.0] 2024-08-22
3636

3737
### Added

src/compas_ghpython/drawing.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,10 @@ def draw_mesh(vertices, faces, color=None, vertex_normals=None, texture_coordina
373373

374374
if color:
375375
count = len(mesh.Vertices)
376-
colors = [rs.coercecolor(color) for i in range(count)]
377-
mesh.VertexColors.SetColors(colors)
376+
color = rs.CreateColor(color)
377+
378+
for i in range(count):
379+
mesh.VertexColors.SetColor(i, color.R, color.G, color.B)
378380

379381
return mesh
380382

0 commit comments

Comments
 (0)