Skip to content

Commit

Permalink
com.atteneder.gltfast Release 6.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
atteneder committed Jan 30, 2025
1 parent 92c5ea0 commit 531bf59
Show file tree
Hide file tree
Showing 35 changed files with 784 additions and 738 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [6.9.1] - 2024-11-15

### Added
- (Test) `OpenGltfScene` with open glTF file dialog for convenient testing.
- (Test) Tests for C# jobs that calculate or re-order indices.
- Third party notices.

### Changed
- Node name is assigned earlier during instantiation, enabling easier node identification by name (partially fixes [#724](https://github.com/atteneder/glTFast/issues/724)).
- (Test) Updated test project dependencies.
- (CI) Migrated code coverage.
- Code refactoring
- Flattened `GltfImportBase.Prepare` by extracting many large code blocks into dedicated methods.
- Improved class/field naming. It's now less deceptive and more uniform.
- Using `NativeArray` directly/only instead of `AccessorData` classes/managed arrays. With this change `NativeArrays` are used for index buffers as well which reduces the amount of managed memory allocated.
- Facilitated use of safer NativeCollections in C# jobs that calculate or re-order indices instead of `unsafe` / pointers.

### Fixed
- Made sure that mesh primitives of different drawmode (topology) are not mixed up.

## [6.9.0] - 2024-10-30

### Added
Expand Down
1 change: 1 addition & 0 deletions Documentation~/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ As prerequisites you'll need to [install](installation.md) a version of Unity&re
- [Test Projects](test-project-setup.md)
- [Provided Projects](test-project-setup.md#test-projects)
- [Custom Project](test-project-setup.md#setup-a-custom-project)
- [Load glTF files](test-open-file.md)
- [Run Tests](tests.md)
- [Contribute](contributing.md)

Expand Down
18 changes: 18 additions & 0 deletions Documentation~/test-open-file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Open glTF files

During development there's often the need to load designated, custom glTF files.

## Open glTF File Dialog

A convenient way to do this is the *OpenGltfScene* scene, which is located in the project view under `Packages/Unity glTFast Tests/Tests/Runtime/Scenes` and enter play mode. An open file dialog for opening `.gltf`/`.glb` files will be displayed. The selected glTF file will be loaded and instantiated into the scene and can be inspected, if it succeeded.

Press *Control* and *G* to repeatedly open the same open file dialog within the same play mode session.

> [!NOTE]
> This convenient open file dialog works in the Editor only and won't work in a build.
You can copy and modify the scene to make further adjustments like camera position, lighting, etc.

## Custom Test Environment

If you have many test iterations on one file or you want to load multiple files at once the open file dialog above might not work well for you. An alternative is to create a custom test scene that utilizes the [GltfAsset](ImportRuntime.md#runtime-loading-via-component) component or [custom load scripting](ImportRuntime.md#runtime-loading-via-script) to run your tailored test procedure.
59 changes: 0 additions & 59 deletions Runtime/Scripts/AccessorData.cs

This file was deleted.

29 changes: 29 additions & 0 deletions Runtime/Scripts/AccessorUsage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// SPDX-FileCopyrightText: 2023 Unity Technologies and the glTFast authors
// SPDX-License-Identifier: Apache-2.0

using System;
using UnityEngine;

namespace GLTFast
{
[Flags]
enum AccessorUsage
{
Unknown = 0,
Ignore = 1 << 0,
Index = 1 << 1,
IndexFlipped = 1 << 2,
Position = 1 << 3,
Normal = 1 << 4,
Tangent = 1 << 5,
UV = 1 << 6,
Color = 1 << 7,
InverseBindMatrix = 1 << 8,
AnimationTimes = 1 << 9,
Translation = 1 << 10,
Rotation = 1 << 11,
Scale = 1 << 12,
Weight = 1 << 13,
RequiredForInstantiation = 1 << 14
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace GLTFast {

class PrimitiveDracoCreateContext : PrimitiveCreateContextBase {
class DracoMeshResultGenerator : MeshResultGeneratorBase {

Task<Mesh> m_DracoTask;
Bounds? m_Bounds;
Expand All @@ -25,7 +25,7 @@ class PrimitiveDracoCreateContext : PrimitiveCreateContextBase {

public override bool IsCompleted => m_DracoTask!=null && m_DracoTask.IsCompleted;

public PrimitiveDracoCreateContext(
public DracoMeshResultGenerator(
int meshIndex,
int primitiveIndex,
int subMeshCount,
Expand All @@ -52,7 +52,7 @@ public void StartDecode(NativeSlice<byte> data, Attributes dracoAttributes)
{
flags |= DecodeSettings.RequireNormals;
}
if (morphTargetsContext != null)
if (morphTargetsGenerator != null)
{
flags |= DecodeSettings.ForceUnityVertexLayout;
}
Expand Down Expand Up @@ -88,8 +88,8 @@ public void StartDecode(NativeSlice<byte> data, Attributes dracoAttributes)
mesh.RecalculateBounds();
}

if (morphTargetsContext != null) {
await morphTargetsContext.ApplyOnMeshAndDispose(mesh);
if (morphTargetsGenerator != null) {
await morphTargetsGenerator.ApplyOnMeshAndDispose(mesh);
}

#if GLTFAST_KEEP_MESH_DATA
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Scripts/Export/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace GLTFast.Export
{
static class Constants
{
public const string version = "6.9.0";
public const string version = "6.9.1";

internal const string mimeTypePNG = "image/png";
internal const string mimeTypeJPG = "image/jpeg";
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Scripts/GameObjectInstantiator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ GameObject gameObject
/// <summary>
/// Provides information for when a mesh was added to a node GameObject
/// </summary>
/// <param name="gameObject">GameObject that holds the Msh.</param>
/// <param name="gameObject">GameObject that holds the Mesh.</param>
/// <param name="nodeIndex">Index of the node</param>
/// <param name="meshName">Mesh's name</param>
/// <param name="meshResult">The converted Mesh</param>
Expand Down
Loading

0 comments on commit 531bf59

Please sign in to comment.