https://github.com/juunini/three-gltf-combine
Combine GLTF/GLB parts
https://github.com/juunini/three-gltf-combine
combine glb gltf merge threejs
Last synced: 7 months ago
JSON representation
Combine GLTF/GLB parts
- Host: GitHub
- URL: https://github.com/juunini/three-gltf-combine
- Owner: juunini
- License: mit
- Created: 2022-12-06T01:46:32.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-06T03:22:53.000Z (almost 3 years ago)
- Last Synced: 2025-02-18T00:42:59.746Z (8 months ago)
- Topics: combine, glb, gltf, merge, threejs
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# three-gltf-combine
## Install
```bash
#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
```ts
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
```ts
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,
});
```