Page MenuHome

Fix T94559: Copying a geometry node group does not copy animation data
ClosedPublic

Authored by Angus Stanton (abstanton) on Apr 11 2022, 3:35 AM.

Details

Summary

Reimplement copy geo nodes in c.

This is done because the copy() function called in the python version
does not copy the animation data. This causes duplicate node trees to affect
the animation data of originals. Therefore, it has been reimplemented in C.

Diff Detail

Repository
rB Blender
Branch
T94559-geo-nodes-copy (branched from master)
Build Status
Buildable 21608
Build 21608: arc lint + arc unit

Event Timeline

Angus Stanton (abstanton) requested review of this revision.Apr 11 2022, 3:35 AM
Angus Stanton (abstanton) created this revision.
source/blender/editors/object/object_modifier.c
3343

Oops, forgot to remove this after copying, will do that

Not sure whether this code should be in object_modifier.c or a node operator in say node_add.cc. The only thing stopping me put it as a node operator is that 1. It assigns the node group to the object, and 2. It's specific to geo nodes, not generic for all node trees

  • Remove unnecessary update flags and RNA props

WELL I can approve that it's working well

BTW thanks for helping me understand how blender works

Is this WIP for a specific reason? It looks pretty good to me. I just added a few comments about formatting inline.

release/scripts/startup/bl_operators/geometry_nodes.py
83

Keep two lines of white-space here.

source/blender/editors/object/object_intern.h
204

Keep an empty line after the last declaration.

source/blender/editors/object/object_modifier.c
3298

Use title-case in these section names.

3313

I think avoiding newlines before the null checks makes it a bit easier to read, and more clear that the null checks are associated with the previous declaration.

Angus Stanton (abstanton) marked 4 inline comments as done.
  • Address Comments

Is this WIP for a specific reason? It looks pretty good to me. I just added a few comments about formatting inline.

Just forgot to remove the WIP tbh. So do you think it's fine to have it as an object operator? If so then I hope it's done now.

Great, thanks.

So do you think it's fine to have it as an object operator? If so then I hope it's done now.

I don't see why not, there are plenty of other object operators relating to modifiers in this file.

This revision is now accepted and ready to land.Apr 12 2022, 8:57 PM

Do you mind updating the description to describe the change and the reasoning for moving the operator to C? I'll use that as the commit message then.

Hans Goudey (HooglyBoogly) retitled this revision from T94559 - Reimplement copy geo nodes in c to Fix T94559: Copying a geometry node group does not copy animation data.Apr 12 2022, 8:59 PM

Do you mind updating the description to describe the change and the reasoning for moving the operator to C? I'll use that as the commit message then.

All done

Thought I'd just ping @Hans Goudey (HooglyBoogly) , is this good to go?