Skip to content

Commit

Permalink
Support multiple UV (#1386)
Browse files Browse the repository at this point in the history
Add input node "uv_index" for supporting transfer data of multiple UV
  • Loading branch information
francis-wangfr committed May 19, 2022
1 parent a748c07 commit 7a4f14c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
6 changes: 6 additions & 0 deletions libraries/adsk/adsklib/adsklib_defs.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<input name="invert" type="boolean" value="false" />
<input name="uaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode U" uniform="true" />
<input name="vaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode V" uniform="true" />
<input name="uv_index" type="integer" value="0" />
<output name="out" type="color3"/>
</nodedef>

Expand All @@ -42,6 +43,7 @@
<input name="invert" type="boolean" value="false" />
<input name="uaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode U" uniform="true" />
<input name="vaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode V" uniform="true" />
<input name="uv_index" type="integer" value="0" />
<output name="out" type="color4"/>
</nodedef>

Expand All @@ -61,6 +63,7 @@
<input name="invert" type="boolean" value="false" />
<input name="uaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode U" uniform="true" />
<input name="vaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode V" uniform="true" />
<input name="uv_index" type="integer" value="0" />
<output name="out" type="float" />
</nodedef>

Expand All @@ -83,6 +86,7 @@
<input name="outhigh" type="float" value="1.0" />
<input name="uaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode U" uniform="true" />
<input name="vaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode V" uniform="true" />
<input name="uv_index" type="integer" value="0" />
<output name="out" type="float" />
</nodedef>

Expand All @@ -101,6 +105,7 @@
<input name="normal_scale" type="float" value="1.0" />
<input name="uaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode U" uniform="true" />
<input name="vaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode V" uniform="true" />
<input name="uv_index" type="integer" value="0" />
<output name="out" type="vector3" />
</nodedef>

Expand All @@ -115,6 +120,7 @@
<input name="depth" type="float" unittype="distance" />
<input name="uaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode U" uniform="true" />
<input name="vaddressmode" type="string" value="periodic" enum="constant,clamp,periodic,mirror" uiname="Address Mode V" uniform="true" />
<input name="uv_index" type="integer" value="0" />
<output name="out" type="vector3" />
</nodedef>

Expand Down
24 changes: 18 additions & 6 deletions libraries/adsk/adsklib/adsklib_ng.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
</multiply>

<!-- use placement node to transform uv -->
<texcoord name="texcoord1" type="vector2" />
<texcoord name="texcoord1" type="vector2">
<input name="index" type="integer" interfacename="uv_index"/>
</texcoord>
<place2d name="a_place2d" type="vector2">
<input name="texcoord" type="vector2" nodename="texcoord1"/>
<input name="offset" type="vector2" nodename="total_offset" />
Expand Down Expand Up @@ -83,7 +85,9 @@
</multiply>

<!-- use placement node to transform uv -->
<texcoord name="texcoord1" type="vector2" />
<texcoord name="texcoord1" type="vector2">
<input name="index" type="integer" interfacename="uv_index"/>
</texcoord>
<place2d name="a_place2d" type="vector2">
<input name="texcoord" type="vector2" nodename="texcoord1"/>
<input name="offset" type="vector2" nodename="total_offset" />
Expand Down Expand Up @@ -139,7 +143,9 @@
</multiply>

<!-- use placement node to transform uv -->
<texcoord name="texcoord1" type="vector2" />
<texcoord name="texcoord1" type="vector2">
<input name="index" type="integer" interfacename="uv_index"/>
</texcoord>
<place2d name="a_place2d" type="vector2">
<input name="texcoord" type="vector2" nodename="texcoord1"/>
<input name="offset" type="vector2" nodename="total_offset" />
Expand Down Expand Up @@ -201,7 +207,9 @@
</multiply>

<!-- use placement node to transform uv -->
<texcoord name="texcoord1" type="vector2" />
<texcoord name="texcoord1" type="vector2">
<input name="index" type="integer" interfacename="uv_index"/>
</texcoord>
<place2d name="a_place2d" type="vector2">
<input name="texcoord" type="vector2" nodename="texcoord1"/>
<input name="offset" type="vector2" nodename="total_offset" />
Expand Down Expand Up @@ -274,7 +282,9 @@
</multiply>

<!-- use placement node to transform uv -->
<texcoord name="texcoord1" type="vector2" />
<texcoord name="texcoord1" type="vector2">
<input name="index" type="integer" interfacename="uv_index"/>
</texcoord>
<place2d name="a_place2d" type="vector2">
<input name="texcoord" type="vector2" nodename="texcoord1"/>
<input name="offset" type="vector2" nodename="total_offset" />
Expand Down Expand Up @@ -328,7 +338,9 @@
<input name="in2" type="float" value="-1.0"/>
</multiply>

<texcoord name="texcoord1" type="vector2" />
<texcoord name="texcoord1" type="vector2">
<input name="index" type="integer" interfacename="uv_index"/>
</texcoord>
<place2d name="a_place2d" type="vector2">
<input name="texcoord" type="vector2" nodename="texcoord1"/>
<input name="offset" type="vector2" nodename="total_offset" />
Expand Down

0 comments on commit 7a4f14c

Please sign in to comment.