From f8ff7659bb98ed43a34f90db656256720a01f65b Mon Sep 17 00:00:00 2001 From: EtaLoop Date: Thu, 3 Oct 2024 15:50:22 +0200 Subject: [PATCH] Specify interactions between albedo_factor and existing materials --- .../store/re_types/definitions/rerun/archetypes/asset3d.fbs | 3 +++ crates/store/re_types/src/archetypes/asset3d.rs | 3 +++ crates/viewer/re_viewer/src/reflection/mod.rs | 4 ++-- rerun_cpp/src/rerun/archetypes/asset3d.hpp | 6 ++++++ rerun_py/rerun_sdk/rerun/archetypes/asset3d.py | 3 +++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/crates/store/re_types/definitions/rerun/archetypes/asset3d.fbs b/crates/store/re_types/definitions/rerun/archetypes/asset3d.fbs index a20c7aec601a..bb7d26ce3816 100644 --- a/crates/store/re_types/definitions/rerun/archetypes/asset3d.fbs +++ b/crates/store/re_types/definitions/rerun/archetypes/asset3d.fbs @@ -37,5 +37,8 @@ table Asset3D ( // --- Optional --- /// A color multiplier applied to the whole asset. + /// + /// For mesh who already have albedo_factor in materials, + /// it will be overwritten by actual albedo_factor of Asset3D (if specified). albedo_factor: rerun.components.AlbedoFactor ("attr.rerun.component_optional", nullable, order: 3100); } diff --git a/crates/store/re_types/src/archetypes/asset3d.rs b/crates/store/re_types/src/archetypes/asset3d.rs index c4c86d4edf6a..f0eab8649d4c 100644 --- a/crates/store/re_types/src/archetypes/asset3d.rs +++ b/crates/store/re_types/src/archetypes/asset3d.rs @@ -265,6 +265,9 @@ impl Asset3D { } /// A color multiplier applied to the whole asset. + /// + /// For mesh who already have albedo_factor in materials, + /// it will be overwritten by actual albedo_factor of Asset3D (if specified). #[inline] pub fn with_albedo_factor( mut self, diff --git a/crates/viewer/re_viewer/src/reflection/mod.rs b/crates/viewer/re_viewer/src/reflection/mod.rs index 8742dfe6487c..ac51d680ae41 100644 --- a/crates/viewer/re_viewer/src/reflection/mod.rs +++ b/crates/viewer/re_viewer/src/reflection/mod.rs @@ -804,8 +804,8 @@ fn generate_archetype_reflection() -> ArchetypeReflectionMap { is_required : false, }, ArchetypeFieldReflection { component_name : "rerun.components.AlbedoFactor".into(), display_name : "Albedo factor", docstring_md : - "A color multiplier applied to the whole asset.", is_required : - false, }, + "A color multiplier applied to the whole asset.\n\nFor mesh who already have albedo_factor in materials,\nit will be overwritten by actual albedo_factor of Asset3D (if specified).", + is_required : false, }, ], }, ), diff --git a/rerun_cpp/src/rerun/archetypes/asset3d.hpp b/rerun_cpp/src/rerun/archetypes/asset3d.hpp index 7a854ab61b17..33442f36f97d 100644 --- a/rerun_cpp/src/rerun/archetypes/asset3d.hpp +++ b/rerun_cpp/src/rerun/archetypes/asset3d.hpp @@ -68,6 +68,9 @@ namespace rerun::archetypes { std::optional media_type; /// A color multiplier applied to the whole asset. + /// + /// For mesh who already have albedo_factor in materials, + /// it will be overwritten by actual albedo_factor of Asset3D (if specified). std::optional albedo_factor; public: @@ -124,6 +127,9 @@ namespace rerun::archetypes { } /// A color multiplier applied to the whole asset. + /// + /// For mesh who already have albedo_factor in materials, + /// it will be overwritten by actual albedo_factor of Asset3D (if specified). Asset3D with_albedo_factor(rerun::components::AlbedoFactor _albedo_factor) && { albedo_factor = std::move(_albedo_factor); // See: https://github.com/rerun-io/rerun/issues/4027 diff --git a/rerun_py/rerun_sdk/rerun/archetypes/asset3d.py b/rerun_py/rerun_sdk/rerun/archetypes/asset3d.py index ef0845415bea..cf887f3d6dd0 100644 --- a/rerun_py/rerun_sdk/rerun/archetypes/asset3d.py +++ b/rerun_py/rerun_sdk/rerun/archetypes/asset3d.py @@ -105,6 +105,9 @@ def _clear(cls) -> Asset3D: ) # A color multiplier applied to the whole asset. # + # For mesh who already have albedo_factor in materials, + # it will be overwritten by actual albedo_factor of Asset3D (if specified). + # # (Docstring intentionally commented out to hide this field from the docs) __str__ = Archetype.__str__