- Home /
Why do I get the alembic plugin error
Hello all,
I've made a model of .abc extension and imported to unity using alembic plugin "AlembicForUnity.unitypackage"
I've imported the model and got this error: transform.localScale assign attempt for 'Cylinder223' is not valid. Input localScale is { 0.000000, NaN, 0.000000 }.
This is the script:
using UnityEngine;
namespace UTJ.Alembic
{
public class AlembicXform : AlembicElement
{
aiXform m_abcSchema;
aiXformData m_abcData;
public override aiSchema abcSchema { get { return m_abcSchema; } }
public override bool visibility { get { return m_abcData.visibility; } }
public override void AbcSetup(aiObject abcObj, aiSchema abcSchema)
{
base.AbcSetup(abcObj, abcSchema);
m_abcSchema = (aiXform)abcSchema;
}
public override void AbcSyncDataEnd()
{
if (!m_abcSchema.schema.isDataUpdated)
return;
m_abcSchema.sample.GetData(ref m_abcData);
if (abcTreeNode.stream.streamDescriptor.settings.importVisibility)
abcTreeNode.gameObject.SetActive(m_abcData.visibility);
var trans = abcTreeNode.gameObject.GetComponent<Transform>();
if (m_abcData.inherits)
{
trans.localPosition = m_abcData.translation;
trans.localRotation = m_abcData.rotation;
trans.localScale = m_abcData.scale; //<-----------this is where the error is
}
else
{
trans.position = m_abcData.translation;
trans.rotation = m_abcData.rotation;
trans.localScale = m_abcData.scale;
}
}
}
}
Does anyone familiar with this issue?
Answer by Eco-Editor · Feb 15, 2019 at 08:32 PM
I've found the solution:
Apparently in Unity you shouldn't give the child and the parent the same name.
When renaming the parents game objects by mistake, the errors disappeared.
Your answer
![](https://koobas.hobune.stream/wayback/20220612191722im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
The name 'transform' does not exist in the current context (Fixed, was my fault) 3 Answers
How do i fix Error CS0029? 1 Answer
Distribute terrain in zones 3 Answers
Why does object lerp to above the object it is lerping to? 1 Answer
Error CS0029: Cannot implicitly convert type to UnityEngine.UI.Transform 1 Answer