Skip to content

Commit

Permalink
Updates to Autodesk Nodes (#1394)
Browse files Browse the repository at this point in the history
Update to Autodesk nodes (adsklib) 
- Fix validation issues.
- Add UI attributes for clarity.
  • Loading branch information
ashwinbhat authored Jul 24, 2023
1 parent 57c95a4 commit f6fdb68
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 88 deletions.
104 changes: 52 additions & 52 deletions contrib/adsk/libraries/adsklib/adsklib_defs.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -10,117 +10,117 @@
<nodedef name="ND_adsk_bitmap_color3" node="bitmap" nodegroup="texture2d" version="1.0.1" isdefaultversion="true" namespace="adsk">
<input name="file" type="filename" />
<!-- inputs with unit -->
<input name="realworld_offset" type="vector2" unittype="distance" />
<input name="realworld_scale" type="vector2" unittype="distance"/>
<input name="realworld_offset" type="vector2" unittype="distance" value="0.0, 0.0" />
<input name="realworld_scale" type="vector2" unittype="distance" value="1.0, 1.0" />
<!-- inputs without unit -->
<input name="uv_offset" type="vector2" value="0.0, 0.0" />
<input name="uv_scale" type="vector2" value="1.0, 1.0" />
<!-- wAngle - rotation -->
<input name="rotation_angle" type="float" value="0" />
<input name="rotation_angle" type="float" value="0" uisoftmin="0" uisoftmax="360.0" />
<!-- rgbamount -->
<input name="rgbamount" type="float" value="1.0" />
<input name="rgbamount" type="float" value="1.0" uimin="0.0" uimax="1.0" />
<!-- invert -->
<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" />
<input name="uv_index" type="integer" value="0" uimin="0" uisoftmax="10" />
<output name="out" type="color3"/>
</nodedef>

<nodedef name="ND_adsk_bitmap_color4" node="bitmap" nodegroup="texture2d" version="1.0.1" isdefaultversion="true" namespace="adsk">
<input name="file" type="filename" />
<!-- inputs with unit -->
<input name="realworld_offset" type="vector2" unittype="distance" />
<input name="realworld_scale" type="vector2" unittype="distance"/>
<input name="realworld_offset" type="vector2" unittype="distance" value="0.0, 0.0" />
<input name="realworld_scale" type="vector2" unittype="distance" value="1.0, 1.0" />
<!-- inputs without unit -->
<input name="uv_offset" type="vector2" value="0.0, 0.0" />
<input name="uv_scale" type="vector2" value="1.0, 1.0" />
<!-- wAngle - rotation -->
<input name="rotation_angle" type="float" value="0" />
<input name="rotation_angle" type="float" value="0" uisoftmin="0" uisoftmax="360.0" />
<!-- rgbamount -->
<input name="rgbamount" type="float" value="1.0" />
<input name="rgbamount" type="float" value="1.0" uimin="0.0" uimax="1.0" />
<!-- invert -->
<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" />
<input name="uv_index" type="integer" value="0" uimin="0" uisoftmax="10" />
<output name="out" type="color4"/>
</nodedef>

<nodedef name="ND_adsk_bitmap_float" node="bitmap" nodegroup="texture2d" version="1.0.1" isdefaultversion="true" namespace="adsk">
<input name="file" type="filename" />
<!-- inputs with unit -->
<input name="realworld_offset" type="vector2" unittype="distance" />
<input name="realworld_scale" type="vector2" unittype="distance"/>
<input name="realworld_offset" type="vector2" unittype="distance" value="0.0, 0.0" />
<input name="realworld_scale" type="vector2" unittype="distance" value="1.0, 1.0" />
<!-- inputs without unit -->
<input name="uv_offset" type="vector2" value="0.0, 0.0" />
<input name="uv_scale" type="vector2" value="1.0, 1.0" />
<!-- wAngle - rotation -->
<input name="rotation_angle" type="float" value="0" />
<input name="rotation_angle" type="float" value="0" uisoftmin="0" uisoftmax="360.0" />
<!-- rgbamount -->
<input name="rgbamount" type="float" value="1.0" />
<input name="rgbamount" type="float" value="1.0" uimin="0.0" uimax="1.0" />
<!-- invert -->
<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" />
<input name="uv_index" type="integer" value="0" uimin="0" uisoftmax="10" />
<output name="out" type="float" />
</nodedef>

<nodedef name="ND_adsk_bitmap_remap_float" node="bitmap_remap" nodegroup="texture2d" version="1.0.1" isdefaultversion="true" namespace="adsk">
<input name="file" type="filename" />
<!-- inputs with unit -->
<input name="realworld_offset" type="vector2" unittype="distance" />
<input name="realworld_scale" type="vector2" unittype="distance"/>
<input name="realworld_offset" type="vector2" unittype="distance" value="0.0, 0.0" />
<input name="realworld_scale" type="vector2" unittype="distance" value="1.0, 1.0" />
<!-- inputs without unit -->
<input name="uv_offset" type="vector2" value="0.0, 0.0" />
<input name="uv_scale" type="vector2" value="1.0, 1.0" />
<!-- wAngle - rotation -->
<input name="rotation_angle" type="float" value="0" />
<input name="rotation_angle" type="float" value="0" uisoftmin="0" uisoftmax="360.0" />
<!-- rgbamount -->
<input name="rgbamount" type="float" value="1.0" />
<input name="rgbamount" type="float" value="1.0" uimin="0.0" uimax="1.0" />
<!-- invert -->
<input name="invert" type="boolean" value="false" />
<!-- remap -->
<input name="outlow" type="float" value="0.0" />
<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" />
<input name="uv_index" type="integer" value="0" uimin="0" uisoftmax="10" />
<output name="out" type="float" />
</nodedef>

<!-- <adsk_normal_map> -->
<nodedef name="ND_adsk_normal_map" node="normal_map" nodegroup="texture2d" version="1.0.1" isdefaultversion="true" namespace="adsk">
<input name="file" type="filename" />
<!-- inputs with unit -->
<input name="realworld_offset" type="vector2" unittype="distance" />
<input name="realworld_scale" type="vector2" unittype="distance" />
<input name="realworld_offset" type="vector2" unittype="distance" value="0.0, 0.0" />
<input name="realworld_scale" type="vector2" unittype="distance" value="1.0, 1.0" />
<!-- inputs without unit -->
<input name="uv_offset" type="vector2" value="0.0, 0.0" />
<input name="uv_scale" type="vector2" value="1.0, 1.0" />
<!-- wAngle - rotation -->
<input name="rotation_angle" type="float" value="0" unittype="angle" />
<input name="rotation_angle" type="float" value="0" unittype="angle" uisoftmin="0" uisoftmax="360.0" />
<!-- normal scale -->
<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" />
<input name="uv_index" type="integer" value="0" uimin="0" uisoftmax="10" />
<output name="out" type="vector3" />
</nodedef>

<!-- <adsk_height_map> -->
<nodedef name="ND_adsk_height_map" node="height_map" nodegroup="texture2d" version="1.0.1" isdefaultversion="true" namespace="adsk">
<input name="file" type="filename" />
<input name="realworld_offset" type="vector2" unittype="distance" />
<input name="realworld_scale" type="vector2" unittype="distance" />
<input name="realworld_offset" type="vector2" unittype="distance" value="0.0, 0.0" />
<input name="realworld_scale" type="vector2" unittype="distance" value="1.0, 1.0" />
<input name="uv_offset" type="vector2" value="0.0, 0.0" />
<input name="uv_scale" type="vector2" value="1.0, 1.0" />
<input name="rotation_angle" type="float" value="0" unittype="angle" />
<input name="depth" type="float" unittype="distance" />
<input name="rotation_angle" type="float" value="0" unittype="angle" uisoftmin="0" uisoftmax="360.0" />
<input name="depth" type="float" unittype="distance" value="1.0" uisoftmin="0.0" uisoftmax="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" />
<input name="uv_index" type="integer" value="0" uimin="0" uisoftmax="10" />
<output name="out" type="vector3" />
</nodedef>

Expand All @@ -131,9 +131,9 @@
<nodedef name="ND_adsk_metal" node="metal" version="1.0.1" isdefaultversion="true" namespace="adsk">
<input name="metal_f0" type="color3" value="1, 1, 1" />
<input name="surface_albedo" type="color3" value="1, 1, 1" />
<input name="surface_roughness" type="float" value="0" />
<input name="surface_anisotropy" type="float" value="0" />
<input name="surface_rotation" type="float" value="0" />
<input name="surface_roughness" type="float" value="0" uimin="0.0" uimax="1.0" />
<input name="surface_anisotropy" type="float" value="0" uimin="0.0" uimax="1.0" />
<input name="surface_rotation" type="float" value="0" uimin="0.0" uimax="180.0" />
<input name="surface_normal" type="vector3" value="1, 1, 1" defaultgeomprop="Nworld"/>
<input name="surface_cutout" type="color3" value="1, 1, 1" />
<output name="out" type="surfaceshader" />
Expand All @@ -144,15 +144,15 @@
<input name="surface_cutout" type="color3" value="1, 1, 1" />
<input name="surface_albedo" type="color3" value="1, 1, 1" />
<input name="opaque_albedo" type="color3" value="1, 1, 1" />
<input name="surface_roughness" type="float" value="0" />
<input name="surface_anisotropy" type="float" value="0" />
<input name="surface_rotation" type="float" value="0" />
<input name="surface_roughness" type="float" value="0" uimin="0.0" uimax="1.0" />
<input name="surface_anisotropy" type="float" value="0" uimin="0.0" uimax="1.0" />
<input name="surface_rotation" type="float" value="0" uimin="0.0" uimax="180.0" />
<input name="opaque_f0" type="float" value="1" />
<input name="opaque_translucency" type="boolean" value="false" />
<input name="opaque_mfp_modifier" type="color3" value="1, 1, 1" />
<input name="opaque_mfp" type="float" value="1" unittype="distance" />
<input name="opaque_mfp" type="float" value="1" unittype="distance" uimin="0.0" uisoftmax="100.0" />
<input name="opaque_emission" type="boolean" value="false" />
<input name="opaque_luminance" type="float" value="1.0" />
<input name="opaque_luminance" type="float" value="1.0" uimin="0.0" uisoftmax="1500.0" />
<input name="opaque_luminance_modifier" type="color3" value="1.0, 1.0, 1.0" />
<output name="out" type="surfaceshader" />
</nodedef>
Expand All @@ -161,27 +161,27 @@
<input name="surface_normal" type="vector3" value="1, 1, 1" defaultgeomprop="Nworld"/>
<input name="surface_cutout" type="color3" value="1, 1, 1" />
<input name="surface_albedo" type="color3" value="1, 1, 1" />
<input name="surface_roughness" type="float" value="0" />
<input name="surface_anisotropy" type="float" value="0" />
<input name="surface_rotation" type="float" value="0" />
<input name="transparent_ior" type="float" value="1" />
<input name="surface_roughness" type="float" value="0" uimin="0.0" uimax="1.0" />
<input name="surface_anisotropy" type="float" value="0" uimin="0.0" uimax="1.0" />
<input name="surface_rotation" type="float" value="0" uimin="0.0" uimax="180.0" />
<input name="transparent_ior" type="float" value="1" uimin="0.0" uisoftmax="3.0" />
<input name="transparent_color" type="color3" value="1, 1, 1" />
<input name="transparent_distance" type="float" value="1" />
<input name="transparent_distance" type="float" value="1" unittype="distance" uimin="0.0" uisoftmax="100.0" />
<output name="out" type="surfaceshader" />
</nodedef>

<nodedef name="ND_adsk_layered" node="layered" version="1.0.1" isdefaultversion="true" namespace="adsk">
<input name="surface_normal" type="vector3" value="1, 1, 1" defaultgeomprop="Nworld"/>
<input name="surface_cutout" type="color3" value="1, 1, 1" />
<input name="surface_albedo" type="color3" value="1, 1, 1" />
<input name="surface_roughness" type="float" value="0" />
<input name="surface_anisotropy" type="float" value="0" />
<input name="surface_rotation" type="float" value="0" />
<input name="surface_roughness" type="float" value="0" uimin="0.0" uimax="1.0" />
<input name="surface_anisotropy" type="float" value="0" uimin="0.0" uimax="1.0" />
<input name="surface_rotation" type="float" value="0" uimin="0.0" uimax="180.0" />
<input name="layered_normal" type="vector3" value="1, 1, 1" defaultgeomprop="Nworld"/>
<input name="layered_f0" type="float" value="1" />
<input name="layered_roughness" type="float" value="0" />
<input name="layered_anisotropy" type="float" value="0" />
<input name="layered_rotation" type="float" value="0" />
<input name="layered_roughness" type="float" value="0" uimin="0.0" uimax="1.0" />
<input name="layered_anisotropy" type="float" value="0" uimin="0.0" uimax="1.0" />
<input name="layered_rotation" type="float" value="0" uimin="0.0" uimax="180.0" />
<input name="layered_fraction" type="float" value="0.5" />
<input name="layered_fraction_invert" type="boolean" value="false" />
<input name="layered_diffuse" type="color3" value="1, 1, 1" />
Expand All @@ -193,11 +193,11 @@
<input name="surface_albedo" type="color3" value="1, 1, 1" />
<input name="surface_normal" type="vector3" value="1, 1, 1" defaultgeomprop="Nworld"/>
<input name="surface_cutout" type="color3" value="1, 1, 1" />
<input name="surface_roughness" type="float" value="0" />
<input name="surface_anisotropy" type="float" value="0" />
<input name="surface_rotation" type="float" value="0" />
<input name="surface_roughness" type="float" value="0" uimin="0.0" uimax="1.0" />
<input name="surface_anisotropy" type="float" value="0" uimin="0.0" uimax="1.0" />
<input name="surface_rotation" type="float" value="0" uimin="0.0" uimax="180.0" />
<input name="glazing_transmission_color" type="color3" value="1, 1, 1" />
<input name="glazing_transmission_roughness" type="float" value="0" />
<input name="glazing_transmission_roughness" type="float" value="0" uimin="0.0" uimax="1.0" />
<input name="glazing_f0" type="color3" value="1,1,1" />
<input name="glazing_backface_culling" type="boolean" value="true" />
<output name="out" type="surfaceshader" />
Expand Down
12 changes: 6 additions & 6 deletions contrib/adsk/libraries/adsklib/adsklib_ng.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@
<!-- map values to standard surface -->
<output name="out" type="surfaceshader" nodename="standard_surface0" />
<standard_surface name="standard_surface0" type="surfaceshader" version="1.0.1">
<input name="normal" type="vector3" value="1, 1, 1" defaultgeomprop="Nobject" interfacename="surface_normal" />
<input name="normal" type="vector3" value="1, 1, 1" interfacename="surface_normal" />
<input name="opacity" type="color3" value="1, 1, 1" interfacename="surface_cutout" />
<input name="metalness" type="float" value="1" />
<input name="base" type="float" value="1.0" />
Expand Down Expand Up @@ -532,7 +532,7 @@
<!-- map values to standard surface -->
<output name="out" type="surfaceshader" nodename="standard_surface0" />
<standard_surface name="standard_surface0" type="surfaceshader" version="1.0.1">
<input name="normal" type="vector3" value="1, 1, 1" defaultgeomprop="Nobject" interfacename="surface_normal" />
<input name="normal" type="vector3" value="1, 1, 1" interfacename="surface_normal" />
<input name="opacity" type="color3" value="1, 1, 1" interfacename="surface_cutout" />
<input name="specular_color" type="color3" value="1, 1, 1" interfacename="surface_albedo" />
<input name="specular_roughness" type="float" nodename="specular_roughness_value" />
Expand Down Expand Up @@ -596,7 +596,7 @@
<!-- map values to standard surface -->
<output name="out" type="surfaceshader" nodename="standard_surface0" />
<standard_surface name="standard_surface0" type="surfaceshader" version="1.0.1">
<input name="normal" type="vector3" value="1, 1, 1" defaultgeomprop="Nobject" interfacename="surface_normal" />
<input name="normal" type="vector3" value="1, 1, 1" interfacename="surface_normal" />
<input name="opacity" type="color3" value="1, 1, 1" interfacename="surface_cutout" />
<input name="specular" type="float" value="1.0" />
<input name="transmission" type="float" value="1.0" />
Expand Down Expand Up @@ -779,8 +779,8 @@
<!-- map values to standard surface -->
<output name="out" type="surfaceshader" nodename="standard_surface0" />
<standard_surface name="standard_surface0" type="surfaceshader" version="1.0.1">
<input name="normal" type="vector3" value="1, 1, 1" defaultgeomprop="Nobject" interfacename="layered_normal" />
<input name="coat_normal" type="vector3" value="1, 1, 1" defaultgeomprop="Nobject" interfacename="surface_normal" />
<input name="normal" type="vector3" value="1, 1, 1" interfacename="layered_normal" />
<input name="coat_normal" type="vector3" value="1, 1, 1" interfacename="surface_normal" />
<input name="opacity" type="color3" value="1, 1, 1" interfacename="surface_cutout" />
<input name="coat" type="float" nodename="coat_value" />
<input name="metalness" type="float" nodename="layered_fraction_value" />
Expand Down Expand Up @@ -936,7 +936,7 @@
<!-- map values to standard surface -->
<output name="out" type="surfaceshader" nodename="standard_surface0" />
<standard_surface name="standard_surface0" type="surfaceshader" version="1.0.1">
<input name="normal" type="vector3" value="1, 1, 1" defaultgeomprop="Nobject" interfacename="surface_normal" />
<input name="normal" type="vector3" value="1, 1, 1" interfacename="surface_normal" />
<input name="opacity" type="color3" nodename="opacity_value" />
<input name="specular" type="float" value="1.0" />
<input name="transmission" type="float" value="1.0" />
Expand Down
Loading

0 comments on commit f6fdb68

Please sign in to comment.