Materials - TextureEvaluator fails if filtering is enabled

Hi @andy and @nathanletwory,

while i was trying to port some code from Rhino 6 to 7, i’ve found that TextureEvaluator() fails because in RH7, the “Enable filtering” checkbox gets automatically enabled if any image is chosen under Bitmap Texture Settings for a material. So it just returns zeros instead of grayscale values from my bitmaps.

This was not the case in RH6. I do agree that the filtering creates better visual texture quality but is there a way to disable the filtering programmatically for a material or can i make this work with the TextureEvaluator ?

As a side note, “Use alpha channel” is also checked by default for every bitmap chosen, even if the file format does not support it. Wouldn’t it make sense to disable that checkbox for all bitmap formats except png, tif and tga ?

_
c.

Answering my own question, bitmap filtering can be disabled like this in python:

slot = Rhino.Render.RenderMaterial.StandardChildSlots.Diffuse
texture = obj.RenderMaterial.GetTextureFromUsage(slot)
if texture:
    if System.Convert.ToBoolean(texture.GetParameter("filter")) == True:
        context = Rhino.Render.RenderContent.ChangeContexts.UI
        texture.SetParameter("filter", False, context)

thanks,
c.