raisin::assimp
namespace
Classes
structAsyncModelLoadResult — Assimp import produced by loadModelSceneAsync(), before GL resources exist.structFallbackMaterial — Material read from an OBJ's sibling .mtl file, used when Assimp provides none.structModelSourceFile — A file a model import read (or looked for), as it was at that point.
Functions
isUsdModelFile
#include <rayrai/AssimpMeshLoader.hpp>
bool isUsdModelFile(const std::string &path)Returns True for .usd, .usda, .usdc and .usdz paths (case-insensitive extension).
loadModelSceneAsync
#include <rayrai/AssimpMeshLoader.hpp>
std::future<AsyncModelLoadResult> loadModelSceneAsync(const std::string &path)Run the Assimp import of path on a new thread (no GL calls). USD files are not handled here; use loadModel() for them.
importedTexturesDecoded
#include <rayrai/AssimpMeshLoader.hpp>
bool importedTexturesDecoded(const AsyncModelLoadResult &imported)True when the texture files an import queued for background decoding are all decoded (or were never queued), so finishing it decodes no image on the calling thread. Never waits.
finishImportedModelScene
#include <rayrai/AssimpMeshLoader.hpp>
std::shared_ptr<std::vector<std::shared_ptr<OpenGLMesh>>> finishImportedModelScene(AsyncModelLoadResult &imported)Convert an import into meshes, resolving materials/textures and merging compatible meshes. Needs the render context.
Exceptions
| Exception | Description |
|---|---|
std::runtime_error | if the import failed or is empty. |
prepareImportedModelScene
#include <rayrai/AssimpMeshLoader.hpp>
std::shared_ptr<std::vector<std::shared_ptr<OpenGLMesh>>> prepareImportedModelScene(AsyncModelLoadResult &imported)Like finishImportedModelScene() but defers geometry preparation to prepareImportedModelGeometry(). Material/texture resolution requires the render context; geometry remains CPU-only.
prepareImportedModelGeometry
#include <rayrai/AssimpMeshLoader.hpp>
void prepareImportedModelGeometry(
std::vector<std::shared_ptr<OpenGLMesh>> &meshes,
const std::string &path)Worker stage: optimize geometry, compute tangents, and merge compatible meshes.
loadModel
#include <rayrai/AssimpMeshLoader.hpp>
std::shared_ptr<std::vector<std::shared_ptr<OpenGLMesh>>> loadModel(const std::string &path)Load a model synchronously (Assimp formats and USD).
Exceptions
| Exception | Description |
|---|---|
std::runtime_error | if the file cannot be loaded. |
std::shared_ptr<std::vector<std::shared_ptr<OpenGLMesh>>> loadModel(
const std::string &path,
std::vector<ModelSourceFile> &sourceFiles)loadModel(), also returning the files the import read (just the model for USD).
loadSceneLights
#include <rayrai/AssimpMeshLoader.hpp>
std::vector<AdditionalLight> loadSceneLights(
const std::string &path,
float intensityScale=1.0f)Read authored lights (glTF KHR_lights_punctual, a rayrai light sidecar, or Assimp scene lights) as viewer lights. Lights are not added automatically.
Parameters
| Parameter | Description |
|---|---|
path | Model file. |
intensityScale | Multiplier applied to light intensities. |
Returns Converted lights (empty if none).
Exceptions
| Exception | Description |
|---|---|
std::runtime_error | if a binary glTF envelope is malformed. |