keenanwoodall / Deform

A fully-featured deformer system for Unity that lets you stack effects to animate models in real-time
MIT License
3.3k stars 226 forks source link

Need help making overlaying bends [Help wanted] #28

Closed mdiken closed 4 years ago

mdiken commented 4 years ago

Hi, I'm using multiple bends in one mesh in order to have an image like a cream flowing (think soft-serve ice cream). In order to have this imagery, I add one bend deformer to the mesh, move the deformer's transform with the bend angle set to some angle <90, and then set the angle to 180, and do the same move again in the opposite direction with another bend. My problem here is the second layer's bend also affects the first layer.

Here is an image of the problem: image

keenanwoodall commented 4 years ago

The reason this is happening is because the bend deformer extends infinitely on the xz plane. I designed a lot of these deformers to mimic the ones in Cinema 4D, and that is how the deformer works in the software.

2019-12-10_10-54-37

However I totally get that you want to be able to chain them together without worries about them overlapping. I'm not entirely sure the best way to go about it, but I made a modified version of the bend deformer that only modifies vertices within a bounding box. I threw it together really quickly, so if something isn't working the way you need let me know and I'll do my best to improve it for you.

https://gist.github.com/keenanwoodall/105a66e75f4270e83437a804eb823145