-
Notifications
You must be signed in to change notification settings - Fork 261
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
Don't make top-level spaces their own children #1100
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f87f7fa
Don't make top-level spaces their own children
jleibs 5e41501
Allow view coordinates to be logged at the root
jleibs 9849d13
Merge remote-tracking branch 'origin/main' into jleibs/root_transform…
Wumpf b5f6506
Reintroduce https://github.com/rerun-io/rerun/pull/1097
Wumpf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -443,9 +443,8 @@ fn log_transform( | |
timeless: bool, | ||
) -> PyResult<()> { | ||
let entity_path = parse_entity_path(entity_path)?; | ||
if entity_path.len() == 1 { | ||
// Stop people from logging a transform to a root-entity, such as "world" (which doesn't have a parent). | ||
return Err(PyTypeError::new_err("Transforms are between a child entity and its parent, so root entities cannot have transforms")); | ||
if entity_path.is_root() { | ||
return Err(PyTypeError::new_err("Transforms are between a child entity and its parent, so the root cannot have a transform")); | ||
} | ||
let mut session = global_session(); | ||
let time_point = time(timeless); | ||
|
@@ -517,16 +516,22 @@ fn log_view_coordinates_up_handedness( | |
} | ||
|
||
fn log_view_coordinates( | ||
entity_path: &str, | ||
entity_path_str: &str, | ||
coordinates: ViewCoordinates, | ||
timeless: bool, | ||
) -> PyResult<()> { | ||
if coordinates.handedness() == Some(coordinates::Handedness::Left) { | ||
re_log::warn_once!("Left-handed coordinate systems are not yet fully supported by Rerun"); | ||
} | ||
|
||
// We normally disallow logging to root, but we make an exception for view_coordinates | ||
let entity_path = if entity_path_str == "/" { | ||
EntityPath::root() | ||
} else { | ||
parse_entity_path(entity_path_str)? | ||
}; | ||
Comment on lines
+527
to
+532
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. didn't think of this whole thing at all :O |
||
|
||
let mut session = global_session(); | ||
let entity_path = parse_entity_path(entity_path)?; | ||
let time_point = time(timeless); | ||
|
||
// We currently log view coordinates from inside the bridge because the code | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
ahh I didn't consider that add_children adds to the parent!
Hmm almost wondering now if we should instead do this loop on the root only (instead of having nested loops on children of children of root) plus having
add_children
something like this internally:does that make sense?
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.
Yeah, I was thinking the same thing but was trying to keep the fix small.