-
Notifications
You must be signed in to change notification settings - Fork 253
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
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.
I think you also need to readd the reverted 891a5b2 again - when you merge in master, you should find that reverting this prevents logging any transform to top level items
Very happy you took a look at this. I doubt I would have noticed the view_coordinates problem!
@@ -190,7 +190,15 @@ impl SpaceInfoCollection { | |||
.child_spaces | |||
.insert(tree.path.clone(), transform); | |||
|
|||
add_children(entity_db, &mut spaces_info, &mut space_info, tree, &query); | |||
for child_tree in tree.children.values() { |
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:
let transform = query_transform(entity_db, entity_path, &query)
.or_else(|| (entity_path.len() == 1).then(|| Transform::Rigid3(re_log_types::Rigid3::IDENTITY)));
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.
// 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)? | ||
}; |
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.
didn't think of this whole thing at all :O
Now that top-level spaces can have transforms, they were hitting the path of add_children that identifies them as sub-spaces.
This avoids that by only adding children (we've already done the other insertions as appropriate).
Also for updating the transform-3d demo I wanted to log a root-level view_coordinates.
Checklist
CHANGELOG.md
(if this is a big enough change to warrant it)