Blender Git Loki

Git Commits -> Revision e0a0770

Revision e0a0770 by Philipp Oeser (master)
April 2, 2021, 19:23 (GMT)
GPencil: Prevent RNA assignment of invalid materials in modifiers

Materials used in grease pencil modifiers have the requirement that they
are already used on the object. In the UI dropdown, this restriction is
ensured by calling uiItemPointerR with appropriate searchptr and
searchpropname, so only giving the user the choice of materials already
used on the object.

From python though, it was still possible to assign materials outside of
this this restriction. This led to reports like T86981 [which have been
partially solved by clamping the material index in the modifier code to
be in the valid range].

Now make sure we dont assign "invalid" materials through RNA by
appropriate RNA pointer functions.

This also adds a proper warning (red, alert) in case of the LineArt
modifier if such a invalid material is still in the file [same as other
modifiers already do].

Differential Revision: https://developer.blender.org/D10873

Commit Details:

Full Hash: e0a07700bfbe3a4d64e65d0d51adb8c44ef105d7
Parent Commit: fcc3227
Lines Changed: +290, -2

2 Modified Paths:

/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c (+20, -2) (Diff)
/source/blender/makesrna/intern/rna_gpencil_modifier.c (+270, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021