forked from AcademySoftwareFoundation/MaterialX
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdefinition_with_enum_interface.mtlx
More file actions
30 lines (27 loc) · 1.18 KB
/
Copy pathdefinition_with_enum_interface.mtlx
File metadata and controls
30 lines (27 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?xml version="1.0"?>
<materialx version="1.39">
<!-- create a custom node that exposes an enumeration input via "interfacename" -->
<nodedef name="ND_positionwrapper" node="positionwrapper">
<input name="wrap_space" type="string" value="object" enum="model, object, world" uniform="true"/>
<output name="out" type="vector3"/>
</nodedef>
<nodegraph name="NG_positionwrapper" nodedef="ND_positionwrapper">
<position name="myPos" type="vector3">
<input name="space" type="string" interfacename="wrap_space"/>
</position>
<output name="out" type="vector3" nodename="myPos"/>
</nodegraph>
<positionwrapper name="myPosWrapper" type="vector3">
<input name="wrap_space" type="string" value="object"/>
</positionwrapper>
<extract name="extract" type="float">
<input name="in" type="vector3" nodename="myPosWrapper"/>
<input name="index" type="integer" value="1"/>
</extract>
<surface_unlit name="Srf" type="surfaceshader">
<input name="emission" type="float" nodename="extract" />
</surface_unlit>
<surfacematerial name="Mtl" type="material">
<input name="surfaceshader" type="surfaceshader" nodename="Srf" />
</surfacematerial>
</materialx>