I have two cubes obj1
and obj2
and I have a list which has a pair of face numbers of each object. So for example, mylist
looks like that [(1,5),(2,5),(2,3),(1,4),(2,1)]
, where (1,5)
represents face number 1 in obj1
and face number 5 in obj2
, and (2,5)
represents face number 2 in obj1
and face number 5 in obj2
and so on.
I wonder how using python I can assign a material of color red to those faces in the list, while the rest of the faces not in the list will be assigned a metrial of color green.
I figured a way to do it in my below answer but it's very slow, so I wonder if it can be more efficient and done in a more efficient way as I run this function every frame.