How to check the activation state of material texture parameter determined by StaticSwitchParameter using UMaterialInstance

I have wrirtten a plugin to export resource from UE project. I setup a shader graph in UE using a StaticSwithParameter. I would like to control whether or not to export a certain texture determined by activating the static switch so that I can use UMaterialInstance::TextureParameterValues to iterate the panel variables that are only activated by the StaticSwitchParameter.
Like followings:

When the static swith havexxx is unactive, there are only 3 textures on the panel.
When the static swith havexxx is active, 4 textures are on the panel.
But UMaterialInstance::TextureParameterValues holds all 4 textures no matter what the situation is.
I was wondering if the editor reflects the active state of shader varible by static switch into TextureParameterValues when I change any configuration in the panel. Or is there a way to realize my needs?
Thanks a lot !!