Skip to content

Commit c9133ff

Browse files
committed
com.atteneder.gltfast Release 6.10.3
1 parent 4dae6da commit c9133ff

File tree

10 files changed

+31
-37
lines changed

10 files changed

+31
-37
lines changed

CHANGELOG.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [6.10.3] - 2025-02-21
8+
9+
### Added
10+
11+
### Changed
12+
13+
### Fixed
14+
- (Import) Morph targets on multi-primitive meshes (where primitives reference identical vertex buffers; fixes [#755](https://github.com/atteneder/glTFast/issues/755)).
15+
16+
### Removed
17+
18+
### Deprecated
19+
20+
### Security
21+
722
## [6.10.2] - 2025-02-03
823

924
### Added
@@ -25,12 +40,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2540
- (CI) Ensuring the development documentation and the `Tools` code is checked for code formatting as well.
2641
- Compilation for `ICodeLogger` implementors by adding a default implementation for `Log` (works for Unity 2021 LTS and newer).
2742

28-
### Removed
29-
30-
### Deprecated
31-
32-
### Security
33-
3443
## [6.10.1] - 2025-01-09
3544

3645
### Added

Documentation~/features.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ glTF defines an [extension mechanism][gltf-ext] that allows the base format to b
102102
| KHR_lights_punctual | ✅ | ✅
103103
| KHR_materials_anisotropy | | |
104104
| KHR_materials_clearcoat | ✅ | ✅
105+
| KHR_materials_diffuse_transmission | | |
105106
| KHR_materials_dispersion | | |
106107
| KHR_materials_emissive_strength | | |
107108
| KHR_materials_ior | [ℹ️][IOR] |

Editor/Scripts/AssemblyInfo.cs.meta

Lines changed: 1 addition & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Runtime/Scripts/DracoMeshGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ GltfImportBase gltfImport
115115
vertexIntervals[vertexIntervals.Length-1] = vertexCount;
116116
m_MorphTargetsGenerator = new MorphTargetsGenerator(
117117
vertexCount,
118-
vertexIntervals,
118+
1,
119119
morphTargets.Length,
120120
morphTargetNames,
121121
morphTargets[0].NORMAL >= 0,
@@ -128,7 +128,7 @@ GltfImportBase gltfImport
128128
for (var morphTargetIndex = 0; morphTargetIndex < primitive.targets.Length; morphTargetIndex++)
129129
{
130130
var target = primitive.targets[morphTargetIndex];
131-
m_MorphTargetsGenerator.AddMorphTarget(subMesh, morphTargetIndex, target);
131+
m_MorphTargetsGenerator.AddMorphTarget( 0, morphTargetIndex, target);
132132
}
133133
}
134134
}

Runtime/Scripts/Export/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace GLTFast.Export
77
{
88
static class Constants
99
{
10-
public const string version = "6.10.2";
10+
public const string version = "6.10.3";
1111

1212
internal const string mimeTypePNG = "image/png";
1313
internal const string mimeTypeJPG = "image/jpeg";

Runtime/Scripts/MeshGenerator.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ GltfImportBase gltfImport
174174
{
175175
m_MorphTargetsGenerator = new MorphTargetsGenerator(
176176
m_VertexData.VertexCount,
177-
m_VertexData.VertexIntervals,
177+
m_Primitives.Count,
178178
morphTargets.Length,
179179
morphTargetNames,
180180
hasNormals,
@@ -278,12 +278,15 @@ async Task<Mesh> GenerateMesh(GltfImportBase gltfImport)
278278
CalculateIndicesJob(primitive, vertexCount, out m_Indices[subMeshIndex], out var job);
279279
tmpList.Add(job);
280280
}
281-
282-
AddMorphTargets(subMeshIndex, primitive, gltfImport.Logger);
283281
}
284282

285283
if (m_MorphTargetsGenerator != null)
286284
{
285+
for (var subMeshIndex = 0; subMeshIndex < m_Primitives.Count; subMeshIndex++)
286+
{
287+
var primitive = m_Primitives[subMeshIndex];
288+
AddMorphTargets(subMeshIndex, primitive, gltfImport.Logger);
289+
}
287290
tmpList.Add(m_MorphTargetsGenerator.GetJobHandle());
288291
}
289292

@@ -296,11 +299,12 @@ void AddMorphTargets(int subMesh, MeshPrimitiveBase primitive, ICodeLogger logge
296299
{
297300
if (m_MorphTargetsGenerator == null)
298301
return;
302+
var vertexOffset = m_VertexData.VertexIntervals[subMesh];
299303
for (var morphTargetIndex = 0; morphTargetIndex < primitive.targets.Length; morphTargetIndex++)
300304
{
301305
var morphTarget = primitive.targets[morphTargetIndex];
302306
var success = m_MorphTargetsGenerator.AddMorphTarget(
303-
subMesh,
307+
vertexOffset,
304308
morphTargetIndex,
305309
morphTarget
306310
);

Runtime/Scripts/MorphTargetsGenerator.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ namespace GLTFast
1717

1818
class MorphTargetsGenerator
1919
{
20-
readonly int[] m_VertexIntervals;
2120
readonly string[] m_MorphTargetNames;
2221
readonly GltfImportBase m_GltfImport;
2322

@@ -26,19 +25,17 @@ class MorphTargetsGenerator
2625

2726
public MorphTargetsGenerator(
2827
int vertexCount,
29-
int[] vertexIntervals,
28+
int subMeshCount,
3029
int morphTargetCount,
3130
string[] morphTargetNames,
3231
bool hasNormals,
3332
bool hasTangents,
3433
GltfImportBase gltfImport
3534
)
3635
{
37-
m_VertexIntervals = vertexIntervals;
3836
m_MorphTargetNames = morphTargetNames;
3937
m_GltfImport = gltfImport;
4038

41-
var subMeshCount = vertexIntervals.Length - 1;
4239
m_Contexts = new MorphTargetGenerator[morphTargetCount];
4340
for (var i = 0; i < morphTargetCount; i++)
4441
{
@@ -48,13 +45,12 @@ GltfImportBase gltfImport
4845
}
4946

5047
public bool AddMorphTarget(
51-
int subMesh,
48+
int offset,
5249
int morphTargetIndex,
5350
MorphTarget morphTarget
5451
)
5552
{
5653
var morphTargetGenerator = m_Contexts[morphTargetIndex];
57-
var offset = m_VertexIntervals[subMesh];
5854
var jobHandle = morphTargetGenerator.ScheduleMorphTargetJobs(
5955
morphTarget,
6056
offset,

gltfast.patch

Whitespace-only changes.

gltfast.patch.meta

Lines changed: 0 additions & 7 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.atteneder.gltfast",
3-
"version": "6.10.2",
3+
"version": "6.10.3",
44
"displayName": "glTFast",
55
"description": "Use glTFast to import and export glTF 3D files efficiently at runtime or in the Editor",
66
"unity": "2020.3",

0 commit comments

Comments
 (0)