glTFast 5.0.0
This release contains multiple breaking changes. Please read the upgrade guide for details.
Added
settings
parameter toGameObjectBoundsInstantiator
's constructor- (Import) Support for lights via KHR_lights_punctual extension (#17)
- (Import) Exclude/include certain features (e.g. camera, animation, lights) via
InstantiationSettings.Mask
(of typeComponentType
) - DOTS instantiation settings support
- (Import) Additional load methods in
GltfImport
(#409)Load
override to load from abyte[]
LoadFile
to load from local filesLoadGltfJson
to load a glTF JSON from string
- (Import)
SceneObjectCreation
instantiation setting. It controls whether/when a GameObject/Entity should be created for the scene. Options:Always
,Never
,WhenSingleRootNode
. (#320) - (Import) Design-time import inspector now offers many more settings (feature parity with run-time settings)
- Extended access to
IGltfReadable
GetSourceRoot
GetSourceNode
GetBindPoses
GltfAsset
component got new properties for code-less setup- Import Settings
- Instantiation Settings
- Warning when trying to load the main scene if it is not defined (Editor and development builds only; #450)
- (Export) Support for camera export
- (Export) Support for lights export
- glTF icon assigned to imported glTF assets,
GltfAsset*
components and and various setting classes - (Import) Support for up to 8 UV sets (note: glTF shaders still support only two sets; part of #206)
IMaterialGenerator
was extended with support for points topology- (Export)
GameObjectExportSettings.DisabledComponents
to explicitely enable export of disabled components (e.g.MeshRenderer
,Camera
, orLight
) - (Export)
ExportSettings.ComponentMask
to include or exclude components from export based on type - (Export)
GameObjectExportSettings.LayerMask
to include or exclude GameObjects from export based on their layer - (Import) Async instantiation methods. This helps to ensure a stable frame rate when loading bigger glTF scenes (#205)
GltfGlobals
is public nowGameObjectInstantiator.SceneTransform
is public now
Changed
- The API was changed considerably to conform closer to Unity's coding standard and the Microsoft's Framework Design Guidelines. Some notable items:
- PascalCase on properties
- Removed direct access to fields
- More consistent naming of assemblies, namespaces, classes, constants, static members, etc.
- Removed majority of Rider code analysis warnings and suggestions
- Converted a lot of unintentionally public classes, types and properties to internal ones
- Replaced
CollectingLogger.item
with.Count
and.Items
iterator - Moved logging related code into
GLTFast.Logging
namespace - Renamed
Schema.RootChild
toSchema.NamedObject
and made it abstract - Converted
GameObjectInstantiator.Settings
toInstantiationSettings
- Removed
RenderPipelineUtils.DetectRenderPipeline
in favor ofRenderPipelineUtils.RenderPipeline
- Additional methods/properties (e.g. from class
GameObjectInstantiator
) are virtual, so they can be overriden GltfImport
implementsIDisposable
now (#194)- Support for PNG/Jpeg textures (via built-in packages Unity Web Request Texture and Image Conversion) is now optional (#321)
- Root entity created by
GltfEntityAsset
will inherit its GameObject's name, position, rotation and scale (at instantiation time) - Removed
GltfImport.GetAccessor
from public API (to be replace by a better API; see #426 for details) - Converted
emissiveFactor
shader property from low to high dynamic range (HDR) and removed the now obsoleteemissiveIntensity
shader property (float) - Shader keyword
_UV_ROTATION
was replaced by_TEXTURE_TRANSFORM
, which now controls tiling, offset and rotation all together - Animation is not played by default anymore (check the upgrade guide on how to restore this behavior; #339)
- (Import) Deprecated existing, sync instantiation methods in favor of new async ones
- KTX textures load much smoother thanks to bumping KtxUnity to 1.3.0 or 2.2.1
- Sped up loading of external KTX textures by avoid making a redundant memory copy.
IDownload
does not derive fromIEnumertor
anymore- (Import) Successfully tested mesh primitive draw mode
lines
and removed error message about it being untested - (Export) Disabled components (e.g.
MeshRenderer
,Camera
, orLight
) are not exported by default (see also: newGameObjectExportSettings.DisabledComponents
setting to get old behavior) - (Export) GameObjects with tag
EditorOnly
(including children) don't get exported (similar to building a scene) - Added optional
CancellationToken
parameter to async import/export methods. This is preparation work for proper cancellation. Does not work as expected just yet. - Refactored Assembly Definitions
glTFastSchema
was merged intoglTFast
and thus removedglTFastEditor
was renamed toglTFast.Editor
glTFastEditorTests
was renamed toglTFast.Editor.Tests
GltfAsset.FullUrl
is public now (convenient for some tests)IInstantiator
changesIInstantiator.BeginScene
signature dropped third parameterAnimationClip[] animationClips
that was depending on built-in Animation module to be enabled.IInstantiator.AddAnimation
was added. Only available when built-in Animation module is enabled.
- Converted properties that were hiding conversion logic or caching into methods
Accessor
:typeEnum
toGetAttributeType
/SetAttributeType
BufferView
:modeEnum
toGetMode
BufferView
:filterEnum
toGetFilter
AnimationChannelTarget
:pathEnum
toGetPath
AnimationSampler
:interpolationEnum
toGetInterpolationType
Camera
:typeEnum
toGetCameraType
/SetCameraType
LightPunctual
:typeEnum
toGetLightType
/SetLightType
Material
:alphaModeEnum
toGetAlphaMode
/SetAlphaMode
- Moved some nested classes into dedicated files and up the namespace hierarchy
GameObjectInstantiator.SceneInstance
is nowGameObjectSceneInstance
ImportSettings.NameImportMethod
is nowNameImportMethod
InstantiationSettings.SceneObjectCreation
is nowSceneObjectCreation
HttpHeader
's properties are readonly now. A constructor was added as compensation.
Removed
- Obsolete code
GltfImport.Destroy
(was renamed toGltfImport.Dispose
)GLTFast.GltFast
(was renamed toGltfImport
)GltfImport.InstantiateGltf
(was replaced byInstantiateMainScene
andInstantiateScene
)- Remains of Basis Universal extension draft state
Schema.Image.extensions
Schema.Image.ImageExtension
Schema.Image.ImageKtx2
Fixed
- Shader graphs' BaseColor, BaseColorTexture and vertex color calculations are now in correct color space
- Export MeshRenderer where number of materials does not match number of submeshes (thanks @DanDovi for #428)
- Shaders and shader graphs now have a proper main color and main texture assigned (except legacy shader graphs where this is not supported)
- No more redundant default (fallback) materials are being generated
- (JSON parsing) Potential NPDR when just one of many node extensions is present (#464)
- (Import) Draco meshes are correctly named (#527)
- (Import) Gracefully fallback to loading textures from byte arrays if UnityWebRequestTexture module is not enabled and trigger a warning.
- (Import)
GltfBoundsAsset.Load
properly passes on the logger now. - (Import) Exception upon loading a file that uses the
KHR_animation_pointer
extension.