I’m a bit lost (due to my lacks in python…).
I wrote a thermic plugin for architecture, with a part dedicated to ‘R’ calculation and attribution of A++,A+,A,B… labels.
Everything works almost fine (even external icons) but the ultimate goal would be to change the diffuse color of the material in function of this label(result).
At this stage I’m into a def draw, and the codes I’ve commented in the image always return me ’ Writing to ID classes in this context is not allowed’.
Does anyone have an idea on a workaround?
codes and test scene can be found here:
I hope I’ve been understandable, thanks in advance!
to be complete I also tried to pass by a button that edits all material slots with a color parameter(here is the class code where mat color is a material custom property):
def execute(self, context):
for i in bpy.context.active_object.material_slots:
it was nearly working, but it gave the same mat_color at every material slot…(didn’t understand why … object oriented things maybe)