4
$\begingroup$

I'm searching for a good way to animate a molecule-like structure with nice transitions between the spheres and the cylinders. So far, I'm using a skin modifier for the structure and a particle system to generate the spheres, but I'm afraid in this setup it would be hard to built in the tapering effect. I also tried to model the transition, but that resulted in a lot of z-fighting between the different links.

enter image description here

Here is a simplified setup to start with. On another layer, you can also find a modeled link, with the desired transition softness for reference, or to use in a different setup.

$\endgroup$
3
  • $\begingroup$ Try looking into Animation Nodes addon, it makes this much much easier. $\endgroup$
    – 3pointedit
    Commented Nov 16, 2017 at 9:48
  • $\begingroup$ probably try skin modifier but I don't know if that would work $\endgroup$
    – HenrikD
    Commented Nov 16, 2017 at 10:04
  • $\begingroup$ maybe you want this OSL shader to do smooth beveling between surfaces in render time: blender.stackexchange.com/questions/20997/… $\endgroup$ Commented Nov 18, 2017 at 13:55

2 Answers 2

15
+200
$\begingroup$

We can make use of Metaballs and Animation Nodes to achieve the desired effect.

The vertices of the mesh can be represented by a Ball Metaball, using such node tree:

Node Tree 1

We instance a Metaball Ball object, position it in place of the vertices and change its radius as we wish using an Object Attribute Output node and possibly its stiffness if you like.

Next, we can represent edges using Capsule Metaball, using such node tree:

Node Tree 2

We instance a Capsule Metaball, position it in the center of each edge, scale it using the size_x property based on the length of the edges using the Object Attribute Output node (We multiply it by 0.5 because capsule goes both ways), orient it along the edges using the Direction To Rotation node and control its stiffness and radius using Object Attribute Output node.

Which results:

Result

Blend file for study:

Animating it and using non meshes structures is pretty easy in Animation Nodes. You may ask a question specific to exactly what you want to create. An example animation:

Animation

$\endgroup$
5
  • 1
    $\begingroup$ Once again the elegance of nodes is shown! $\endgroup$
    – aliasguru
    Commented Nov 19, 2017 at 11:55
  • $\begingroup$ thank you very much for this elegant solution. Yes, I would love a little explenation on how you animated the structure. I couldn't do it with hooks and empties. $\endgroup$
    – yann
    Commented Nov 20, 2017 at 10:39
  • $\begingroup$ @omar-ahmad There are also multiple duplications of the MBall object in the world center, I couldn't get rid of. Do you know, why they are created and how I can bypass them? $\endgroup$
    – yann
    Commented Nov 20, 2017 at 10:59
  • $\begingroup$ @yann Those extra objects are the objects used as sources for the instancer node, you can include them in computations but that will require couple of extra nodes. The easiest way to remove them is by selecting them (You will notice they are the only metaballs visible in the outliner) and in edit mode, set their radius to zero. $\endgroup$
    – Omar Emara
    Commented Nov 20, 2017 at 13:45
  • $\begingroup$ @yann For the animation, please ask another question with exact description of the animation you want to achieve, tag me in there and I will answer the question. $\endgroup$
    – Omar Emara
    Commented Nov 20, 2017 at 13:48
1
$\begingroup$

Okay, I found a way that works for me. It has some flaws, but will do the trick. I just modeled the transition, kept the origin of that part where the origin of the sphere is. Adding a copy location constraint and a track to constraint makes it follow nicely.

Here is the result:

enter image description here

there still is some z-fighting, but it's better than before.

$\endgroup$
3
  • 1
    $\begingroup$ Are you still up for another hopefully better solution? I may have one. $\endgroup$
    – Omar Emara
    Commented Nov 18, 2017 at 16:06
  • 1
    $\begingroup$ @OmarAhmad Yeah! Please show me your way. There is still the bounty to give away, too. I also removed the "answered" symbol on my hacky answer. $\endgroup$
    – yann
    Commented Nov 18, 2017 at 16:11
  • $\begingroup$ Ok, will add an answer in a few minutes. $\endgroup$
    – Omar Emara
    Commented Nov 18, 2017 at 16:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .