I made this script to merge Color mask selections into blend trees node ,and I want it to share it with the community for free use . It was born because I work with Udim maps with lots of color masks for hi res geo, so I had to do this blend trees structures by hand.
It also was a nice practice for my python dev skills, so any feedback on the code or any further dev is very welcome. It uses a recursive function to do the magic.
To use it just select the color masks nodes and run the script.
I use to build the color maps in the SD baker by using geometry groups, so as a suggestion for the SD devs it would be nice if one could just press a button to assign random colors to each group and create the color masks nodes set with this same colors and the group names, this is still very painfull to do for large amount of groups .