Skip to content

Commit

Permalink
Rename LeafTransforms3D to InstancePoses3D, disable implicit empt…
Browse files Browse the repository at this point in the history
…y component logging for it (rerun-io#7143)

### What

* Fixes rerun-io#7126
* rename
* talk about 'mesh instancing' for the mesh instancing snippet
* disable "log missing as empty" for `InstancePoses3D`

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7143?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7143?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!
* [x] If have noted any breaking changes to the log API in
`CHANGELOG.md` and the migration guide

- [PR Build Summary](https://build.rerun.io/pr/7143)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
  • Loading branch information
Wumpf authored Aug 12, 2024
1 parent b3ff7c4 commit 6133fb4
Show file tree
Hide file tree
Showing 112 changed files with 1,000 additions and 1,085 deletions.
2 changes: 1 addition & 1 deletion crates/store/re_types/definitions/rerun/archetypes.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
Expand Up @@ -6,7 +6,7 @@ namespace rerun.archetypes;
///
/// See also [archetypes.Mesh3D].
///
/// If there are multiple [archetypes.LeafTransforms3D] instances logged to the same entity as a mesh,
/// If there are multiple [archetypes.InstancePoses3D] instances logged to the same entity as a mesh,
/// an instance of the mesh will be drawn for each transform.
///
/// \example archetypes/asset3d_simple title="Simple 3D asset" image="https://static.rerun.io/asset3d_simple/af238578188d3fd0de3e330212120e2842a8ddb2/1200w.png"
Expand Down
16 changes: 8 additions & 8 deletions crates/store/re_types/definitions/rerun/archetypes/boxes3d.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ namespace rerun.archetypes;

/// 3D boxes with half-extents and optional center, rotations, colors etc.
///
/// Note that orienting and placing the box is handled via `[archetypes.LeafTransforms3D]`.
/// Note that orienting and placing the box is handled via `[archetypes.InstancePoses3D]`.
/// Some of its component are repeated here for convenience.
/// If there's more leaf transforms than half sizes, the last half size will be repeated for the remaining transforms.
/// If there's more instance poses than half sizes, the last half size will be repeated for the remaining poses.
///
/// \example archetypes/box3d_simple !api title="Simple 3D boxes" image="https://static.rerun.io/box3d_simple/d6a3f38d2e3360fbacac52bb43e44762635be9c8/1200w.png"
/// \example archetypes/box3d_batch title="Batch of 3D boxes" image="https://static.rerun.io/box3d_batch/6d3e453c3a0201ae42bbae9de941198513535f1d/1200w.png"
Expand All @@ -27,20 +27,20 @@ table Boxes3D (
/// Optional center positions of the boxes.
///
/// If not specified, the centers will be at (0, 0, 0).
/// Note that this uses a [components.LeafTranslation3D] which is also used by [archetypes.LeafTransforms3D].
centers: [rerun.components.LeafTranslation3D] ("attr.rerun.component_recommended", nullable, order: 2000);
/// Note that this uses a [components.PoseTranslation3D] which is also used by [archetypes.InstancePoses3D].
centers: [rerun.components.PoseTranslation3D] ("attr.rerun.component_recommended", nullable, order: 2000);

/// Rotations via axis + angle.
///
/// If no rotation is specified, the axes of the boxes align with the axes of the local coordinate system.
/// Note that this uses a [components.LeafRotationAxisAngle] which is also used by [archetypes.LeafTransforms3D].
rotation_axis_angles: [rerun.components.LeafRotationAxisAngle] ("attr.rerun.component_optional", nullable, order: 2100);
/// Note that this uses a [components.PoseRotationAxisAngle] which is also used by [archetypes.InstancePoses3D].
rotation_axis_angles: [rerun.components.PoseRotationAxisAngle] ("attr.rerun.component_optional", nullable, order: 2100);

/// Rotations via quaternion.
///
/// If no rotation is specified, the axes of the boxes align with the axes of the local coordinate system.
/// Note that this uses a [components.LeafRotationQuat] which is also used by [archetypes.LeafTransforms3D].
quaternions: [rerun.components.LeafRotationQuat] ("attr.rerun.component_optional", nullable, order: 2200);
/// Note that this uses a [components.PoseRotationQuat] which is also used by [archetypes.InstancePoses3D].
quaternions: [rerun.components.PoseRotationQuat] ("attr.rerun.component_optional", nullable, order: 2200);

/// Optional colors for the boxes.
colors: [rerun.components.Color] ("attr.rerun.component_recommended", nullable, order: 2300);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ namespace rerun.archetypes;
/// (e.g. a bounding sphere).
/// For points whose radii are for the sake of visualization, use [archetypes.Points3D] instead.
///
/// Note that orienting and placing the ellipsoids/spheres is handled via `[archetypes.LeafTransforms3D]`.
/// Note that orienting and placing the ellipsoids/spheres is handled via `[archetypes.InstancePoses3D]`.
/// Some of its component are repeated here for convenience.
/// If there's more leaf transforms than half sizes, the last half size will be repeated for the remaining transforms.
/// If there's more instance poses than half sizes, the last half size will be repeated for the remaining poses.
///
/// \example archetypes/ellipsoid_batch !api title="Batch of ellipsoids"
table Ellipsoids3D (
Expand All @@ -33,20 +33,20 @@ table Ellipsoids3D (
/// Optional center positions of the ellipsoids.
///
/// If not specified, the centers will be at (0, 0, 0).
/// Note that this uses a [components.LeafTranslation3D] which is also used by [archetypes.LeafTransforms3D].
centers: [rerun.components.LeafTranslation3D] ("attr.rerun.component_recommended", nullable, order: 2000);
/// Note that this uses a [components.PoseTranslation3D] which is also used by [archetypes.InstancePoses3D].
centers: [rerun.components.PoseTranslation3D] ("attr.rerun.component_recommended", nullable, order: 2000);

/// Rotations via axis + angle.
///
/// If no rotation is specified, the axes of the ellipsoid align with the axes of the local coordinate system.
/// Note that this uses a [components.LeafRotationAxisAngle] which is also used by [archetypes.LeafTransforms3D].
rotation_axis_angles: [rerun.components.LeafRotationAxisAngle] ("attr.rerun.component_optional", nullable, order: 2100);
/// Note that this uses a [components.PoseRotationAxisAngle] which is also used by [archetypes.InstancePoses3D].
rotation_axis_angles: [rerun.components.PoseRotationAxisAngle] ("attr.rerun.component_optional", nullable, order: 2100);

/// Rotations via quaternion.
///
/// If no rotation is specified, the axes of the ellipsoid align with the axes of the local coordinate system.
/// Note that this uses a [components.LeafRotationQuat] which is also used by [archetypes.LeafTransforms3D].
quaternions: [rerun.components.LeafRotationQuat] ("attr.rerun.component_optional", nullable, order: 2200);
/// Note that this uses a [components.PoseRotationQuat] which is also used by [archetypes.InstancePoses3D].
quaternions: [rerun.components.PoseRotationQuat] ("attr.rerun.component_optional", nullable, order: 2200);

/// Optional colors for the ellipsoids.
colors: [rerun.components.Color] ("attr.rerun.component_recommended", nullable, order: 2300);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
namespace rerun.archetypes;


/// One or more transforms between the current entity and its parent. Unlike [archetypes.Transform3D], it is *not* propagated in the transform hierarchy.
///
/// If both [archetypes.InstancePoses3D] and [archetypes.Transform3D] are present,
/// first the tree propagating [archetypes.Transform3D] is applied, then [archetypes.InstancePoses3D].
///
/// Currently, many visualizers support only a single instance transform per entity.
/// Check archetype documentations for details - if not otherwise specified, only the first instance transform is applied.
///
/// From the point of view of the entity's coordinate system,
/// all components are applied in the inverse order they are listed here.
/// E.g. if both a translation and a max3x3 transform are present,
/// the 3x3 matrix is applied first, followed by the translation.
///
/// \example archetypes/instance_pose3d_combined title="Regular & instance transforms in tandem" image="https://static.rerun.io/leaf_transform3d/41674f0082d6de489f8a1cd1583f60f6b5820ddf/1200w.png"
table InstancePoses3D (
"attr.docs.category": "Spatial 3D",
"attr.docs.view_types": "Spatial3DView, Spatial2DView: if logged above active projection",
"attr.rust.derive": " PartialEq",
"attr.rust.generate_field_info"
) {
/// Translation vectors.
translations: [rerun.components.PoseTranslation3D] ("attr.rerun.component_optional", nullable, order: 1100);

/// Rotations via axis + angle.
rotation_axis_angles: [rerun.components.PoseRotationAxisAngle] ("attr.rerun.component_optional", nullable, order: 1200);

/// Rotations via quaternion.
quaternions: [rerun.components.PoseRotationQuat] ("attr.rerun.component_optional", nullable, order: 1300);

/// Scaling factors.
scales: [rerun.components.PoseScale3D] ("attr.rerun.component_optional", nullable, order: 1400);

/// 3x3 transformation matrices.
mat3x3: [rerun.components.PoseTransformMat3x3] ("attr.rerun.component_optional", nullable, order: 1500);

// TODO(andreas): Support TransformRelation?
// TODO(andreas): Support axis_length?
}

This file was deleted.

4 changes: 2 additions & 2 deletions crates/store/re_types/definitions/rerun/archetypes/mesh3d.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ namespace rerun.archetypes;
///
/// See also [archetypes.Asset3D].
///
/// If there are multiple [archetypes.LeafTransforms3D] instances logged to the same entity as a mesh,
/// If there are multiple [archetypes.InstancePoses3D] instances logged to the same entity as a mesh,
/// an instance of the mesh will be drawn for each transform.
///
/// \example archetypes/mesh3d_indexed title="Simple indexed 3D mesh" image="https://static.rerun.io/mesh3d_simple/e1e5fd97265daf0d0bc7b782d862f19086fd6975/1200w.png"
/// \example archetypes/mesh3d_partial_updates !api title="3D mesh with partial updates" image="https://static.rerun.io/mesh3d_partial_updates/a11e4accb0257dcd9531867b7e1d6fd5e3bee5c3/1200w.png"
/// \example archetypes/mesh3d_leaf_transforms3d title="3D mesh with leaf transforms" image="https://static.rerun.io/mesh3d_leaf_transforms3d/c2d0ee033129da53168f5705625a9b033f3a3d61/1200w.png"
/// \example archetypes/mesh3d_instancing title="3D mesh with instancing" image="https://static.rerun.io/mesh3d_leaf_transforms3d/c2d0ee033129da53168f5705625a9b033f3a3d61/1200w.png"
table Mesh3D (
"attr.rust.derive": "PartialEq",
"attr.docs.category": "Spatial 3D",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ table RotationAxisAngle (
}

/// 3D rotation represented by a rotation around a given axis that doesn't propagate in the transform hierarchy.
table LeafRotationAxisAngle (
table PoseRotationAxisAngle (
"attr.docs.unreleased",
"attr.rust.derive": "Default, Copy, PartialEq",
"attr.rust.repr": "transparent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct RotationQuat (
///
/// Note: although the x,y,z,w components of the quaternion will be passed through to the
/// datastore as provided, when used in the Viewer, quaternions will always be normalized.
struct LeafRotationQuat (
struct PoseRotationQuat (
"attr.docs.unreleased",
"attr.rust.derive": "Default, Copy, PartialEq, bytemuck::Pod, bytemuck::Zeroable",
"attr.rust.repr": "transparent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct Scale3D (
/// A scale of 1.0 means no scaling.
/// A scale of 2.0 means doubling the size.
/// Each component scales along the corresponding axis.
struct LeafScale3D (
struct PoseScale3D (
"attr.docs.unreleased",
"attr.rust.derive": "Copy, PartialEq, bytemuck::Pod, bytemuck::Zeroable",
"attr.rust.repr": "transparent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,25 @@ struct TransformMat3x3 (
/// \py However, construction is done from a list of rows, which follows NumPy's convention:
/// \py ```python
/// \py np.testing.assert_array_equal(
/// \py rr.components.LeafTransformMat3x3([1, 2, 3, 4, 5, 6, 7, 8, 9]).flat_columns, np.array([1, 4, 7, 2, 5, 8, 3, 6, 9], dtype=np.float32)
/// \py rr.components.PoseTransformMat3x3([1, 2, 3, 4, 5, 6, 7, 8, 9]).flat_columns, np.array([1, 4, 7, 2, 5, 8, 3, 6, 9], dtype=np.float32)
/// \py )
/// \py np.testing.assert_array_equal(
/// \py rr.components.LeafTransformMat3x3([[1, 2, 3], [4, 5, 6], [7, 8, 9]]).flat_columns,
/// \py rr.components.PoseTransformMat3x3([[1, 2, 3], [4, 5, 6], [7, 8, 9]]).flat_columns,
/// \py np.array([1, 4, 7, 2, 5, 8, 3, 6, 9], dtype=np.float32),
/// \py )
/// \py ```
/// \py If you want to construct a matrix from a list of columns instead, use the named `columns` parameter:
/// \py ```python
/// \py np.testing.assert_array_equal(
/// \py rr.components.LeafTransformMat3x3(columns=[1, 2, 3, 4, 5, 6, 7, 8, 9]).flat_columns,
/// \py rr.components.PoseTransformMat3x3(columns=[1, 2, 3, 4, 5, 6, 7, 8, 9]).flat_columns,
/// \py np.array([1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=np.float32),
/// \py )
/// \py np.testing.assert_array_equal(
/// \py rr.components.LeafTransformMat3x3(columns=[[1, 2, 3], [4, 5, 6], [7, 8, 9]]).flat_columns,
/// \py rr.components.PoseTransformMat3x3(columns=[[1, 2, 3], [4, 5, 6], [7, 8, 9]]).flat_columns,
/// \py np.array([1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=np.float32),
/// \py )
/// \py ```
struct LeafTransformMat3x3 (
struct PoseTransformMat3x3 (
"attr.docs.unreleased",
"attr.rust.derive": "Default, Copy, PartialEq, bytemuck::Pod, bytemuck::Zeroable",
"attr.rust.repr": "transparent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct Translation3D (
}

/// A translation vector in 3D space that doesn't propagate in the transform hierarchy.
struct LeafTranslation3D (
struct PoseTranslation3D (
"attr.docs.unreleased",
"attr.rust.derive": "Default, Copy, PartialEq, bytemuck::Pod, bytemuck::Zeroable",
"attr.rust.repr": "transparent"
Expand Down
2 changes: 1 addition & 1 deletion crates/store/re_types/src/archetypes/.gitattributes

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.rs

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

Loading

0 comments on commit 6133fb4

Please sign in to comment.