Writing a custom Modifier

Hi all,

so can you roll your own modifiers? Some quick searching seems to suggest the answer is ‘no’, but I just wanted to make sure.

Thing is, I’m making an addon to smooth a selected mesh/edgeloop by extending the mesh by adding some extra verts/edges/faces. It would ideally have some properties you could change (*) and see the effects of in real time, just like you’d have in an ‘add-mesh’ addon. But I’d rather change the existing mesh than creating a new one, as you may not want to lose other data (eg, uv’s) on the Original mesh. So writing a modifier seems the way to go, right?

Here’s an example of how this might work:


(*) Red Arrow illustrates user defined parameter
The centre green quad/polygon is the starting/selected object/edgeloop, and the mesh should by extended to include the yellow geometry when this modifier is active.

So I know how this algorithm and its parameters and all should work, but how do I make this functionality available to the user in the most natural/blender-like way?
TIA!

No, not without writing it in c in a Blender build. I wish we could. Being able to write non-destructive addons would be awesome.

Yeah, modifiers are out, but you could do it as an operator that copies over the custom data, but it wouldn’t be quite as tightly integrated as a modifier.

. It would ideally have some properties you could change (*) and see the effects of in real time, just like you’d have in an ‘add-mesh’ addon. But I’d rather change the existing mesh than creating a new one, as you may not want to lose other data (eg, uv’s) on the Original mesh. So writing a modifier seems the way to go, right?
To see changes in real time are not exclusively for modifiers. Other tools you can change the settings and see their effects (bevel tool, spin tool, inset tool, grid fill etc). The bevel and inset tools for example also maintain the mesh data such as UVs

Ok, thanks for the info/suggestions, everybody, much appreciated!

Just letting y’all know I’ve released the addon I was talking about: https://blenderartists.org/forum/showthread.php?413839-Addon-Smooth-Edge-Loop

It happens to only be usable in edit mode, which means that the generated geometry is added to the selected mesh. That’s kind of similar to how a modifier works, I guess.

Feel free to check it out!

1 Like