Skip to content

Load Texture Custom Logic Error #422

@SpaceUserAR

Description

@SpaceUserAR

When trying to override the textures load with custom logic using the "OnResolveTexture" inside "MaterialImporter" scripts an exception is thrown and failed to load the textures.

ArgumentException: Empty path name is not legal. Parameter name: path System.IO.File.WriteAllBytes (System.String path, System.Byte[] bytes) (at <9d9536d9127f4a489d989c7a566aee1c>:0) Unity.Formats.USD.MaterialImporter.CombineRoughness (UnityEngine.Texture2D rgbTex, UnityEngine.Texture2D roughnessTex, System.String fileNameSuffix) (at Library/PackageCache/com.unity.formats.usd@3.0.0-exp.5/Runtime/Scripts/IO/Materials/MaterialImporter.cs:362) Unity.Formats.USD.UrpShaderImporter.ImportFromUsd () (at Library/PackageCache/com.unity.formats.usd@3.0.0-exp.5/Runtime/Scripts/IO/Materials/UrpShaderImporter.cs:81) Unity.Formats.USD.MaterialImporter.BuildMaterial (USD.NET.Scene scene, System.String materialPath, USD.NET.Unity.MaterialSample sample, Unity.Formats.USD.SceneImportOptions options) (at Library/PackageCache/com.unity.formats.usd@3.0.0-exp.5/Runtime/Scripts/IO/Materials/MaterialImporter.cs:183) Unity.Formats.USD.SceneImporter+<BuildScene>d__10.MoveNext () (at Library/PackageCache/com.unity.formats.usd@3.0.0-exp.5/Runtime/Scripts/IO/Scene/SceneImporter.cs:537) Rethrow as ImportException: Error processing material </World/rest/Looks/Accessories> UnityEngine.Debug:LogException(Exception) Unity.Formats.USD.<BuildScene>d__10:MoveNext() (at Library/PackageCache/com.unity.formats.usd@3.0.0-exp.5/Runtime/Scripts/IO/Scene/SceneImporter.cs:548) Unity.Formats.USD.SceneImporter:BuildScene(Scene, GameObject, SceneImportOptions, PrimMap, Boolean) (at Library/PackageCache/com.unity.formats.usd@3.0.0-exp.5/Runtime/Scripts/IO/Scene/SceneImporter.cs:371) Unity.Formats.USD.SceneImporter:ImportUsd(GameObject, Scene, PrimMap, Boolean, SceneImportOptions) (at Library/PackageCache/com.unity.formats.usd@3.0.0-exp.5/Runtime/Scripts/IO/Scene/SceneImporter.cs:318) Unity.Formats.USD.SceneImporter:ImportUsd(GameObject, Scene, PrimMap, SceneImportOptions) (at Library/PackageCache/com.unity.formats.usd@3.0.0-exp.5/Runtime/Scripts/IO/Scene/SceneImporter.cs:270)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions