CombineChildrenBones

From Unify Community Wiki
Revision as of 21:55, 13 May 2009 by Mklaurence (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Author: Mike Laurence (http://mikelaurence.com), with much of the code extracted from everyone's favorite CombineChildren script.

Functionality: This script combines all MeshFilter meshes (e.g., static meshes without bones) in its children into a single SkinnedMeshRenderer. Thereafter, it automatically updates the transforms of the bones to match any changes to the original GameObjects.

Caveats:

  • This script appears to have very similar functionality to the MeshMerger script, though with much more code. Since I used CombineChildren as the base for this script, I'm not sure how much is really necessary. Perhaps someone can do a comparison between the two (hopefully with benchmarks!)
  • Multiple materials are not yet supported
  • The destroy function is not yet implemented
  • Cutting down to a single draw call does not necessarily give you a performance increase. In fact, in my own case, this script didn't help at all! Constantly transforming bone vertices is cpu-intensive, and on the iPhone I had a significant frame rate drop using this script as opposed to just having 10 draw calls of my individual objects.
  • The script is kind of ugly, as I've left in comments of what I changed from the original CombineChildren script. Those can probably be erased, but at least they're here in the wiki history for posterity!
Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox