property collection enum sorting

Hi all,

I have another problem with my energy script, here is the test file (run script and go to materials panel to see its effect): ennergetic4.blend (1.89 MB)

the goal is to create materials layers to calculate energetic deperdition of walls roofs etc…

thanks to Uncle Entity, I added a bpy.props.CollectionProperty class to manage new variables, but I have a problem:
in the beginning of the script, I introduce 2 lists a little one with the material families (metals plasters etc…), in the second, a big one with the materials properties (name , lambda, basic thickness, translations…)
the first term of the first list refers to the second term of the second list.

what I’d like is that when people choose ‘metals’ in the first enum, the second enum should only contain the terms of the metals family.( see screenshot)



it’s ultra basic but it make 3 days that I turn around it trying to pass a parameter to the collection without success… 2 questions then:

  • are my ‘global’ lists a good way to pass variables?
  • how can I take only one kind of my materials using a parameter?

thanks again in advance folks! (hope I’ve been understandable)


tmaes

so… I haven’t found yet.
I’ll take the quick-win and make 14 ‘else if’ to sort my materials.

thanks anyway.