mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-23 19:36:18 -05:00
Merge pull request #791 from ichi-23/ichi/fix_null_reference_root_nodes
scene.nodes が無い glTF ファイルを Import したときに null reference exception が発生していた問題を修正
This commit is contained in:
commit
0c19c63cac
|
|
@ -145,11 +145,14 @@ namespace UniGLTF
|
|||
NodeImporter.SetupSkinning(this, nodes, i, inverter);
|
||||
}
|
||||
|
||||
// connect root
|
||||
foreach (var x in GLTF.rootnodes)
|
||||
if (GLTF.rootnodes != null)
|
||||
{
|
||||
var t = nodes[x].Transform;
|
||||
t.SetParent(Root.transform, false);
|
||||
// connect root
|
||||
foreach (var x in GLTF.rootnodes)
|
||||
{
|
||||
var t = nodes[x].Transform;
|
||||
t.SetParent(Root.transform, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
await m_awaitCaller.NextFrame();
|
||||
|
|
|
|||
|
|
@ -133,6 +133,10 @@ namespace UniGLTF
|
|||
//
|
||||
public static void FixCoordinate(ImporterContext context, List<TransformWithSkin> nodes, IAxisInverter inverter)
|
||||
{
|
||||
if (context.GLTF.rootnodes == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var globalTransformMap = nodes.ToDictionary(x => x.Transform, x => new PosRot
|
||||
{
|
||||
Position = x.Transform.position,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user