Yes, that works, but you may want to cast to material interface instead so that it can also take material instances (you can see that the set material node takes a material interface).
Yes, that works, but you may want to cast to material interface instead so that it can also take material instances (you can see that the set material node takes a material interface).