Can you check all materials that using a specific node?

I am wondering if Unreal has a similar functionality to the Find in Blueprints tool where you select a node and see all Blueprints that are using it, but for materials. Would come in extremely handy.

I have also taken a brief look into the python API, but seems like there is no straightforward way to do that there as well.

Hello,

Unreal Engine does not currently have a built-in tool exactly like “Find in Blueprints” specifically for materials. However, there are a few approaches you can take to achieve similar functionality:

Manual Search: You can manually search for materials in Blueprints by using the “Find in Blueprints” tool and searching for material references. This can be time-consuming but is a direct way to locate where materials are used.
Python Scripting: While there isn’t a straightforward way to do this with the Python API, you can write a custom script to help. You can use the unreal.EditorAssetLibrary to load assets and iterate through them to find material references. Here’s a basic example to get you started:import unreal

def find_material_usage(material_name):
asset_registry = unreal.AssetRegistryHelpers.get_asset_registry()
all_assets = asset_registry.get_all_assets()

for asset in all_assets:
    if asset.asset_class == 'Blueprint':
        blueprint = unreal.EditorAssetLibrary.load_asset(asset.object_path)
        if blueprint:
            nodes = unreal.KismetEditorUtilities.get_all_nodes_for_blueprint(blueprint)
            for node in nodes:
                if node.get_editor_property('node_title') == material_name: 
                    print(f"Material {material_name} found in {blueprint.get_name()}")

find_material_usage(‘YourMaterialName’)Community Plugins: Check the Unreal Engine Marketplace or community forums for plugins that might offer this functionality. Sometimes, other developers have created tools that can help with specific needs like this.
Feature Request: Consider submitting a feature request to Epic Games. They often take user feedback into account for future updates and improvements.

Hope that helps.

Hi Nick, sorry for not being clear, but I am looking to find a way to check which Materials are using certain Material nodes (Texture Sample, Static Switch Parameter, Quality Switch nodes for example).

The blueprint tool was an analogy to the perfect solution, where you search for a BP node and it shows all the BPs that are using that node (found under Tools > Find in Blueprints), except that it works for materials instead of Blueprints.

I believe the python API doesn’t have anything exposed to get such information from materials, though. unreal.Material — Unreal Python 5.3 (Experimental) documentation

Hello, J_Kalva

I understand your need to find which materials are using specific Material nodes in Unreal Engine, similar to the “Find in Blueprints” tool. Unfortunately, Unreal Engine doesn’t have a built-in tool for this exact purpose. However, here are some approaches you can consider:

Manual Search:
You can manually search for materials by opening each material and checking for the specific nodes. This is time-consuming but straightforward.
Python Scripting:
While the Python API doesn’t directly support this, you can write a custom script to help. Here’s an example to get you started import unreal

def find_material_node_usage(node_name):
asset_registry = unreal.AssetRegistryHelpers.get_asset_registry()
all_assets = asset_registry.get_all_assets()

for asset in all_assets:
    if asset.asset_class == 'Material' or asset.asset_class == 'MaterialInstance':
        material = unreal.EditorAssetLibrary.load_asset(asset.object_path)
        if material:
            nodes = material.get_editor_property('expressions')
            for node in nodes:
                if node.get_name() == node_name:
                    print(f"Node {node_name} found in {material.get_name()}")

find_material_node_usage(‘TextureSample’)
Community Plugins:
Check the Unreal Engine Marketplace or community forums for plugins that might offer this functionality. Other developers might have created tools that can help with specific needs like this.

Bro are you really using chatGPT to answer questions in this forum :skull:

1 Like