载入中...
搜索中...
未找到
VegetationConversionImport.cpp
浏览该文件的文档.
16 const auto bytes = std::span<const std::uint8_t>(reinterpret_cast<const std::uint8_t*>(seed.data()), seed.size());
27Result<std::string> texturePathForGuid(const UnityVegetationAssetImportRequest& request, std::string_view guid) {
37 Diagnostic::error(DiagnosticCode::NotFound, "vegetation texture metadata has no source payload", source,
41 Diagnostic::error(DiagnosticCode::Conflict, "duplicate vegetation texture GUID", std::string(guid), {},
52Result<void> appendMesh(PreparedAssetImport& prepared, const UnityVegetationAssetImportRequest& request,
60 *conversion.mesh, {request.limits.maximumVerticesPerPrimitive, request.limits.maximumIndicesPerPrimitive,
63 const auto key = request.outputKey.empty() ? unity_detail::foldAscii(request.materialGuid) : request.outputKey;
78 for (const auto& [set, values] : conversion.mesh->texcoords) uvSets.emplace_back(std::int64_t(set));
81 attributes.emplace_back(Value::Object{{"name", name}, {"components", std::int64_t(attribute.components)}});
116 prepared.findings.push_back({request.conversion.sourcePath, "TVE.Mesh", ImportDisposition::Baked,
122Result<PreparedAssetImport> prepareUnityVegetationConversionImport(const UnityVegetationAssetImportRequest& request) {
126 DiagnosticCode::InvalidArgument, "vegetation material GUID must contain 32 hexadecimal digits", {}, {},
160 auto material = encodeUnityVegetationConversionMaterial(candidate, request.limits.maximumDecodedBytes);
181 auto report = detail::finalizeImportReport(prepared.value(), request.package, "unity", "tve-12.6-conversion",
201Result<PreparedAssetImport> prepareUnityVegetationConversionBatch(const UnityVegetationBatchImportRequest& request) {
205 DiagnosticCode::InvalidArgument, "vegetation batch requires a bounded non-empty object set", {}, {},
207 auto manifest = detail::baseManifest(request.package, "eve.unity-vegetation-conversion-batch/1");
248 object.outputKey + (name == "default" || name == object.conversion.sourcePath ? "" : "#" + name);
256 Diagnostic::error(DiagnosticCode::InvalidArgument, "vegetation batch asset count exceeds budget",
259 for (auto& [path, content] : uniqueEntries) batch.entries.push_back({std::move(path), std::move(content)});
260 auto report = detail::finalizeImportReport(batch, request.package, "unity", "tve-12.6-conversion-batch",
Direct Unity text-serialization adapter for TerrainData and Prefab assets.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
const T & value() const &
Borrow the value from a const lvalue after checking success.
Definition Result.h:308
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Id128 child(std::string_view role) const noexcept
Derives a deterministic child UUID for a hierarchical identity.
Definition Identity.h:192
Result< std::string > metaScalar(std::span< const std::uint8_t > bytes, std::string_view key, std::string_view path)
Read an unindented scalar from .meta; rejects duplicate keys and binary metadata.
Definition UnitySource.cpp:10
Definition AssetImporter.h:14
Result< PreparedAssetImport > prepareUnityVegetationConversionImport(const UnityVegetationAssetImportRequest &request)
Convert and prepare one material, its packed images, and optional mesh as a single EVA candidate.
Definition VegetationConversionImport.cpp:122
EVENGINE_API_PLATFORM Result< std::vector< std::uint8_t > > encodeUnityVegetationConversionMaterial(const VegetationConversionCandidate &candidate, std::uint64_t maximumBytes=16ull *1024ull *1024ull)
Encode an applied vegetation candidate as a detached Unity text Material for the canonical TVE import...
Definition VegetationPresetMaterial.cpp:46
Result< PreparedAssetImport > prepareUnityVegetationConversionBatch(const UnityVegetationBatchImportRequest &request)
Prepare several vegetation objects as one all-or-nothing EVA candidate.
Definition VegetationConversionImport.cpp:201
EVENGINE_API_PLATFORM Result< VegetationConversionResult > executeUnityVegetationConversion(const UnityVegetationConversionRequest &request)
Decode a Unity Material, evaluate one TVE preset graph, and execute every output atomically.
Definition VegetationPresetConversion.cpp:210
Result< PreparedAssetImport > prepareUnityProjectImport(const UnityProjectImportRequest &request)
Import selected Unity assets, or discover a collection when both selectors are empty.
Definition UnityImporter.cpp:769
EVENGINE_API_FOUNDATION Result< std::vector< std::uint8_t > > encodeCanonicalMesh(const CanonicalMeshData &mesh, const CanonicalMeshLimits &limits={})
Encode an owning snapshot to EVMESH v3, or v2 when no named attributes exist. Borrows input synchrono...
Definition CanonicalMeshEncode.cpp:9
std::variant< std::monostate, std::int64_t, double, std::string, bool > Value
Definition Database.h:26
@ InvalidArgument
@ NotFound
@ Failed
@ Conflict
@ Object
detail::StrongUint64< detail::SchemaVersionTag > SchemaVersion
Persistent data-format version; not a runtime replacement generation.
Definition SchemaVersion.h:13
Definition Container.h:602
One owning regular-file entry inside an .eva archive.
Definition EvaArchive.h:31
std::vector< EvaDependency > dependencies
Definition EvaManifest.h:70
std::map< std::string, AssetRef > entrypoints
Definition EvaManifest.h:71
std::uint32_t maximumAssets
Definition AssetImporter.h:20
ImportPackageIdentity package
Definition AssetImporter.h:55
PersistentId packageId
Definition AssetImporter.h:34
Owning, validated source archive candidate not yet published to disk/database.
Definition AssetImporter.h:90
std::vector< ImportFinding > findings
Definition AssetImporter.h:93
std::vector< asset::EvaArchiveEntry > entries
Definition AssetImporter.h:92
std::vector< ImportSourceMapping > sourceMappings
Definition AssetImporter.h:94
asset::EvaManifest manifest
Definition AssetImporter.h:91
In-memory Unity project slice; keys are normalized project-relative paths.
Definition UnityImporter.h:15
Owning inputs for one atomically prepared Unity vegetation asset group.
Definition VegetationPreset.h:124
Owning ordered set of independently converted vegetation objects published as one package.
Definition VegetationPreset.h:134