Or you use VEX to apply UV coordinates onto the roof:
// VERTEX WRANGLE
float s = ch('uv_scale');
vector up = {0,1,0};
vector nml = normalize(prim_normal(0, i@primnum, 0.0, 0.0));
vector tang = normalize(up - dot(nml, up) * nml);
vector bitang = normalize(cross(-nml, tang));
vector pos_rel = v@P - prim(0, 'P', i@primnum);
float u = dot(pos_rel, bitang);
float v = dot(pos_rel, tang);
v@uv = set(u, v, 0.0) * s;
Align each polygon to the bottom left corner of the UV space:
// VERTEX WRANGLE
string geo = geounwrap(0, 'uv');
vector size = getbbox_min(geo, itoa(i@primnum));
v@uv -= size;
roof.hip