1
$\begingroup$

I'm tasked with creating an animation for some expanding foam insulation, and I'm trying to figure out how this might be done with my current approach. At the moment, I have two geometry node setups: one for a ring of fresh, non-expanded foam, and another for a ring of expanded foam (I can share these nodes if and when it becomes necessary, but I think it's unimportant right now). Both are intended to be resizable on-the-fly.

Neither setup has had the modifier applied to turn them into realized objects (i.e. objects with real data for vertices and such; alternatively, in the Spreadsheet window, there is no mesh data), nor have they had the Realize Instance node applied--they currently just exist as instanced geometry--for the reason that the scene in which they're being used already has tens of millions of polys (cannot fix this for now), and so I don't want to take more of a performance hit than necessary when using these--if I can get it to render successfully, it works for my purposes.

That said, what I'm looking to do is blend between the two objects so that I can create an at least somewhat realistic animation of the foam expanding. Having done a bit of reading, it looks like that should be possible using shape keys, but because there are no real objects or vertex groups to reference, I'm not sure how to accomplish this effect. One thread that I've found (link below), if I've read it correctly, suggests that it would be possible to mimic the effect of shape keys through geometry nodes, but I'm unclear as to whether or not there would still need to be realized objects for the effect to work.

Is it possible to use shape keys--or something similar--in this instance? If not, is there currently (v3.4.1) any way of achieving the effect of blending between the two objects?

I'm not confident that my terminology is correct or used to best effect here (please be kind), and I realize that I might be going about this in the "wrong" way, so if there is any confusion or need for clarification, I am more than happy to try to rephrase or provide another explanation. I will also be editing the post to reflect any necessary changes to the language/phrasing as they arise.

EDIT 1: I've attempted to implement one of the solutions as mentioned below, but without much success. Here is the current node setup for the object that I'm attempting to morph: Setup for the geometry nodes object to be morphed

All it does is this: GIF of the factor adjustment via geometry nodes

To maybe be more clear, is there a way to get the torus on the right to morph into the object on the left?

EDIT 2: After more closely matching the edit in the solution below, the transition is closer, but not quite there yet:

Second attempt, with slightly altered nodes and settings

Is there anything that I might be missing? I can think of only a couple of details that might otherwise be affected:

  1. The interior radius of the torus seems to be disappearing in the transition.
  2. The target shape does have additional geometry instanced onto it, like an instance with instances, so maybe that prevents it from morphing correctly. I did try muting the nodes that were responsible for this, though, and it didn't seem to affect much.

EDIT 3: Here is the .blend file in question:

TL;DR: I need to create a realistic animation of some expanding foam. How might I be able to blend between the non-expanded foam and the expanded foam when neither technically has real geometry (add: is there a "best/sufficient/different/only" way to do accomplish this that is not mentioned herein)?

Link(s) Mentioned: How to create Shape Keys in Geometry Nodes, including support for curve handles?

$\endgroup$
4
  • $\begingroup$ Hello and welcome to Blender.SE! Please be so kind and share your blend file with blend-exchange.com (follow the instructions there and copy the generated code into your question). Since the answer below didn't help you, there is obviously a quirk with your mesh here. $\endgroup$
    – quellenform
    Jan 19, 2023 at 11:00
  • $\begingroup$ I'm currently waiting on the file to process. Thank you for your help, and I'm sorry if I've been causing any problems here. $\endgroup$
    – NickJ_001
    Jan 19, 2023 at 15:27
  • $\begingroup$ I should also note that I've made a few changes to the file since the start of the post. Both objects have real geometry now, but that hasn't made much of a difference, if any. The thing that I'm trying to accomplish is maybe a little too specific or local only to my current needs, but I'm trying to keep the question as generic as possible so that hopefully it can remain useful for someone else. $\endgroup$
    – NickJ_001
    Jan 19, 2023 at 15:40
  • 1
    $\begingroup$ The foam has 35000 vertices, the torus has 1024 vertices. Therefore their topology doesn't match. ${35896 - 1024\over35896} = 97% of vertices won't be used in the interpolation, because only indices 0..1023 will be sampled. This could theoretically be intended, but in reality you want the entire geometry to map to the other entire geometry, so you want to have the same number of vertices (and that's just the start, the vertices can't just have random indices, they need to be positioned by the same logic, e.g. relation to polar coordinates). $\endgroup$ Jan 19, 2023 at 19:45

1 Answer 1

1
$\begingroup$

Shape Keys is a feature to interpolate between two geometries. You can also interpolate in geonodes - simply calculate two positions, and use Mix node to interpolate between them.

To morph between two geometries, just sample the same index of the other geometry:

$\endgroup$
9
  • $\begingroup$ Does this account for the fact that, in my case, there are two separate objects? If I'm understanding correctly, the example that you included is contained in a single object that alters its own geometry using noise, rather than taking on the existing geometry of another object. $\endgroup$
    – NickJ_001
    Jan 17, 2023 at 21:22
  • 1
    $\begingroup$ @NickJ_001 just like with shape keys, you need somehow compatible topology (e.g. the same number of vertices). Then you can e.g. sample the position of another geometry by index. $\endgroup$ Jan 17, 2023 at 21:37
  • $\begingroup$ I'm not sure that I understand. The part about the compatible topology makes sense, I think (you can't just blend two shapes with different numbers of vertices, for example, because how would the objects interpolate properly?), but how do you sample external geometry? You're saying it's by index, which I would think means the Index or Sample Index node--does this work by effectively "importing" the geometry of the other mesh? On a separate note, I'm struggling to tag your username (or it's not visible on my end). $\endgroup$
    – NickJ_001
    Jan 17, 2023 at 21:46
  • $\begingroup$ @NickJ_001 it means for any point with index i you can read your own position and the position of the point with same index i in some other mesh. Then you have two positions and can apply the solution from this answer. $\endgroup$ Jan 17, 2023 at 21:49
  • $\begingroup$ Apologies for having to ask, but in place of your Noise Texture node, I'm trying to use an Object Info node to instead get the geometry of my other object, but it doesn't look like the nodes match up. Is there a node that allows for this using your solution? $\endgroup$
    – NickJ_001
    Jan 17, 2023 at 22:00

You must log in to answer this question.

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