// Copyright (c) 2012-2024 Wojciech Figat. All rights reserved.
#pragma once
#include "Types.h"
#if COMPILE_WITH_ASSETS_IMPORTER
#include "Engine/Tools/ModelTool/ModelTool.h"
///
/// Importing models utility
///
class ImportModel
{
public:
typedef ModelTool::Options Options;
public:
///
/// Tries the get model import options from the target location asset.
///
/// The asset path.
/// The options.
/// True if success, otherwise false.
static bool TryGetImportOptions(const StringView& path, Options& options);
///
/// Imports the model file.
///
/// The importing context.
/// Result.
static CreateAssetResult Import(CreateAssetContext& context);
///
/// Creates the model asset from the ModelData storage (input argument should be pointer to ModelData).
///
/// The importing context.
/// Result.
static CreateAssetResult Create(CreateAssetContext& context);
private:
static CreateAssetResult CreateModel(CreateAssetContext& context, ModelData& data, const Options* options = nullptr);
static CreateAssetResult CreateSkinnedModel(CreateAssetContext& context, ModelData& data, const Options* options = nullptr);
static CreateAssetResult CreateAnimation(CreateAssetContext& context, ModelData& data, const Options* options = nullptr);
static CreateAssetResult CreatePrefab(CreateAssetContext& context, ModelData& data, const Options& options, const Array& prefabObjects);
};
#endif