-
Notifications
You must be signed in to change notification settings - Fork 376
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
Introduce API for setting view defaults from python #6545
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love how little code this last bit now is to wire things up!
"List of default components or component batches to add to the space view. When an archetype | ||
in the view is missing a component included in this set, the value of default will be used | ||
instead of the normal fallback for the visualizer.".to_owned(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we handling batches for default correctly already? The way things are set up I expect it to just work but did you get around to testing that?
E.g. setting several colors for color default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested -- works perfectly.
import rerun as rr
import rerun.blueprint as rrb
from numpy.random import default_rng
rr.init("rerun_example_points3d_random", spawn=True)
rng = default_rng(12345)
positions = rng.uniform(-5, 5, size=[10, 3])
colors = rng.uniform(0, 255, size=[10, 3])
radii = rng.uniform(0, 1, size=[10])
rr.send_blueprint(
rrb.Vertical(
rrb.Spatial3DView(defaults=[rr.components.Color([255, 255, 0])]),
rrb.Spatial3DView(defaults=[rr.components.ColorBatch(colors)]),
)
)
rr.log("random", rr.Points3D(positions, radii=radii))
5079e17
to
5a963a7
Compare
What
Just a bit of plumbing to write all the provided defaults to the correct location in the blueprint.
Checklist
main
build: rerun.io/viewernightly
build: rerun.io/viewerTo run all checks from
main
, comment on the PR with@rerun-bot full-check
.