From c5edd3a99f0767d8621e6f04fd8b6f16f1c53f0d Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Mon, 4 Mar 2024 17:52:11 +0100 Subject: [PATCH] wip --- .../src/data_loader/loader_external.rs | 3 +++ docs/content/howto/open-any-file.md | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/crates/re_data_source/src/data_loader/loader_external.rs b/crates/re_data_source/src/data_loader/loader_external.rs index 893d21e7749fc..e3592e23363db 100644 --- a/crates/re_data_source/src/data_loader/loader_external.rs +++ b/crates/re_data_source/src/data_loader/loader_external.rs @@ -139,6 +139,9 @@ impl crate::DataLoader for ExternalLoader { re_tracing::profile_function!(exe.to_string_lossy()); let child = Command::new(exe) + // Make sure the child dataloader doesn't think it's a Rerun Viewer, otherwise + // it's never gonna be able to log anything. + .env_remove("RERUN_APP_ONLY") .arg(filepath.clone()) .args(args) .stdout(Stdio::piped()) diff --git a/docs/content/howto/open-any-file.md b/docs/content/howto/open-any-file.md index 8d07bf8149aa5..0f678b971961e 100644 --- a/docs/content/howto/open-any-file.md +++ b/docs/content/howto/open-any-file.md @@ -3,9 +3,9 @@ title: Open any file order: -10 --- -The Rerun Viewer has built-in support for opening many kinds of files, and can be extended to open any other file type without needing to modify the Rerun codebase itself. +The Rerun Viewer and SDK have built-in support for opening many kinds of files, and can be extended to support any other file type without needing to modify the Rerun codebase itself. -The viewer can load files in 3 different ways: +The Viewer can load files in 3 different ways: - via CLI arguments (e.g. `rerun myfile.jpeg`), - using drag-and-drop, - using the open dialog in the Rerun Viewer. @@ -14,9 +14,13 @@ All these file loading methods support loading a single file, many files at once ⚠ Drag-and-drop of folders does [not yet work](https://github.com/rerun-io/rerun/issues/4528) on the web version of the Rerun Viewer ⚠ -The following file types have built-in support in the Rerun Viewer: +As for the SDK, check out the `log_file_from_path` and `log_file_from_contents` methods ([C++](https://ref.rerun.io/docs/cpp/stable/classrerun_1_1RecordingStream.html#SOME_HASH_TBD?speculative-link), [Python](https://ref.rerun.io/docs/python/stable/common/other_classes_and_functions/#rerun.log_file_from_path?speculative-link), [Rust](https://docs.rs/rerun/latest/rerun/struct.RecordingStream.html#method.log_file_from_path)) and the associated example ([C++](https://github.com/rerun-io/rerun/blob/main/examples/cpp/log_file/main.cpp?speculative-link), [Python](https://github.com/rerun-io/rerun/blob/main/examples/python/log_file/main.py?speculative-link), [Rust](https://github.com/rerun-io/rerun/blob/main/examples/rust/log_file/main.rs?speculative-link)). + +Note: when calling these APIs from the SDK, the data will be loaded by the process running the SDK, not the Viewer! + +The following file types have built-in support in the Rerun Viewer and SDK: - Native Rerun files: `rrd` -- 3D models: `gltf`, `glb`, `obj` +- 3D models: `gltf`, `glb`, `obj`, `stl` - Images: `avif`, `bmp`, `dds`, `exr`, `farbfeld`, `ff`, `gif`, `hdr`, `ico`, `jpeg`, `jpg`, `pam`, `pbm`, `pgm`, `png`, `ppm`, `tga`, `tif`, `tiff`, `webp`. - Point clouds: `ply`. - Text files: `md`, `txt`.