Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added No Render Option and Fixed Internal Visualizer Colors #302

Merged
merged 1 commit into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/scenic/core/object_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,7 @@
"occluding": True,
"showVisibleRegion": False,
"color": None,
"render": True,
"velocity": PropertyDefault((), {"dynamic"}, lambda self: Vector(0, 0, 0)),
"speed": PropertyDefault((), {"dynamic"}, lambda self: 0),
"angularVelocity": PropertyDefault((), {"dynamic"}, lambda self: Vector(0, 0, 0)),
Expand Down Expand Up @@ -1550,6 +1551,9 @@
if needsSampling(self):
raise RuntimeError("tried to show() symbolic Object")

if not self.render:
return

Check warning on line 1555 in src/scenic/core/object_types.py

View check run for this annotation

Codecov / codecov/patch

src/scenic/core/object_types.py#L1554-L1555

Added lines #L1554 - L1555 were not covered by tests

# Render the object
object_mesh = self.occupiedSpace.mesh.copy()

Expand All @@ -1564,7 +1568,12 @@
else:
assert False

object_mesh.visual.face_colors = [255 * r, 255 * g, 255 * b, 255 * a]
object_mesh.visual.face_colors = [

Check warning on line 1571 in src/scenic/core/object_types.py

View check run for this annotation

Codecov / codecov/patch

src/scenic/core/object_types.py#L1571

Added line #L1571 was not covered by tests
int(255 * r),
int(255 * g),
int(255 * b),
int(255 * a),
]

viewer.add_geometry(object_mesh)

Expand Down
2 changes: 1 addition & 1 deletion src/scenic/simulators/webots/model.scenic
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class Hill(Terrain):

height: 1
spread: 0.25
color: (0,0,0,0)
render: False

def heightAtOffset(self, offset):
dx, dy, _ = offset
Expand Down
Loading