Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

Commit

Permalink
feat(core): add morphTarget inputs to ThreeMesh
Browse files Browse the repository at this point in the history
  • Loading branch information
nartc committed Apr 18, 2021
1 parent a12c799 commit 8b0b3ee
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/core/meshes/src/lib/abstracts/mesh.abstract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export abstract class ThreeMesh<
implements AfterContentInit {
@Input() geometry?: string | BufferGeometry | null;
@Input() material?: string | Material | null;
@Input() morphTargetInfluences?: number[];
@Input() morphTargetDictionary?: { [key: string]: number };

@ContentChild(ThreeMaterial) materialDirective?: ThreeMaterial;
@ContentChild(ThreeBufferGeometry)
Expand Down Expand Up @@ -65,6 +67,14 @@ export abstract class ThreeMesh<
...args: unknown[]
) => TMesh)(geometry, material, ...(this._extraArgs || [])) as TMesh;

if (this.morphTargetDictionary) {
this._mesh.morphTargetDictionary = this.morphTargetDictionary;
}

if (this.morphTargetInfluences) {
this._mesh.morphTargetInfluences = this.morphTargetInfluences;
}

if (this.customize) {
this.customize();
}
Expand Down

0 comments on commit 8b0b3ee

Please sign in to comment.