Page MenuHome

Duplication in template_ID: take User Preference for duplicating actions into account
Needs RevisionPublic

Authored by Philipp Oeser (lichtwerk) on Oct 8 2020, 12:54 PM.

Details

Summary

This is a followup to rBf79b4850fb3c as discussed in D9046.

When creating new Materials or Worlds through the buttons in
"template_ID", as well as making single users through that template,
actions were always copied. Now respect the User Preference under
Editing > Duplicate Data, and only copy actions if this option is
chosen.

Note: Object > Relations > Make Single User is unaffected by this change
(this is a different beast where 'Materials' _will_ copy actions,
whereas 'Data' wont... maybe we should also take the User Preference
into account here?)

Diff Detail

Repository
rB Blender
Branch
copy_actions_userpref (branched from master)
Build Status
Buildable 10632
Build 10632: arc lint + arc unit

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Oct 8 2020, 12:54 PM
Philipp Oeser (lichtwerk) created this revision.

deduplicate code into own function

Bastien Montagne (mont29) requested changes to this revision.Oct 9 2020, 2:03 PM
Bastien Montagne (mont29) added inline comments.
source/blender/blenkernel/BKE_lib_id.h
240

Would make this more generic, so that it can be used more/extended later maybe. Also, pass explicitly an eDupli_ID_Flags parameter, BKE should typically not go checking in user preferences, this is a task for ED code.

Something like that:

int BKE_id_copy_flags_from_dupflags(eDupli_ID_Flags dup_flags);
source/blender/blenkernel/intern/lib_id.c
538

Do not add default generic flags either, so do not include LIB_ID_COPY_ACTIONS in returned value, only add specific flags in reactions to the content of dup_flags.

This revision now requires changes to proceed.Oct 9 2020, 2:03 PM