Skip to content

Commit

Permalink
Updated Exclusions to Account for differences in models
Browse files Browse the repository at this point in the history
  • Loading branch information
kaaori committed Jul 31, 2018
1 parent b8eab7b commit 2ead2c0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Editor/TransferDynamicBonesEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ private void DoEverything()
if (targetDynBone == null)
{
//Debug.Log("Targ Bone is null, adding dynamic bone");

targetDynBone = filteredTargetBones.First(x => x.name == baseBone.name).gameObject
.AddComponent<DynamicBone>();
}
Expand Down Expand Up @@ -218,7 +219,13 @@ private void DoEverything()
{
foreach (var baseExclusion in baseDynBone.m_Exclusions)
{
targetPerBoneExclusions.Add(filteredTargetBones.First(x => x.name == baseExclusion.gameObject.name).gameObject.transform);
var targetExclusion = filteredTargetBones
.FirstOrDefault(x => x.name == baseExclusion.gameObject.name);
if (targetExclusion == null)
{
continue;
}
targetPerBoneExclusions.Add(targetExclusion.gameObject.transform);
}
targetDynBone.m_Exclusions = targetPerBoneExclusions;
}
Expand Down

0 comments on commit 2ead2c0

Please sign in to comment.