1
$\begingroup$

I'm working on a rather complex animation where I plan to use Metaballs to shape a certain geometry in combination with Animation Nodes. I have managed to get what I want by using the Object Instancer node, and the result looks just fine. But the Viewport becomes unbearable slow because of the high amount of Objects in the scene. The Polycount thanks to Metaball merging would not be an issue though.

To improve that interaction performance, I'd like to place, add and edit my metaballs in Edit Mode instead. Is this possible? Merging the Object Instances into one new target mesh would by the way also work for me, I just couldn't find a node that does this.

$\endgroup$
1
$\begingroup$

You can use a simple script as follows, you access the required metaball data block by name, clear its balls, and add new metaballs and edit their attributes like location and radius:

Node Tree

mball = bpy.data.metaballs[name]
mball.elements.clear()
for v, r in zip(locations, radii):
    ele = mball.elements.new()
    ele.co = v
    ele.radius = r

The API describe the possible attributes per ball.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Fantastic answer as always. I've improved it slightly by adding a target socket and filling the metaball data with mball = Target.data, so I can interactively set it. The speedup is enormous, funnily also concerning generation of a solution in general. $\endgroup$ – aliasguru Nov 16 '18 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.