예제 #1
0
def apply(cat: GenCat,
          face: Side,
          tex_name: str,
          portalable: Portalable = None,
          normal: Vec = None,
          loc: Vec = None):
    """Apply directly to a face, optionally using that to retrieve the location."""
    if cat is GenCat.SPECIAL or cat is GenCat.OVERLAYS:
        generator = GENERATORS[cat]
    else:
        if normal is None:
            normal = face.normal()
            normal.z = -normal.z
        generator = gen(cat, normal, portalable)

    if loc is None:
        loc = face.get_origin()

    face.mat = generator.get(loc, tex_name)