Page MenuHome

Fix T90907: RNA pointers for material slots are not unique across IDs
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Aug 26 2021, 12:18 PM.

Details

Summary

Caused by rB1a81d268a19f: Materials: support changing materials during evaluation.

This caused e.g. ALT-clicking the 'Link' button to not propagate to
other selected objects (same as the 'Copy To Selected' context menu
entry).

If these are not unique across IDs, checks in ui_selectcontext_begin()
or copy_to_selected_button() could fail.

Now offset by ID pointer.

thx @Jacques Lucke (JacquesLucke) for clarification on the POINTER_* macros (and why
not to use them)!

Diff Detail

Repository
rB Blender

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Aug 26 2021, 12:18 PM
Philipp Oeser (lichtwerk) created this revision.
  • dont use POINTER_AS_INT on 64bit pointer
Jacques Lucke (JacquesLucke) requested changes to this revision.Aug 26 2021, 12:51 PM

I think this could should just not use the POINTER_* macros at all. Those are meant to be used when converting indices to pointers and back.

source/blender/makesrna/intern/rna_object.c
1330

This is still using POINTER_AS_INT on a pointer. This works by accident.

This revision now requires changes to proceed.Aug 26 2021, 12:51 PM
  • dont use POINTER_* macros at all here
Philipp Oeser (lichtwerk) marked an inline comment as done.Aug 27 2021, 9:20 AM
Philipp Oeser (lichtwerk) edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Aug 27 2021, 10:47 AM