SSmolak wrote:Is there way to change compression only for textures that have "diffuse" in their name for example ? Unfortunately change compression globally for selected textures in Octane Texture Manager is not possible for many of them selected - it ask for every texture.
Code: Select all
import c4d
ID_OCTANE_IMAGE_TEXTURE = 1029508
def collect(shdList, n):
    if n is None:
        return
    if n.GetType() == ID_OCTANE_IMAGE_TEXTURE:
        ix =- 1
        try:
            ix = shdList.index(n)
        except:
            ix = -1
        if ix == -1:
            shdList.append(n)
    if n.GetDown():
        collect(shdList, n.GetDown())
    if n.GetNext():
        collect(shdList, n.GetNext())
def main():
    doc = c4d.documents.GetActiveDocument()
    matList = doc.GetMaterials()
    for mat in matList:
        shaders = []
        collect(shaders, mat.GetFirstShader())
        for shader in shaders:
            if 'diffuse' in shader[c4d.IMAGETEXTURE_FILE].lower():
                shader[c4d.IMAGETEX_COMPR_FORMAT] = 0
if __name__ == '__main__':
    main()This line is where you choose the parameter, you can use trial and error
 
Code: Select all
shader[c4d.IMAGETEX_COMPR_FORMAT] = 0 
                                                                
                             
						










