italink/unrealclientprotocol/unreal-material-editing

Claude Code and agent skill by italink/unrealclientprotocol

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Edit UE material node graphs and properties via text (ReadGraph/WriteGraph). Use when the user asks to add, remove, or rewire material expression nodes, or change material properties like ShadingModel or BlendMode.

Install

npx vskill@latest install italink/unrealclientprotocol/unreal-material-editing

SKILL.md

Material Editing

Material editing covers both material properties (ShadingModel, BlendMode, etc.) via the [Properties] section, and node graph (expression nodes and connections) via the [Material] section. Both use the same unified API.

Prerequisite: UE editor running with UCP plugin enabled.

API

CDO: /Script/UnrealClientProtocolEditor.Default__NodeCodeEditingLibrary

FunctionParamsDescription
OutlineAssetPathReturns available sections (Properties, Material, Composite:Name)
ReadGraphAssetPath, SectionReturns text. Empty Section = all. "Material" = main graph only.
WriteGraphAssetPath, Section, GraphTextOverwrite section. Auto-recompiles, relayouts, refreshes editor.

Material Properties

Use the [Properties] section to read/write material-level settings:

[Properties]
ShadingModel: MSM_DefaultLit
BlendMode: BLEND_Opaque
TwoSided: true
OpacityMaskClipValue: 0.333

Common properties:

PropertyExample Values
ShadingModelMSM_DefaultLit, MSM_Unlit, MSM_Subsurface, MSM_ClearCoat
BlendModeBLEND_Opaque, BLEND_Masked, BLEND_Translucent, BLEND_Additive
MaterialDomainMD_Surface, MD_DeferredDecal, MD_LightFunction, MD_PostProcess, MD_UI
TwoSidedtrue, false

Read with ReadGraph(AssetPath, "Properties"), write with WriteGraph(AssetPath, "Properties", text).

Section Model

SectionDescription
[Properties]Material-level properties (ShadingModel, BlendMode, etc.)
[Material]Complete main graph — all non-composite nodes, read/write as one unit
[Composite:Name]Composite subgraph (physically isolated)

The [Material] section contains the entire main graph. Output pins are expressed as graph output connections: > RGB -> [BaseColor].

Text Format

[Material]
N_4kVm2xRp8bNw3yLq9dJs MaterialExpressionTextureSample {Texture:"/Game/Textures/T_Wood_BC"}
> RGB -> [BaseColor]
> A -> N_7tHn5cWs1fPx6zMr0gKu.A
N_9aEo3jXv2hQy8bFt4iLw MaterialExpressionScalarParameter {ParameterName:"Roughness", DefaultValue:0.5}
> -> N_7tHn5cWs1fPx6zMr0gKu.B
N_2dGq6lZx4jSa0cHv8kNy MaterialExpressionVectorParameter {ParameterName:"EmissiveColor", DefaultValue:{"R":1,"G":0.5,"B":0}}
> -> N_5fIr7mBz3kTb1eJw9lOa.A
N_7tHn5cWs1fPx6zMr0gKu MaterialExpressionMultiply
> -> [Roughness]
N_5fIr7mBz3kTb1eJw9lOa MaterialExpressionMultiply
> -> [EmissiveColor]
N_0hKt8nDc5lUd2gLx6mPb MaterialExpressionConstant {R:5.0}
> -> N_5fIr7mBz3kTb1eJw9lOa.B
N_3jMv0pFe7nWf4iNz8oCd MaterialExpressionTextureSample {Texture:"/Game/Textures/T_Wood_N"}
> -> [Normal]
N_6lOx2rHg9pYh5kPb1qEf MaterialExpressionTime
> -> N_8nQz4tJi0rAj7mRd3sFg.A
N_8nQz4tJi0rAj7mRd3sFg MaterialExpressionSine {Period:6.283185}
> -> N_1pSb6vLk2tCl9oTf5uGh.B
N_1pSb6vLk2tCl9oTf5uGh MaterialExpressionMultiply
> -> [WorldPositionOffset]
N_4rUd8xNm3vEn0qVh7wIj MaterialExpressionWorldPosition
> -> N_1pSb6vLk2tCl9oTf5uGh.A

