# Is there a way using the Python API to list all the nodes for a Material and what files is attached to each node?

**URL:** <https://forums.unrealengine.com/t/is-there-a-way-using-the-python-api-to-list-all-the-nodes-for-a-material-and-what-files-is-attached-to-each-node/618332>\
**Category:** Editor Scripting\
**Tags:** Python, unreal-engine, UE5-0, Plugins, question\
**Created:** [July 31, 2022, 2:24pm UTC](https://forums.unrealengine.com/t/is-there-a-way-using-the-python-api-to-list-all-the-nodes-for-a-material-and-what-files-is-attached-to-each-node/618332 "2022-07-31T14:24:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![IMGoose](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/imgoose/32/88718_2.png) [@IMGoose](https://forums.unrealengine.com/u/IMGoose)\
**Post date:** [July 31, 2022, 2:24pm UTC](https://forums.unrealengine.com/t/is-there-a-way-using-the-python-api-to-list-all-the-nodes-for-a-material-and-what-files-is-attached-to-each-node/618332/1 "2022-07-31T14:24:12Z")

</div>

For example, if I wished to write a Python script that lists the Base Color, Metallic, Specular, Roughness, Anistopy etc. nodes and what textures are attached to each node, would this be possible and if so how would I go about it?

I am already aware that unreal.AssetRegistryHelpers.get\_asset\_registry().get\_dependencies(package\_path, options) will give me a list of dependent textures, but it gives me no context as to which nodes each texture file is connected to.

---

<div class="post-metadata">

**Author:** ![chpsemail](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chpsemail/32/496464_2.png) [@chpsemail](https://forums.unrealengine.com/u/chpsemail)\
**Post date:** [August 3, 2022, 8:33am UTC](https://forums.unrealengine.com/t/is-there-a-way-using-the-python-api-to-list-all-the-nodes-for-a-material-and-what-files-is-attached-to-each-node/618332/2 "2022-08-03T08:33:00Z")

</div>

I don’t think there’s a direct way to do that right now. The “MaterialEditingLibrary” provides some functions, but not enough. We need to create some blueprint callable function ourselves. Just like below. I will add this to my plugin in the next version. [Python Editor Extended API - TAPython](https://www.tacolor.xyz/pages/PythonEditorLib.html)

Another way is to export the material, then use python to parse the exported “.t3d” or “.copy” file, which contains the full information of the material.

 ![Snipaste_2022-08-03_16-22-48](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/f/f/5ff6763c2cb7641f52a7dee3ef0485e428919bd3.png)

---

<div class="post-metadata">

**Author:** ![andreas.ranman](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@andreas.ranman](https://forums.unrealengine.com/u/andreas.ranman)\
**Post date:** [August 5, 2022, 8:26am UTC](https://forums.unrealengine.com/t/is-there-a-way-using-the-python-api-to-list-all-the-nodes-for-a-material-and-what-files-is-attached-to-each-node/618332/3 "2022-08-05T08:26:54Z")

</div>

If you have the Material loaded, like

```auto
material = unreal.EditorAssetLibrary.load_asset(<asset_path>)

```

You can then run an ObjectIterator

```python
it = unreal.ObjectIterator()
for x in it:
  if isinstance(x, unreal.MaterialExpression) or x.get_path_name().startswith(<asset_path>)):
    print(x)

```

Which will print all nodes in your loaded material

The [MaterialEdititingLibrary](https://docs.unrealengine.com/5.0/en-US/PythonAPI/class/MaterialEditingLibrary.html?highlight=material#unreal.MaterialEditingLibrary) should then have methods you can use to get how nodes are connected

---

<div class="post-metadata">

**Author:** ![raianlp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@raianlp](https://forums.unrealengine.com/u/raianlp)\
**Post date:** [March 24, 2025, 4:36pm UTC](https://forums.unrealengine.com/t/is-there-a-way-using-the-python-api-to-list-all-the-nodes-for-a-material-and-what-files-is-attached-to-each-node/618332/4 "2025-03-24T16:36:06Z")

</div>

@chpsemail Did you managed to add log\_material\_tree to your plugin? It would be insanely useful to me.
