2#include <Threedim/TinyObj.hpp>
3#include <Threedim/TransformHelper.hpp>
4#include <halp/controls.hpp>
5#include <halp/file_port.hpp>
6#include <halp/meta.hpp>
8#include <ossia/dataflow/geometry_port.hpp>
10#include <Gfx/Graph/GpuResourceRegistry.hpp>
12#include <score_plugin_threedim_export.h>
17class QRhiResourceUpdateBatch;
42 using ParseFn = std::shared_ptr<const ossia::scene_state> (*)(
43 const halp::text_file_view&);
48 static void register_parser(std::string_view extension, ParseFn fn);
51 static ParseFn lookup(std::string_view extension_lower)
noexcept;
77 halp_meta(name,
"Asset Loader")
78 halp_meta(category,
"Visuals/3D")
79 halp_meta(c_name,
"asset_loader")
80 halp_meta(description,
"Load a 3D asset with its scene hierarchy, geometry and available materials and animations.")
81 halp_meta(authors,
"ossia team, ufbx / fastgltf / tinyobj / miniply / vcglib")
84 "https://ossia.io/score-docs/processes/asset-loader.html")
85 halp_meta(uuid,
"2f6a8c41-7d93-4e5b-b1c8-4e3f9a7d2c5b")
89 std::string_view bytes;
90 std::string_view filename;
95 , filename{v.filename}
102 struct asset_t : halp::file_port<"Asset file", asset_file_view>
106 "3D assets (*.fbx *.gltf *.glb *.obj *.ply *.stl *.off "
108 "*.usd *.usda *.usdc *.usdz)");
109 static std::function<void(
AssetLoader&)> process(file_type data);
123 void update(
AssetLoader& n) { n.rebuild_format_state(); }
131 halp_meta(name,
"Scene");
132 ossia::scene_spec scene;
155 std::shared_ptr<const ossia::scene_state> m_parsed_state;
156 std::shared_ptr<const ossia::scene_state> m_overridden_state;
157 std::shared_ptr<const ossia::scene_state> m_wrapped_state;
158 std::string m_cached_format_override;
160 int64_t m_version_counter{0};
165 void rebuild_format_state();
168 ossia::gpu_slot_ref m_xform_ref{};
171 void rebuild_wrapped_state();
Definition AssetLoader.hpp:75
Definition AssetLoader.hpp:40
List of nodes to be rendered to an output.
Definition RenderList.hpp:33
Graphics rendering pipeline for ossia score.
Definition Filter/PreviewWidget.hpp:11
Definition AssetLoader.hpp:88
Definition AssetLoader.hpp:103
Definition AssetLoader.hpp:101
Definition AssetLoader.hpp:128
Definition TransformHelper.hpp:26
Definition TinyObj.hpp:98
Definition TinyObj.hpp:103
Definition TinyObj.hpp:107
Connection between two score::gfx::Port.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:236
Definition GpuResourceRegistry.hpp:84