Note how Time and WorldPosition — source-only nodes with no inputs — both have > -> lines. Without these lines they would be deleted as orphans.

Nodes
  • N_<id>: node reference ID. Two forms:
  • Existing nodes: N_<base62> — a 22-character Base62-encoded GUID (e.g. N_4kVm2xRp8bNw3yLq9dJs). ReadGraph always outputs this form. Preserve these IDs when writing back — they are the node's stable identity.
  • New nodes: N_new<int> — temporary ID for nodes you are creating (e.g. N_new0, N_new1). The system assigns a real GUID after WriteGraph.
  • <ClassName>: UMaterialExpression class name (e.g. MaterialExpressionMultiply, MaterialExpressionConstant3Vector)
  • {...}: non-default properties, single line
Connections

Connections are declared on the source (output) node only. Each > line under a node declares where that node's output goes. There is no "reverse" declaration — if a node has no > lines, it has no outgoing connections.

> OutputPin -> N_<target>.InputPin # named output to named input
> OutputPin -> [GraphOutput] # named output to material output
> -> N_<target>.InputPin # single-output node to named input
> -> N_<target> # single-output to single-input (both omitted)

CRITICAL — Orphan cleanup: After WriteGraph, any node not reachable from the material output pins is automatically deleted as an orphan. This means:

  • Every node must be part of a connected chain that reaches a `[GraphOutput]`. If you create a node but forget to write its > -> output connections, it will be silently deleted.
  • Source-only nodes (nodes with no inputs, only outputs — e.g. Time, ScreenPosition, ViewSize, TexCoord, WorldPosition, CameraPositionWS, VertexColor, constants) are especially prone to this. They must have > -> lines connecting their output to downstream nodes.
Multi-Output Nodes

Some nodes have multiple named outputs. Use the output name before ->:

NodeOutputs
MaterialExpressionScreenPositionViewportUV (float2, index 0), PixelPosition (float2, index 1)
MaterialExpressionTextureSampleRGB, R, G, B, A, RGBA
MaterialExpressionWorldPosition(single output, omit name)
MaterialExpressionViewSize(single output float2, omit name)

Example — ScreenPosition with named output:

N_4kVm2xRp8bNw3yLq9dJs MaterialExpressionScreenPosition
> ViewportUV -> N_7tHn5cWs1fPx6zMr0gKu.A
Common Input Pin Names
Node TypeInput Pins
Single-input nodes (Sine, Cosine, Tangent, Abs, OneMinus, Frac, Floor, Ceil, Saturate, SquareRoot, Length, Normalize)Input (can be omitted)
ComponentMaskInput (can be omitted)
Binary math (Multiply, Add, Subtract, Divide)A, B
PowerBase, Exponent
DotProduct, CrossProduct, DistanceA, B
AppendVectorA, B
LinearInterpolateA, B, Alpha
ClampInput, Min, Max
IfA, B, AGreaterThanB, AEqualsB, ALessThanB
Arctangent2FastY, X
Graph Outputs

Material output pins are expressed as [PinName]:

> RGB -> [BaseColor]
> -> [Roughness]
> -> [Normal]
> -> [EmissiveColor]
> -> [Opacity]
> -> [OpacityMask]
> -> [Metallic]
> -> [WorldPositionOffset]
Common Expression Classes

Source-only nodes (no inputs — must always have > -> output lines or they will be deleted as orphans):

ClassNameOutputDescription
MaterialExpressionConstantfloat1Float constant (property: R)
MaterialExpressionConstant2Vectorfloat2Vector2 constant
MaterialExpressionConstant3Vectorfloat3Vector3 constant (property: Constant:(R=,G=,B=,A=))
MaterialExpressionConstant4Vectorfloat4Vector4 constant
MaterialExpressionScalarParameterfloat1Float parameter
MaterialExpressionVectorParameterfloat3Vector parameter
MaterialExpressionTexCoordfloat2Texture coordinates
MaterialExpressionTimefloat1Time value
MaterialExpressionScreenPositionfloat2 × 2Outputs: ViewportUV, PixelPosition
MaterialExpressionViewSizefloat2Viewport resolution in pixels
MaterialExpressionWorldPositionfloat3World position
MaterialExpressionVertexColorfloat4Vertex color (outputs: R, G, B, A, RGB)
MaterialExpressionCameraPositionWSfloat3Camera position
MaterialExpressionTextureObjectTextureTexture reference

