How to use c++ create MaterialExpression(CreateNewMaterialExpression)

I need a plugin,use it create material expression(UMaterialExpressionVectorParameter)

You can create a new Material Expression in c++ like this:

UMaterialExpression* Expression = CreateNewMaterialExpression(UMaterialExpressionFunctionOutput::StaticClass(), FVector2D(200, 300), false, true);

Hope that helps =)

@Devero @pengyancai
I’m Trying to include the header file necessary to use CreateNewMaterialExpression() (“MaterialEditorUtilities.h”), but i keep getting the error Cannot open include file: ‘MaterialEditorUtilities.h’: No such file or directory. I have the path to that file in my projects include directories and source directories.

Figured it out, just make sure to Include the “MaterialEditor” Module in your project’s build dependencies.