I want to append the string "$basetexturetransform" "center .5 .5 scale 4 4 rotate 0 translate 0 0"
(including the quotation marks) as a new line under every line that contains the string $basetexture
.
So that, for example, the file
"LightmappedGeneric"
{
"$basetexture" "Concrete/concrete_modular_floor001a"
"$surfaceprop" "concrete"
"%keywords" "portal"
}
turns into
"LightmappedGeneric"
{
"$basetexture" "Concrete/concrete_modular_floor001a"
"$basetexturetransform" "center .5 .5 scale 4 4 rotate 0 translate 0 0"
"$surfaceprop" "concrete"
"%keywords" "portal"
}
and I want to do it for every file that has the file extension ".vmt" in a folder (including sub folders).
Is there an easy way to do this in Python? I have like 400 .vmt
files in a folder that I need to modify and it would be a real pain to have to do it manually.