2
$\begingroup$

I am using the geometry nodes modifier to instance some object and then animate those instances. However, when I apply the modifier, the animation no longer works - the instances basically become frozen at their current animated position. I need have real meshes because the game engine I'm working with doesn't support Alembic. Is this expected and are there any workarounds besides e.g. writing a script?

$\endgroup$
3
  • $\begingroup$ if you animation was done with nodes in geometry nodes - yes, that's what was expected. And no, i cannot think of workaround for this except that any other software support geometry nodes as well. The "real" workaround would be to make the animation outside of geometry nodes...e.g. by keyframes. but i think you don't want that. $\endgroup$
    – Chris
    Nov 21, 2022 at 9:54
  • $\begingroup$ Thanks, that's good to know. I ended up writing a script to loop through all the frames, get the evaluated data, and create keyframes where needed. $\endgroup$
    – P. Private
    Nov 21, 2022 at 10:47
  • $\begingroup$ @P.Private That sounds like an interesting solution! Would you be so kind and could show us this and write a more detailed answer to it, so that the question can be marked as solved and others can benefit from it? $\endgroup$
    – quellenform
    Nov 22, 2022 at 12:18

1 Answer 1

2
$\begingroup$

Depending on what geometry nodes you are using, how they are configured, as well as which game engine you are exporting to, you can write a script to process the evaluated data for the object containing the geometry nodes modifier and output a new object with the modifier properly applied. Whether you add the animation directly to the object, the mesh, use shapekeys, etc. is up to your specific use case.

for frame in range(bpy.context.scene.frame_start, bpy.context.scene.frame_end + 1):
    # Evaluate the active object at the current frame.
    bpy.context.scene.frame_set(frame)
    depsgraph = bpy.context.evaluated_depsgraph_get()
    evaluated_object = bpy.context.view_layer.objects.active.evaluated_get(depsgraph)
    # Create a new "output" object if needed, then animate it.
$\endgroup$
1
  • $\begingroup$ I haven't tested this now, but thanks for your willingness to share your knowledge with others! $\endgroup$
    – quellenform
    Nov 23, 2022 at 12:05

You must log in to answer this question.

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