Page MenuHome

Fix T84420: Linking regular materials to gpencil
ClosedPublic

Authored by Falk David (filedescriptor) on Jan 6 2021, 11:47 AM.

Details

Summary

When using "Make Links"->"Materials" regular materials could be linked
onto grease pencil objects. This caused a number of issues.

The fix changes the allow_make_links_data function to make sure that
if one object is of type OB_GPENCIL, the other has to be aswell.

Diff Detail

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

Event Timeline

Falk David (filedescriptor) requested review of this revision.Jan 6 2021, 11:47 AM
Falk David (filedescriptor) created this revision.
Philip Holzmann (Foaly) added inline comments.
source/blender/editors/object/object_relations.c
1574

I think using == would be more readable.

  • Write XNOR as equality
Falk David (filedescriptor) marked an inline comment as done.Jan 6 2021, 2:35 PM
Falk David (filedescriptor) added inline comments.
source/blender/editors/object/object_relations.c
1574

That is indeed cleaner, thank you!

source/blender/editors/object/object_relations.c
1574

Why don't use?

((ob_src->type == OB_GPENCIL) && (ob_dst->type == OB_GPENCIL))

source/blender/editors/object/object_relations.c
1574

I see, the && does not work.

Not totally sure you must include the text with the task, ask to someone else about that, but the fix LGTM.

This revision is now accepted and ready to land.Jan 6 2021, 3:45 PM