Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .yamato/global.metafile
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
test_editors:
- version: 2021.3
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we also remove this and upgrade the minimum unity version to 6000.0?

Same with romotion_test_editors

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the minimum version of the package, so we have to keep the job for promotion.

- version: 2022.3
- version: 6000.0
- version: 6000.2
- version: 6000.3
- version: 6000.4
- version: 6000.5
- version: trunk

nightly_test_editors:
- version: 2022.3
- version: 6000.0
- version: 6000.2
- version: 6000.3
- version: 6000.4
- version: trunk
- version: 6000.5
- version: trunk

clean_console_test_editors:
- version: 6000.0
- version: 6000.2
- version: trunk
- version: 6000.3
- version: 6000.4
- version: 6000.5
- version: trunk

promotion_test_editors:
- version: 2021.3
Expand Down
4 changes: 4 additions & 0 deletions com.unity.formats.alembic/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this package 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).

## [2.4.5] - 2026-04-02
### Changed
- Update deprecated and obsolete APIs available in Unity 6000.4 and above.

## [2.4.4] - 2026-01-29
### Changed
- Signed binaries on Windows and Mac.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ static IEnumerable<T> GetTargets<T>(this AlembicRecorderSettings settings) where
{
return settings.TargetBranch != null ? settings.TargetBranch.GetComponentsInChildren<T>() : Enumerable.Empty<T>();
}
#if UNITY_2023_1_OR_NEWER
#if UNITY_6000_4_OR_NEWER
return Object.FindObjectsByType<T>();
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The FindObjectsSortMode.InstanceID used in UNITY_2023_1_OR_NEWER code path is not needed as the result of GetTargets is only used with Any(), so I just removed the sorting mode here.

I was tempted to remove it in UNITY_2023_1_OR_NEWER code path too but on a package in basic support, the less we touch, the better.
Feel free to push back.

#elif UNITY_2023_1_OR_NEWER
return Object.FindObjectsByType<T>(FindObjectsSortMode.InstanceID);
#else
return Object.FindObjectsOfType<T>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,11 @@ public override void Setup(Component c)
m_target = null;
return;
}
#if UNITY_6000_4_OR_NEWER
abcObject = parent.abcObject.NewXform(target.name + " (" + EntityId.ToULong(target.GetEntityId()).ToString("X8") + ")", timeSamplingIndex);
#else
abcObject = parent.abcObject.NewXform(target.name + " (" + target.GetInstanceID().ToString("X8") + ")", timeSamplingIndex);
#endif
m_target = target;
}

Expand Down Expand Up @@ -952,11 +956,15 @@ Component[] GetTargets(Type type)
{
if (m_settings.Scope == ExportScope.TargetBranch && TargetBranch != null)
return TargetBranch.GetComponentsInChildren(type);
else
#if UNITY_2023_1_OR_NEWER
return Array.ConvertAll<UnityEngine.Object, Component>(GameObject.FindObjectsByType(type, FindObjectsSortMode.InstanceID), e => (Component)e);

#if UNITY_6000_4_OR_NEWER
var objects = GameObject.FindObjectsByType(type);
Array.Sort(objects, (a, b) => EntityId.ToULong(a.GetEntityId()).CompareTo(EntityId.ToULong(b.GetEntityId())));
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FindObjectsSortMode.InstanceID was used to provide a deterministic ordering needed in UpdateCaptureNodes (confirmed by failures in the Timeline tests (under CI conditions) when just removing the mode).
That's why the deprecated mode is replaced by a local sort.

return Array.ConvertAll<UnityEngine.Object, Component>(objects, e => (Component)e);
#elif UNITY_2023_1_OR_NEWER
return Array.ConvertAll<UnityEngine.Object, Component>(GameObject.FindObjectsByType(type, FindObjectsSortMode.InstanceID), e => (Component)e);
#else
return Array.ConvertAll<UnityEngine.Object, Component>(GameObject.FindObjectsOfType(type), e => (Component)e);
return Array.ConvertAll<UnityEngine.Object, Component>(GameObject.FindObjectsOfType(type), e => (Component)e);
#endif
}

Expand All @@ -974,7 +982,11 @@ CaptureNode ConstructTree(Transform node)
{
if (node == null) { return null; }

#if UNITY_6000_4_OR_NEWER
int iid = (int)EntityId.ToULong(node.gameObject.GetEntityId());
#else
int iid = node.gameObject.GetInstanceID();
#endif
CaptureNode cn;
if (m_nodes.TryGetValue(iid, out cn)) { return cn; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ Mesh AddMeshComponents(GameObject go)

internal static Material GetDefaultMaterial()
{
var pipelineAsset = GraphicsSettings.renderPipelineAsset;
var pipelineAsset = GraphicsSettings.defaultRenderPipeline;
if (pipelineAsset != null)
{
return pipelineAsset.defaultMaterial;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,11 @@ void ClearMotionVectors(AlembicTreeNode node)
public bool AbcLoad(bool createMissingNodes, bool serializeMesh)
{
m_time = 0.0f;
#if UNITY_6000_4_OR_NEWER
m_context = new SafeContext(aiContext.Create((int)EntityId.ToULong(m_abcTreeRoot.gameObject.GetEntityId())));
#else
m_context = new SafeContext(aiContext.Create(m_abcTreeRoot.gameObject.GetInstanceID()));
#endif

var settings = m_streamDesc.Settings;
m_config.swapHandedness = settings.SwapHandedness;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public void Execute(int curveIdx)

static Material GetDefaultMaterial()
{
return GraphicsSettings.renderPipelineAsset != null ? GraphicsSettings.renderPipelineAsset.defaultMaterial : new Material(Shader.Find("Diffuse"));
return GraphicsSettings.defaultRenderPipeline != null ? GraphicsSettings.defaultRenderPipeline.defaultMaterial : new Material(Shader.Find("Diffuse"));
}
}
}
4 changes: 2 additions & 2 deletions com.unity.formats.alembic/ValidationExceptions.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"ErrorExceptions": [
"ErrorExceptions": [
{
"ValidationTest": "Package Unity Version Validation",
"ExceptionMessage": "The Unity version requirement is more strict than in the previous version of the package. Increment the minor version of the package to leave patch versions available for previous version. Read more about this error and potential solutions at https://docs.unity3d.com/Packages/com.unity.package-validation-suite@latest/index.html?preview=1&subfolder=/manual/package_unity_version_validation_error.html#the-unity-version-requirement-is-more-strict-than-in-the-previous-version-of-the-package",
"PackageVersion": "2.4.4"
"PackageVersion": "2.4.5"
}
],
"WarningExceptions": []
Expand Down
2 changes: 1 addition & 1 deletion com.unity.formats.alembic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
],
"name": "com.unity.formats.alembic",
"unity": "2021.3",
"version": "2.4.4"
"version": "2.4.5"
}