AlwarrenSidh / ArmAToolbox

Arma Toolbox for Blender
GNU General Public License v3.0
86 stars 38 forks source link

Made a adjustment to make the RVMatTools.py work on a windows installation with Danish language #18

Open hlyl opened 4 years ago

hlyl commented 4 years ago

The resulting texture from the below code start with a " char this makes the copy and move fail I have introduced the following code in line 150 and then it works: texture = texture[1:]

don't understand why the texture = texture.strip("\"") remove the "

def rt_readTextures(rvMatFile):
    textures = []

    with open(rvMatFile) as f:
        content = f.readlines()
        content = [x.strip() for x in content]

    for l in content:
        if "texture" in l.lower():
            t = l.split("=")
            if len(t) == 2:
                texture = t[1]
                if texture.rfind(";") >= 0:
                    texture = texture[:-1]
                texture = texture.strip("\"")
                texture = texture.strip("'")
                texture = texture.strip()
                texture = texture[1:]
                print("==", texture)
                if texture[0] != '#':
                    textures.append(texture)

    return textures