From e114f180164ffd937f65bc24adc03d0789740174 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sat, 28 Oct 2023 16:34:52 +0900 Subject: [PATCH 1/7] chore: copy m_UseHighQualityCurve to new clip --- Editor/Processors/ApplyObjectMapping.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Editor/Processors/ApplyObjectMapping.cs b/Editor/Processors/ApplyObjectMapping.cs index 70bcf4d5f..1d8f41f90 100644 --- a/Editor/Processors/ApplyObjectMapping.cs +++ b/Editor/Processors/ApplyObjectMapping.cs @@ -161,6 +161,15 @@ private Object CustomClone(Object o) var newClip = new AnimationClip(); newClip.name = "rebased " + clip.name; + // copy m_UseHighQualityCurve with SerializedObject since m_UseHighQualityCurve doesn't have public API + using (var serializedClip = new SerializedObject(clip)) + using (var serializedNewClip = new SerializedObject(newClip)) + { + serializedNewClip.FindProperty("m_UseHighQualityCurve") + .boolValue = serializedClip.FindProperty("m_UseHighQualityCurve").boolValue; + serializedNewClip.ApplyModifiedPropertiesWithoutUndo(); + } + foreach (var binding in AnimationUtility.GetCurveBindings(clip)) { var newBinding = _mapping.MapBinding(binding); From 13896506fc44ddbdf0922155deb1ab4ba1037492 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sat, 28 Oct 2023 17:07:36 +0900 Subject: [PATCH 2/7] fix: length of animation clip can be changed --- Editor/Processors/ApplyObjectMapping.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Editor/Processors/ApplyObjectMapping.cs b/Editor/Processors/ApplyObjectMapping.cs index 1d8f41f90..d62d6e88a 100644 --- a/Editor/Processors/ApplyObjectMapping.cs +++ b/Editor/Processors/ApplyObjectMapping.cs @@ -188,6 +188,16 @@ private Object CustomClone(Object o) AnimationUtility.GetObjectReferenceCurve(clip, binding)); } + // ReSharper disable once CompareOfFloatsByEqualityOperator + if (newClip.length != clip.length) + { + // if newClip has less properties than original clip (especially for no properties), + // length of newClip can be changed which is bad. + newClip.SetCurve( + "$AvatarOptimizerClipLengthDummy$", typeof(GameObject), "m_IsActive", + AnimationCurve.Constant(clip.length, clip.length, 1f)); + } + newClip.wrapMode = clip.wrapMode; newClip.legacy = clip.legacy; newClip.frameRate = clip.frameRate; From 2b23851296b3c314555bc292bf95ffba5e67b01e Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sat, 28 Oct 2023 17:11:21 +0900 Subject: [PATCH 3/7] docs(changelog): Animation clip length can be changed --- CHANGELOG-PRERELEASE.md | 1 + CHANGELOG.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG-PRERELEASE.md b/CHANGELOG-PRERELEASE.md index 04672194b..38aab250f 100644 --- a/CHANGELOG-PRERELEASE.md +++ b/CHANGELOG-PRERELEASE.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog]. ### Removed ### Fixed +- Animation clip length can be changed `#647` ### Security diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c6394b6a..543705683 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog]. ### Removed ### Fixed +- Animation clip length can be changed `#647` ### Security From 365636c73c6811309935a5370426a50b15c699b9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 28 Oct 2023 08:21:05 +0000 Subject: [PATCH 4/7] chore: bump version to 1.5.9-rc.1 --- CHANGELOG-PRERELEASE.md | 8 ++++++-- package.json | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG-PRERELEASE.md b/CHANGELOG-PRERELEASE.md index 38aab250f..8e2e7fe37 100644 --- a/CHANGELOG-PRERELEASE.md +++ b/CHANGELOG-PRERELEASE.md @@ -16,10 +16,13 @@ The format is based on [Keep a Changelog]. ### Removed ### Fixed -- Animation clip length can be changed `#647` ### Security +## [1.5.9-rc.1] - 2023-10-28 +### Fixed +- Animation clip length can be changed [`#647`](https://github.com/anatawa12/AvatarOptimizer/pull/647) + ## [1.5.8] - 2023-10-20 ## [1.5.8-rc.1] - 2023-10-20 ### Fixed @@ -935,7 +938,8 @@ This release is mistake. - Merge Bone - Clear Endpoint Position -[Unreleased]: https://github.com/anatawa12/AvatarOptimizer/compare/v1.5.8...HEAD +[Unreleased]: https://github.com/anatawa12/AvatarOptimizer/compare/v1.5.9-rc.1...HEAD +[1.5.9-rc.1]: https://github.com/anatawa12/AvatarOptimizer/compare/v1.5.8...v1.5.9-rc.1 [1.5.8]: https://github.com/anatawa12/AvatarOptimizer/compare/v1.5.8-rc.1...v1.5.8 [1.5.8-rc.1]: https://github.com/anatawa12/AvatarOptimizer/compare/v1.5.7...v1.5.8-rc.1 [1.5.7]: https://github.com/anatawa12/AvatarOptimizer/compare/v1.5.7-beta.1...v1.5.7 diff --git a/package.json b/package.json index eb27f3aee..cd308186c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.anatawa12.avatar-optimizer", - "version": "1.5.9-beta.0", + "version": "1.5.9-rc.1", "unity": "2019.4", "description": "Set of Anatawa12's Small Avatar Optimization Utilities", "displayName": "Anatawa12's AvatarOptimizer", From a9f2c479b1eee651cd01d64d7a4e0949c2e3d9bf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 29 Oct 2023 07:33:41 +0000 Subject: [PATCH 5/7] chore: bump version to 1.5.9 --- CHANGELOG-PRERELEASE.md | 4 +++- CHANGELOG.md | 8 ++++++-- package.json | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG-PRERELEASE.md b/CHANGELOG-PRERELEASE.md index 8e2e7fe37..51ba66336 100644 --- a/CHANGELOG-PRERELEASE.md +++ b/CHANGELOG-PRERELEASE.md @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog]. ### Security +## [1.5.9] - 2023-10-29 ## [1.5.9-rc.1] - 2023-10-28 ### Fixed - Animation clip length can be changed [`#647`](https://github.com/anatawa12/AvatarOptimizer/pull/647) @@ -938,7 +939,8 @@ This release is mistake. - Merge Bone - Clear Endpoint Position -[Unreleased]: https://github.com/anatawa12/AvatarOptimizer/compare/v1.5.9-rc.1...HEAD +[Unreleased]: https://github.com/anatawa12/AvatarOptimizer/compare/v1.5.9...HEAD +[1.5.9]: https://github.com/anatawa12/AvatarOptimizer/compare/v1.5.9-rc.1...v1.5.9 [1.5.9-rc.1]: https://github.com/anatawa12/AvatarOptimizer/compare/v1.5.8...v1.5.9-rc.1 [1.5.8]: https://github.com/anatawa12/AvatarOptimizer/compare/v1.5.8-rc.1...v1.5.8 [1.5.8-rc.1]: https://github.com/anatawa12/AvatarOptimizer/compare/v1.5.7...v1.5.8-rc.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 543705683..5ba0fd0db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,10 +16,13 @@ The format is based on [Keep a Changelog]. ### Removed ### Fixed -- Animation clip length can be changed `#647` ### Security +## [1.5.9] - 2023-10-29 +### Fixed +- Animation clip length can be changed [`#647`](https://github.com/anatawa12/AvatarOptimizer/pull/647) + ## [1.5.8] - 2023-10-20 ### Fixed - warning about VRCTestMarker when Build & Test [`#628`](https://github.com/anatawa12/AvatarOptimizer/pull/628) @@ -621,7 +624,8 @@ The format is based on [Keep a Changelog]. - Merge Bone - Clear Endpoint Position -[Unreleased]: https://github.com/anatawa12/AvatarOptimizer/compare/v1.5.8...HEAD +[Unreleased]: https://github.com/anatawa12/AvatarOptimizer/compare/v1.5.9...HEAD +[1.5.9]: https://github.com/anatawa12/AvatarOptimizer/compare/v1.5.8...v1.5.9 [1.5.8]: https://github.com/anatawa12/AvatarOptimizer/compare/v1.5.7...v1.5.8 [1.5.7]: https://github.com/anatawa12/AvatarOptimizer/compare/v1.5.6...v1.5.7 [1.5.6]: https://github.com/anatawa12/AvatarOptimizer/compare/v1.5.5...v1.5.6 diff --git a/package.json b/package.json index cd308186c..7638ec898 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.anatawa12.avatar-optimizer", - "version": "1.5.9-rc.1", + "version": "1.5.9", "unity": "2019.4", "description": "Set of Anatawa12's Small Avatar Optimization Utilities", "displayName": "Anatawa12's AvatarOptimizer", From 99d0a4f6d3763f36aa900db281dd77c6150aaa09 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 29 Oct 2023 07:34:12 +0000 Subject: [PATCH 6/7] chore: prepare for next version: 1.5.10 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7638ec898..bbe92f72b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.anatawa12.avatar-optimizer", - "version": "1.5.9", + "version": "1.5.10-beta.0", "unity": "2019.4", "description": "Set of Anatawa12's Small Avatar Optimization Utilities", "displayName": "Anatawa12's AvatarOptimizer", From 922bde8f779c54f2384906415f1de710b16fdfa2 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sun, 29 Oct 2023 17:53:13 +0900 Subject: [PATCH 7/7] docs(changelog): Fixes in 1.5.9 --- CHANGELOG-PRERELEASE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG-PRERELEASE.md b/CHANGELOG-PRERELEASE.md index 908d13706..9a65ffa14 100644 --- a/CHANGELOG-PRERELEASE.md +++ b/CHANGELOG-PRERELEASE.md @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog]. ### Fixed - Prefab blinks when we see editor of PrefabSafeSet of prefab asset `#645` +- Fixes in 1.5.9 `#654` ### Security