Is it possible to use Python for editing material graphs?

I don’t know if this helps, but you can try:

    asset_registry = unreal.AssetRegistryHelpers.get_asset_registry()
    all_assets = asset_registry.get_assets_by_path(asset_path, recursive=True)

    if asset.asset_class == 'Material' and asset.asset_name == material_name:
        loaded_material = unreal.EditorAssetLibrary.load_asset(asset.get_full_name())

    parameters = unreal.MaterialEditingLibrary.get_static_switch_parameter_names(loaded_material)

    for p in parameters:
        static_switch_params = unreal.MaterialEditingLibrary.get_material_default_static_switch_parameter_value(loaded_material, p)
    print static_switch_params

print_static_switch_params("/Game/Art/Shaders/", "MyMaterial_MAT")```](https://docs.unrealengine.com/en-US/PythonAPI/class/MaterialEditingLibrary.html)

Disclaimer: I've extracted this code from my existing script, so there might some issues with variable referencing etc., but this should give you an idea. More info on the MaterialEditingLibrary can be found here: [https://docs.unrealengine.com/en-US/PythonAPI/class/MaterialEditingLibrary.html.](https://docs.unrealengine.com/en-US/PythonAPI/class/MaterialEditingLibrary.html)

Hope this helps.