Page MenuHome

Initial step for IDType refactor 'cleanup' project.
ClosedPublic

Authored by Bastien Montagne (mont29) on Feb 28 2020, 2:53 PM.

Details

Summary

Introduce new IDTypeInfo structure.

Each ID type should have its own, with some minimal basic common info, and callbacks.

This patch only does it for Object type, for demo/testing purpose. Moving all existing IDs would be a goal of "cleanup Friday".

Note that BKE_idcode features should then be merged back into BKE_idtype - but this will have to be done later, once all ID types have been properly converted to the new system.

One of the things am not sure about in this code is the handling of NULL callbacks, in one case we then use a default generic function from BKE_lib_id (for make_local), in the others we just assume we do not have anything to do... This convenient (less verbose), but maybe we should be more consistent and enforce explicit assignment of BKE_lib_id_make_local_generic to make_local for types that can just use the generic process?

This is part of T73719.

Diff Detail

Repository
rB Blender

Event Timeline

This matches what I had in mind, and indeed idcode.c would logically be merged into IDTypeInfo as well.

source/blender/blenkernel/intern/object.c
171

ACTION -> OBJECT?

Bastien Montagne (mont29) marked an inline comment as done.Mar 3 2020, 6:57 PM
Bastien Montagne (mont29) added inline comments.
source/blender/blenkernel/intern/object.c
171

Eeek, yes indeed, thanks!

Bastien Montagne (mont29) marked an inline comment as done.
  • Merge branch 'master' into idtype-refactor
  • Fix dummy typo.
  • IDTypeInfo: add remaining needed callbacks.
  • Merge remote-tracking branch 'origin/idtype-refactor' into idtype-refactor
  • Merge branch 'master' into idtype-refactor
  • Update Object IDTypeInfo with new callbacks.
  • Use new idtype callbacks in id_lib code.
Bastien Montagne (mont29) retitled this revision from Initial demo step for IDType refactor 'cleanup' project. to Initial step for IDType refactor 'cleanup' project..Mar 4 2020, 5:39 PM
Bastien Montagne (mont29) edited the summary of this revision. (Show Details)

This looks fine, assuming debug prints will be removed still.

This revision is now accepted and ready to land.Mar 4 2020, 6:08 PM

Thanks, I'll go on a last checkup (and cleanup of debug stuff indeed), and then commit to master, and update doc for tomorrow's Cleanup Friday then.