npm.io
1.0.0 • Published 3 years ago

three-gltf-combine

Licence
MIT
Version
1.0.0
Deps
0
Size
3 kB
Vulns
0
Weekly
0

three-gltf-combine

Install

#npm
npm install three-gltf-combine

#yarn
yarn add three-gltf-combine

# pnpm
pnpm add three-gltf-combine

# bun
bun add three-gltf-combine

Usage

If you want to combine gltf parts
import { combineSkinnedMesh } from 'three-gltf-combine';

//...

const destination = parent.getObjectByName('your SkinnedMesh name') as THREE.SkinnedMesh;
const target = otherGLTF.getObjectByName('your SkinnedMesh name') as THREE.SkinnedMesh;

combineSkinnedMesh({
  target,
  destination,
  parent,
});
If you want to replace gltf parts
import { replaceSkinnedMesh } from 'three-gltf-combine';

//...

const destination = parent.getObjectByName('your SkinnedMesh name') as THREE.SkinnedMesh;
const target = otherGLTF.getObjectByName('your SkinnedMesh name') as THREE.SkinnedMesh;

replaceSkinnedMesh({
  target,
  destination,
  parent,
});

Keywords