In the second code snippet, is T::StaticClass() meant to be UMaterial::StaticClass()?
T::StaticClass()
UMaterial::StaticClass()