I’ve written a new version from scratch! It’s objectively better and you should totally check it out! Here’s a little teaser.
Deform is a framework for deforming meshes in the editor and at runtime that comes with a component based deformation system build on top. If you don’t want to make your own deformers, it comes with many standard ones you’d find in 3D modeling packages.
- If you are using this in a pre-existing project, you need to go to Edit/Project Settings/Player/ and set the Scripting Runtime Version (under the Other Settings dropdown) to 4.6.
- Right now this project is not suitable for professional development. Don’t use it on large projects unless you are happy with the feature-set at the time of downloading/cloning it. If you aren’t using version control DO NOT update to new versions of this system without backing up your project. Stuff you’ve made will break 99% of the time because I’m doing large/sweeping changes almost every time I push.
How it works
- Find a game object (with a mesh filter or skinned mesh renderer) in your scene.
- Add any deformer component.
- That’s it. Your mesh is deformed.
- Runs in edit and play mode
- Multithreaded (optional)
- Meshes can be saved
- Deformers can be stacked and reordered
- Works with skinned meshes (kinda)
- Easily Extendable
- Color Mask
- Noise (Value, Perlin, Simplex, Cellular, Cubic)
- Pivot To Bounds
- Pivot To Center
- Scale Along Axis
- Scale Along Normal
- Squash and Stretch
- Texture Mask
I don’t want all the fluff. What can I safely remove?
- You can delete everything except for the Code and Plugins folder.
How do I make my own deformer?
- Make a script that uses the Deform namespace
- Inherit from the ‘DeformerComponent’ class.
- Override the ‘Modify’ method.
- Make changes to the mesh data and return it.
- Drag your script onto any object with a MeshFilter or SkinnedMeshRenderer.
- Mission complete.
What is the MeshData struct?
- It holds the positions and normals (as well as some other stuff) of a mesh.
Why am I getting the error,
xxx can only be called from the main thread?
- Unity locks access to most things from other threads. You are probably accessing something like a Transform component from inside the
Modifymethod, which runs on another thread when UpdateMode is set to UpdateAsync. I recommend overriding the virtual method,
PreModify, and caching anything you need that is inaccessable from another thread.
PreModifyis called on the main thread right before any deformations calculations are run.
Why am I getting the error,
xxx asynchronous functions cannot be used because it is not part of the C# 4.0 language specification?
- You need to go to Edit/Project Settings/Player/ and set the Scripting Runtime Version (under the Other Settings dropdown) to 4.6.
- Please send any suggestions/feedback to [email protected]
- Pull requests are welcome!