Texture sampling:

ClassNameDescription
MaterialExpressionTextureSampleSample a texture (outputs: RGB, R, G, B, A, RGBA)
MaterialExpressionTextureSampleParameter2DTexture parameter

Math — binary:

ClassNameInputsUnconnected-default propertiesDescription
MaterialExpressionMultiplyA, BConstA, ConstB (float)A * B
MaterialExpressionAddA, BConstA, ConstB (float)A + B
MaterialExpressionSubtractA, BConstA, ConstB (float)A - B
MaterialExpressionDivideA, BConstA, ConstB (float)A / B
MaterialExpressionPowerBase, ExponentConstExponent (float)Base ^ Exponent
MaterialExpressionDotProductA, B(none)Dot(A, B) → float1
MaterialExpressionCrossProductA, B(none)Cross(A, B) → float3
MaterialExpressionDistanceA, B(none)Distance(A, B) → float1
MaterialExpressionAppendVectorA, B(none — both inputs required)Append(A, B) — concatenates dimensions. Max output is float4. float1+float1→float2, float2+float2→float4. float3+float2 or larger FAILS.

ConstA/ConstB are only available on the four basic arithmetic nodes (Multiply, Add, Subtract, Divide). They provide a scalar fallback when the corresponding input pin is unconnected. All other binary nodes require explicit input connections — use a MaterialExpressionConstant node to supply fixed values.

Math — unary (input: Input, can be omitted in connection):

ClassNameDescription
MaterialExpressionOneMinus1 - X
MaterialExpressionAbsAbsolute value
MaterialExpressionNormalizeNormalize → same dimension
MaterialExpressionLengthLength → float1
MaterialExpressionSquareRootsqrt
MaterialExpressionFracFractional part
MaterialExpressionFloorFloor
MaterialExpressionCeilCeiling
MaterialExpressionSaturateClamp to 0-1

Trig (input: Input; Period property: default 1 maps input range [0,1] to one full cycle. WARNING: `Period:0` is BROKEN — it injects a float4 multiply that corrupts dimensions. For raw radians use Period:6.283185 (= 2π), which maps [0, 2π] to one full cycle):

ClassNameDescription
MaterialExpressionSinesin
MaterialExpressionCosinecos
MaterialExpressionTangenttan
MaterialExpressionArctangent2Fastatan2(Y, X) — inputs: Y, X

Interpolation & logic:

ClassNameDescription
MaterialExpressionLinearInterpolateLerp(A, B, Alpha)
MaterialExpressionClampClamp(Input, Min, Max)
MaterialExpressionIfIf(A, B, AGreaterThanB, AEqualsB, ALessThanB)
MaterialExpressionStaticSwitchParameterStatic bool parameter

Channel operations:

ClassNameDescription
MaterialExpressionComponentMaskMask channels (properties: R, G, B, A booleans)

Other:

ClassNameDescription
MaterialExpressionPannerUV panning
MaterialExpressionTransformTransform vector between spaces
MaterialExpressionCustomCustom HLSL code
MaterialExpressionMaterialFunctionCallCall a material function
MaterialExpressionSetMaterialAttributesSet material attributes

Custom HLSL

For MaterialExpressionCustom, the Code property contains HLSL and InputNames defines custom inputs:

N_new0 MaterialExpressionCustom {Code:"float3 result = Input1 * Input2;\nreturn result;", OutputType:CMOT_Float3, InputNames:["A","B"]}
Defining Functions via Struct Wrapping

UE's Custom node does support function definitions — wrap them inside a struct. Direct top-level function definitions (float Foo(){...}) are rejected by the compiler, but struct member functions work:

hlsl
struct MyHelpers
{
float Hash(float t)
{
return frac(sin(t * 613.2) * 614.8);
}

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
114
Repository forks
14
7-day trend score
24

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/italink/unrealclientprotocol/unreal-material-editing/badge)](https://verified-skill.com/skills/italink/unrealclientprotocol/unreal-material-editing)

Something wrong with this skill or its page? Tell us.