Creating Blueprint node graph for material with Python?

How can one create a new Blueprint material nodes from a python script?

import unreal
material = unreal.Material(‘Material’)

is there an example?

Not sure it’s possible currently. I would assume you need to call


Something like

import unreal

def main():

if __name__ == '__main__':

Never had any luck with Factories seeing I always get

AttributeError: 'module' object has no attribute MaterialFactoryNew

You could try see if you have better luck, some other stuff I had missing from my Python seem to have existed for others such as the Undo context.

This is how you create a new blueprint asset:

As you can see in, the name of the file that should be created is BP_VRMainCharacter.

In **blueprint.create(name, path, unreal.Character) **the third parameter is the parent class that defines the type of the blueprint being created. So, try changing this to a material type. Which material type? Maybe there is a material type you can find in the Documenation:

I’m stuck on something else… once the Blueprint is created… is there a way to script adding Event Graph nodes into the Blueprint?

For example, is it possible to create the Event Graph pictured below with python script?


Hey there @gmilligan - did you ever solve your last question? Are you able to use Python to add nodes to the Event Graph somehow?
I’m trying the same thing…


Search the documentation for this:


Methods within to add nodes.