Skip to content

Commit 52abb9f

Browse files
committed
Use GetEntityId for 6.4+
1 parent 33c5f94 commit 52abb9f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

com.unity.formats.alembic/Runtime/Scripts/Exporter/AlembicExporter_impl.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,11 @@ public override void Setup(Component c)
546546
m_target = null;
547547
return;
548548
}
549+
#if UNITY_6000_4_OR_NEWER
550+
abcObject = parent.abcObject.NewXform(target.name + " (" + EntityId.ToULong(target.GetEntityId()).ToString("X8") + ")", timeSamplingIndex);
551+
#else
549552
abcObject = parent.abcObject.NewXform(target.name + " (" + target.GetInstanceID().ToString("X8") + ")", timeSamplingIndex);
553+
#endif
550554
m_target = target;
551555
}
552556

@@ -976,7 +980,11 @@ CaptureNode ConstructTree(Transform node)
976980
{
977981
if (node == null) { return null; }
978982

983+
#if UNITY_6000_4_OR_NEWER
984+
int iid = (int)EntityId.ToULong(node.gameObject.GetEntityId());
985+
#else
979986
int iid = node.gameObject.GetInstanceID();
987+
#endif
980988
CaptureNode cn;
981989
if (m_nodes.TryGetValue(iid, out cn)) { return cn; }
982990

com.unity.formats.alembic/Runtime/Scripts/Importer/AlembicStream.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,11 @@ void ClearMotionVectors(AlembicTreeNode node)
222222
public bool AbcLoad(bool createMissingNodes, bool serializeMesh)
223223
{
224224
m_time = 0.0f;
225+
#if UNITY_6000_4_OR_NEWER
226+
m_context = new SafeContext(aiContext.Create((int)EntityId.ToULong(m_abcTreeRoot.gameObject.GetEntityId())));
227+
#else
225228
m_context = new SafeContext(aiContext.Create(m_abcTreeRoot.gameObject.GetInstanceID()));
229+
#endif
226230

227231
var settings = m_streamDesc.Settings;
228232
m_config.swapHandedness = settings.SwapHandedness;

0 commit comments

Comments
 (0)