@@ -9,17 +9,17 @@ import type * as THREE from 'three';
99import { Group<%= threeImports %> } from 'three';
1010import { extend, type NgtThreeElements, NgtObjectEvents<% if (args) { %>, NgtArgs<% } %> } from 'angular-three';
1111import { Component, ChangeDetectionStrategy, CUSTOM_ELEMENTS_SCHEMA, input, viewChild, ElementRef, inject, effect<% if (animations.length) { %>, model<% } %> } from '@angular/core';
12- import { injectGLTF } from 'angular-three-soba/loaders';
12+ import { gltfResource } from 'angular-three-soba/loaders';
1313import type { GLTF } from 'three-stdlib';<% if (animations.length) { %>
14- import { injectAnimations , type NgtsAnimationClips, type NgtsAnimationApi } from 'angular-three-soba/misc';<% } %><% if (perspective) { %>
14+ import { animations , type NgtsAnimationClips, type NgtsAnimationApi } from 'angular-three-soba/misc';<% } %><% if (perspective) { %>
1515import { NgtsPerspectiveCamera } from 'angular-three-soba/cameras';<% } %><% if (orthographic) { %>
1616import { NgtsOrthographicCamera } from 'angular-three-soba/cameras';<% } %>
1717<% if (useImportAttribute) { %>
1818// @ts-expect-error - import .glb/.gltf file
1919import <%= gltfName %> from '<%= gltfPath %>' with { loader: 'file' };
2020<% } %>
2121<% if (preload) { %>
22- injectGLTF .preload(() => <% if (useImportAttribute) { %><%= gltfName %><% } else { %>'<%= gltfPath %>'<% } %>);
22+ gltfResource .preload(<% if (useImportAttribute) { %><%= gltfName %><% } else { %>'<%= gltfPath %>'<% } %>);
2323<% } %>
2424<% if (animations.length) { %>
2525type ActionName = <% animations.map(clip => "\""+ clip.name + "\"").join(" | ") %>;
@@ -40,7 +40,7 @@ export type <%= gltfResultTypeName %> = GLTF & {
4040@Component({
4141 selector: '<%= selector %>',
4242 template: `
43- @if (gltf(); as gltf) {
43+ @if (gltf.value (); as gltf) {
4444 @let nodes = gltf.nodes;
4545 @let materials = gltf.materials;
4646
@@ -69,16 +69,16 @@ export class <%= className %> {
6969
7070 modelRef = viewChild<ElementRef<Group>>('model');
7171
72- protected gltf = injectGLTF <<%= gltfResultTypeName %>>(() => <% if (useImportAttribute) { %> <%= gltfName %> <% } else { %> '<%= url %>' <% } %><% if (gltfOptions) { %>, <%= gltfOptions %><% } %>);
72+ protected gltf = gltfResource <<%= gltfResultTypeName %>>(() => <% if (useImportAttribute) { %> <%= gltfName %> <% } else { %> '<%= url %>' <% } %><% if (gltfOptions) { %>, <%= gltfOptions %><% } %>);
7373
7474 constructor() {
7575 extend({ Group<%= threeImports %> });
7676
7777 <% if (animations.length) { %>
78- const animations = injectAnimations (this.gltf, this.modelRef);
78+ const _animations = animations (this.gltf, this.modelRef);
7979 effect(() => {
80- if (!animations .isReady) return;
81- this.animations.set(animations );
80+ if (!_animations .isReady) return;
81+ this.animations.set(_animations );
8282 });
8383 <% } %>
8484
0 commit comments