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

Replace OutOfTreeTransform3D (encapsulating full transform) with OutOfTreeTransform (a bool component) #295

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace rerun.archetypes;
/// \example archetypes/asset3d_simple title="Simple 3D asset" image="https://static.rerun.io/asset3d_simple/af238578188d3fd0de3e330212120e2842a8ddb2/1200w.png"
/// \example archetypes/asset3d_out_of_tree !api title="3D asset with out-of-tree transform"
table Asset3D (
"attr.rust.derive": "PartialEq",
"attr.rust.derive": "PartialEq, Eq",
"attr.docs.category": "Spatial 3D",
"attr.docs.view_types": "Spatial3DView, Spatial2DView: if logged above active projection"
) {
Expand All @@ -34,8 +34,8 @@ table Asset3D (

// --- Optional ---

/// An out-of-tree transform.
/// If enabled, any transform (components part of the [archetypes.Transform3D] archetype) on this entity will not affect its children.
///
/// Applies a transformation to the asset itself without impacting its children.
transform: rerun.components.OutOfTreeTransform3D ("attr.rerun.component_optional", nullable, order: 3000);
/// It will however, still be affected by transforms on its parents.
out_of_tree_transform: rerun.components.OutOfTreeTransform ("attr.rerun.component_optional", nullable, order: 3000);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace rerun.archetypes;
///
/// This archetype is for ellipsoids or spheres whose size is a key part of the data
/// (e.g. a bounding sphere).
/// For points whose radii are for the sake of visualization, use `Points3D` instead.
/// For points whose radii are for the sake of visualization, use [archetypes.Points3D] instead.
///
/// Currently, ellipsoids are always rendered as wireframes.
/// Opaque and transparent rendering will be supported later.
Expand Down Expand Up @@ -53,7 +53,7 @@ table Ellipsoids (
/// Optional text labels for the ellipsoids.
labels: [rerun.components.Text] ("attr.rerun.component_optional", nullable, order: 3200);

/// Optional `ClassId`s for the ellipsoids.
/// Optional [components.ClassId]s for the ellipsoids.
///
/// The class ID provides colors and labels if not specified explicitly.
class_ids: [rerun.components.ClassId] ("attr.rerun.component_optional", nullable, order: 3300);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,20 @@ namespace rerun.archetypes;
///
/// Each transform component can be listed multiple times, but transform tree propagation is only possible
/// if there's only one instance for each transform component.
/// TODO(#6831): write more about the exact interaction with the to be written `OutOfTreeTransform` component.
/// However, support for arrays of transform components depends on the visualizer/archetype
/// and many only support a single instance of each transform component.
/// To force disabling transform propagation ("out of tree transformation"), use the [components.OutOfTreeTransform] component.
///
/// \example archetypes/transform3d_simple title="Variety of 3D transforms" image="https://static.rerun.io/transform3d_simple/141368b07360ce3fcb1553079258ae3f42bdb9ac/1200w.png"
/// \example archetypes/transform3d_hierarchy title="Transform hierarchy" image="https://static.rerun.io/transform_hierarchy/cb7be7a5a31fcb2efc02ba38e434849248f87554/1200w.png"
// TODO(#6831): provide example with out of tree transform.
table Transform3D (
"attr.rust.derive": "Default, PartialEq",
"attr.rust.generate_field_info",
"attr.docs.category": "Spatial 3D",
"attr.docs.view_types": "Spatial3DView, Spatial2DView: if logged above active projection"
) {
// --- transform components

/// Translation vectors.
translation: [rerun.components.Translation3D] ("attr.rerun.component_optional", nullable, order: 1100);

Expand Down
2 changes: 1 addition & 1 deletion crates/store/re_types/definitions/rerun/components.fbs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace rerun.components;

/// If out of tree transform is enabled, a transform does not participate in the transform hierarchy.
///
/// This means transforms on this entity do not affect children.
/// It will however, still be affected by transforms on its parents.
///
/// This is automatically enabled if any of the transform components are present multiple times.
/// Setting this to false for a transform that has multiple instances of the same transform component,
/// will result in an error.
struct OutOfTreeTransform (
"attr.docs.unreleased",
"attr.rust.derive": "Default, PartialEq, Eq, Copy"
) {
/// Whether the out of tree transform mode is enabled.
enabled: rerun.datatypes.Bool (order: 100);
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ enum TransformRelation: byte (
) {
/// The transform describes how to transform into the parent entity's space.
///
/// E.g. a translation of (0, 1, 0) with this `TransformRelation` logged at `parent/child` means
/// E.g. a translation of (0, 1, 0) with this [components.TransformRelation] logged at `parent/child` means
/// that from the point of view of `parent`, `parent/child` is translated 1 unit along `parent`'s Y axis.
/// From perspective of `parent/child`, the `parent` entity is translated -1 unit along `parent/child`'s Y axis.
ParentFromChild(default),

/// The transform describes how to transform into the child entity's space.
///
/// E.g. a translation of (0, 1, 0) with this `TransformRelation` logged at `parent/child` means
/// E.g. a translation of (0, 1, 0) with this [components.TransformRelation] logged at `parent/child` means
/// that from the point of view of `parent`, `parent/child` is translated -1 unit along `parent`'s Y axis.
/// From perspective of `parent/child`, the `parent` entity is translated 1 unit along `parent/child`'s Y axis.
ChildFromParent,
Expand Down
40 changes: 20 additions & 20 deletions crates/store/re_types/src/archetypes/asset3d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/store/re_types/src/archetypes/asset3d_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Asset3D {
Self {
blob: contents.into(),
media_type,
transform: None,
out_of_tree_transform: None,
}
}
}
6 changes: 3 additions & 3 deletions crates/store/re_types/src/archetypes/ellipsoids.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion crates/store/re_types/src/archetypes/transform3d.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/store/re_types/src/components/.gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions crates/store/re_types/src/components/mod.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading