Skip to content

Commit 345f4e3

Browse files
authored
Merge branch 'main' into no_support_package
2 parents 8b8702c + ef645f7 commit 345f4e3

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

CHANGELOG.md

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

1212
### Changed
1313

14+
* Fixed bug in `RobotModelObject` caused by non-existent `compas_rhino.rs`. Replaced with `import rhinoscriptsyntax as rs`.
1415
* Allow no `support_package` in `LocalPackageMeshLoader`
1516

1617
### Removed

src/compas_robots/rhino/scene/robotmodelobject.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,22 @@ def create_geometry(self, geometry, name=None, color=None):
9090
return mesh
9191

9292
def _enter_layer(self):
93+
import rhinoscriptsyntax as rs # type: ignore
94+
9395
self._previous_layer = None
9496

9597
if self.layer:
96-
if not compas_rhino.rs.IsLayer(self.layer):
98+
if not rs.IsLayer(self.layer):
9799
compas_rhino.create_layers_from_path(self.layer)
98-
self._previous_layer = compas_rhino.rs.CurrentLayer(self.layer)
100+
self._previous_layer = rs.CurrentLayer(self.layer)
99101

100-
compas_rhino.rs.EnableRedraw(False)
102+
rs.EnableRedraw(False)
101103

102104
def _exit_layer(self):
105+
import rhinoscriptsyntax as rs # type: ignore
106+
103107
if self.layer and self._previous_layer:
104-
compas_rhino.rs.CurrentLayer(self._previous_layer)
108+
rs.CurrentLayer(self._previous_layer)
105109

106110
self.redraw()
107111

@@ -190,11 +194,13 @@ def redraw(self, timeout=None):
190194
None
191195
192196
"""
197+
import rhinoscriptsyntax as rs # type: ignore
198+
193199
if timeout:
194200
time.sleep(timeout)
195201

196-
compas_rhino.rs.EnableRedraw(True)
197-
compas_rhino.rs.Redraw()
202+
rs.EnableRedraw(True)
203+
rs.Redraw()
198204

199205
def clear_layer(self):
200206
"""Clear the main layer of the scene object.

0 commit comments

Comments
 (0)