0

I'm really struggling finding info or anything about this.

I've made a an UI list with an imported list of material and displayed on the 3d view ui panel. So far a button 'set material' is changing the material on active object and it works fine.

But I would like to remove this button and directly change the material when I press on an item in the list.

material uilist

brockmann
  • 12,613
  • 4
  • 50
  • 93
Nonitt
  • 1
  • Is your code copied from: https://blender.stackexchange.com/questions/30444/create-an-interface-which-is-similar-to-the-material-list-box/30446#30446 ? – brockmann Jun 10 '21 at 08:13
  • Yes it is, it matched perfectly my needs at a certain point. The mat list is imported from a server (that's why the load Material list is unable). – Nonitt Jun 10 '21 at 08:45
  • I got PTSD from when I tried to work with UIlists previously but as i recall, you can link the active index to an IntProperty and use the update callback to know when an element is clicked – Gorgious Jun 10 '21 at 08:52
  • @Gorgious worked perfectly ! Thank you – Nonitt Jun 10 '21 at 09:41

0 Answers0