Python for Texture Nodes

Been looking around and I can’t seem to find it. Is there any way to access texture nodes with Python? I’d like to be able to access specific Nodes, if that’s possible. Specifically in the BGE.

You should be able to do it like this: <your_gameobject>.materials[<material index>].node_tree.nodes[<node_name>]

You should be able to access a texture node like this: <your_gameobject>.material_slots[“Material”].material.node_tree.nodes[“Image Texture”]

This is assuming of course you are using the default names for the material slot name and image texture node name.

You should be able to access a texture node like this: <your_gameobject>.material_slots[“Material”].material.node_tree.nodes[“Image Texture”]

This is assuming of course you are using the default names for the material slot name and image texture node name.

This doesn’t seem to work.

obj = bge.logic.getCurrentController().owner
print(obj.material_slots[“MyMat”].material.node_tree.nodes[“MyTexture”])

I get an error returned that says the object has no property material_slots

I can’t find material_slots written as such in any documentation. And I can’t find anything about accessing node trees in such a way.