Skip to content

Commit 1f08d9f

Browse files
committed
runtime error for runtime instancing on instanced model
1 parent 30b465e commit 1f08d9f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/engine/Source/Scene/Model/ModelSceneGraph.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Frozen from "../../Core/Frozen.js";
55
import defined from "../../Core/defined.js";
66
import Matrix4 from "../../Core/Matrix4.js";
77
import Transforms from "../../Core/Transforms.js";
8+
import RuntimeError from "../../Core/RuntimeError.js";
89
import SceneMode from "../SceneMode.js";
910
import SplitDirection from "../SplitDirection.js";
1011
import TilesetPipelineStage from "./TilesetPipelineStage.js";
@@ -494,6 +495,12 @@ ModelSceneGraph.prototype.traverseAndCreateSceneGraph = function (
494495
node,
495496
transformToRoot,
496497
) {
498+
if (defined(node.instances) & this.hasInstances) {
499+
throw new RuntimeError(
500+
"Models with the EXT_mesh_gpu_instancing extension cannot use the ModelInstanceCollection class.",
501+
);
502+
}
503+
497504
// The indices of the children of this node in the runtimeNodes array.
498505
const childrenIndices = [];
499506
const transform = ModelUtility.getNodeTransform(node);

0 commit comments

Comments
 (0)