Skip to content

Commit

Permalink
fix: add public variable to get model meta info
Browse files Browse the repository at this point in the history
  • Loading branch information
kyasbal committed Nov 16, 2017
1 parent 9f50d6e commit 5258d1f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Components/GLTFModelComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Component from "grimoirejs/ref/Node/Component";
import IAttributeDeclaration from "grimoirejs/ref/Node/IAttributeDeclaration";
import GLTFParser from "../Parser/Parser";
import AssetLoader from "grimoirejs-fundamental/ref/Asset/AssetLoader";
import GLTF from "../Parser/Schema/GLTF";

import DefaultInstanciator from "../Instanciator/DefaultInstanciator";

Expand Down Expand Up @@ -38,11 +39,14 @@ export default class GLTFModelComponent extends Component {

public loadPromise: Promise<void>;

public modelMeta: GLTF;

public $mount(): void {
const src = this.getAttribute("src");
if (src) {
const gl: WebGLRenderingContext = this.companion.get("gl") as WebGLRenderingContext;
const promise = GLTFParser.parseFromURL(gl, src).then((data) => {
this.modelMeta = data.tf;
GLTFModelComponent.instanciator.instanciateAll(data, this, this.getAttribute("scene"));
});
this.loadPromise = promise;
Expand Down

0 comments on commit 5258d1f

Please sign in to comment.