Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/compas-dev/compas
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvanmele committed Sep 9, 2024
2 parents 44b22e8 + 9b617a1 commit 975dc97
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

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

### Removed


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

### Removed


## [2.4.0] 2024-08-22

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def RunScript(self, cg):
if not cg:
return None

return SceneObject(cg).draw()
return SceneObject(item=cg).draw()
6 changes: 4 additions & 2 deletions src/compas_ghpython/drawing.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,10 @@ def draw_mesh(vertices, faces, color=None, vertex_normals=None, texture_coordina

if color:
count = len(mesh.Vertices)
colors = [rs.coercecolor(color) for i in range(count)]
mesh.VertexColors.SetColors(colors)
color = rs.CreateColor(color)

for i in range(count):
mesh.VertexColors.SetColor(i, color.R, color.G, color.B)

return mesh

Expand Down

0 comments on commit 975dc97

Please sign in to comment.