Copy bitmap path and add an appendix
I am new to Max script so I am sure that I simply miss something obvious :-(
I use the following code to copy a bitmap texture from one slot to another:
meditMaterials.opacityMap = meditMaterials.diffuseMap
This works fine, but sometimes I want to add an appendix to the filename, so I wanted to use the following code:
basis = meditMaterials.specularMap.fileName
anhang = "_a"
komplett = basis+anhang
meditMaterials.specularLevelMap.fileName = komplett
This also works - but just almost. As the script does about the same what you normaly could do manualy via rightclick and Copy/Instance, there is one quirk.
The script takes the original name, adds the appendix _a and puts it into the new slot. But as this is a instance, the original path also is changed and gets the appendix.
What do I have to do, that the “original” bitmap filename stays untouched and only the copy gets the appendix.