コード例 #1
0
ファイル: maps_using_texture.py プロジェクト: AresAndy/ufoai
def check_for_texture(texname, mapname):
    ufo_map = ufomap_io.read_ufo_map(mapname)
    for i in ufo_map:
        for j in i.brushes:
            for k in j.faces:
                if k.texture == texname: #found face with that texture
                    return True
    return False
コード例 #2
0
def scale_textures(texname, mapname, scalex, scaley):
    changed = False
    ufo_map = ufomap_io.read_ufo_map(mapname, True)
    for i in ufo_map:
        for j in i.brushes:
            for k in j.faces:
                if k.texture == texname:  #found face with that texture
                    k.scale[0] *= scalex
                    k.scale[1] *= scaley
                    k.offset[0] /= scalex
                    k.offset[1] /= scaley
                    changed = True

    if changed:
        ufomap_io.write_ufo_map(ufo_map, mapname)
        print "Texture found, map updated"
コード例 #3
0
ファイル: map_scale_textures.py プロジェクト: kevlund/ufoai
def scale_textures(texname, mapname, scalex, scaley):
    changed = False
    ufo_map = ufomap_io.read_ufo_map(mapname, True)
    for i in ufo_map:
        for j in i.brushes:
            for k in j.faces:
                if k.texture == texname: #found face with that texture
                    k.scale[0] *= scalex
                    k.scale[1] *= scaley
                    k.offset[0] /= scalex
                    k.offset[1] /= scaley
                    changed = True

    if changed:
        ufomap_io.write_ufo_map(ufo_map, mapname)
        print "Texture found, map updated"
コード例 #4
0
def add_textures(texnames, mapname):
    ufo_map = ufomap_io.read_ufo_map(mapname, True)
    for i in ufo_map:
        for j in i.brushes:
            for k in j.faces:
                texnames[k.texture] = True
コード例 #5
0
ファイル: map_list_textures.py プロジェクト: kevlund/ufoai
def add_textures(texnames, mapname):
    ufo_map = ufomap_io.read_ufo_map(mapname, True)
    for i in ufo_map:
        for j in i.brushes:
            for k in j.faces:
                texnames[k.texture] = True