• Stars
    star
    120
  • Rank 294,616 (Top 6 %)
  • Language
    C#
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A much faster implementation of combining skinned meshes without messing with skinned mesh prefabs

fast-skinned-mesh-combiner

A much faster implementation of combining skinned meshes in Unity without messing with skinned mesh prefabs.

This is a MUCH better implementation of an older script I made: https://github.com/joshcamas/skinned-mesh-combiner

Most skinned mesh combiners require actual SkinnedMeshComponents to base the data off of - this means it's a bit slower, since if you want to create a character with a lot of skinned mesh parts, you'll need to first create each individual skinned mesh renderer and bone transforms, then you'll need to merge them and destroy the old renderers.

This solution skips this issue - simply create a single rig, then give it a bunch of meshe datas - it then spits out a single SkinnedMeshComponent.

Features

  • Quite fast!
  • Shape Keys (supports 1 frame)
  • Optionally can apply UV's as it goes - this can be used if you're generating an atlas beforehand

Limitations

  • Single material
  • All meshes must have the same bone weights
  • Still slow due to unity shenanigans - specifically AddBlendShapeFrame is ridiculously slow, costing up to 1ms per call
  • All done on a single frame. On my personal version I've modified this to take multiple frames when desired, making it much less destructive to your main thread. If anyone wants this version, please make a issue for it, and I can upload it. :)

Usage

//Create Rig (Often from an FBX)
GameObject rig = GameObject.Instantiate(myRig);

//Find the "packed" renderer, which has bone info
SkinnedMeshRenderer rigRenderer = rig.GetComponentInChildren<SkinnedMeshRenderer>();
Transform[] bones = rigRenderer.bones
Transform rootBone = rigRenderer.rootBone;

//Pack! (In this case, by overwriting the already existing renderer found on the rig)
SpellcastStudios.MeshCombiner.CombineFast(rigRenderer,rootBone,material,bones,meshes);

Todo

  • Remove odd implementation of rootBone
  • Show how Atlas can be used

More Repositories

1

unity-domain-reload-helper

A couple of attributes that help disabling Domain Reloading in Unity easier
C#
172
star
2

prefab-library

A helpful unity window to aid in world building / prefab organization
C#
99
star
3

unity3d-billboard-generator

A (Designed for foliage) Billboard Generator
C#
47
star
4

skinned-mesh-combiner

A Skinned Mesh Combiner that doesn't require actual skinned meshes as inputs
C#
44
star
5

UnityCodeEditor

A generic syntax highlighter / code editor built into Unity
C#
21
star
6

unity-ragdoll-culler

A simple component that bakes ragdolls once all rigidbodies fall asleep
C#
19
star
7

unity-mesh-triangulator

A modified version of alexmuab's unity-mesh-triangulator
C#
15
star
8

moss-painter

Prototype Unity tool to paint moss geometry on top of scene geometry
C#
10
star
9

gitgud

A simple unity-based git client with a focus on extendability
C#
8
star
10

unity-prefab-collections

A simple tool to make nested prefabs more powerful
C#
7
star
11

arden-audio-system

Sound manager with pooling, volumes, playlists, sound materials, and more for Unity
C#
5
star
12

screen-lapse

A simple python application that allows for recording screens over long periods (ie speedpaints)
Python
3
star
13

daggerfall-unity-mods

A collection of the sourcecode for my small daggerfall unity mods
C#
2
star
14

EventStack

Add events and mods to Unity3D with ease
C#
2
star
15

cached-reflection

Bite-sized reflection cacher for C# to make reflection speedy fast
C#
2
star
16

mlf-unity

The Multi Language Format interpretor for Unity3D
C#
1
star
17

terrain-mesh-generator

Generates a mesh based on a Unity Terrain. Supports level of detail and edge generation.
C#
1
star
18

lilygo-watch-2020-virtualpet

Virtual Pet built with the LilyGo TTGO T-Watch 2020
C
1
star
19

world-date-and-time

Simple C# time and date
C#
1
star
20

mlf-snekscript

A runtime python engine utilizing the Multi Language Format in Unity3D
Python
1
star