Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions resources/Geometry/cube.obj
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This file uses centimeters as units for non-parametric coordinates.
g
v -0.500000 -0.500000 0.500000
v 0.500000 -0.500000 0.500000
v -0.500000 0.500000 0.500000
v 0.500000 0.500000 0.500000
v -0.500000 0.500000 -0.500000
v 0.500000 0.500000 -0.500000
v -0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 -0.500000
vt 0.99 0.01
vt 0.99 1.01
vt 1.01 0.01
vt 2.01 0.99
vt 2.01 1.01
vt 1.99 0.99
vt 1.01 1.01
vt 2.99 2.01
vt 1.01 1.99
vt 1.99 1.99
vt 2.99 0.01
vt 2.99 0.99
vt 0.01 0.01
vt 0.01 0.99
vt 2.01 0.01
vt 0.99 1.99
vt 1.99 0.01
vt 0.01 1.01
vt 0.01 1.99
vt 0.99 0.99
vt 2.01 2.01
vt 1.99 1.01
vt 1.01 0.99
vt 2.99 1.
g
f 1/18 2/2 4/16 3/19
f 3/3 4/17 6/6 5/23
f 5/5 6/24 8/8 7/21
f 7/7 8/22 2/10 1/9
f 2/15 8/11 6/12 4/4
f 7/13 1/1 3/20 5/14
Binary file added resources/Images/grid_udim/grid.1001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/Images/grid_udim/grid.1002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/Images/grid_udim/grid.1003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/Images/grid_udim/grid.1011.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/Images/grid_udim/grid.1012.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/Images/grid_udim/grid.1013.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions resources/Materials/TestSuite/stdlib/texture/udim.mtlx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<materialx version="1.38">
<image name="image_color" type="color3">
<input name="file" type="filename" value="resources/Images/grid_udim/grid.<UDIM>.png" colorspace="srgb_texture" />
</image>
<geominfo name="cube_geom" geom="/">
<geomprop name="udimset" type="stringarray" value="1001, 1002, 1003, 1011, 1012, 1013" />
</geominfo>
<standard_surface name="cube_shader" type="surfaceshader">
<input name="base_color" type="color3" nodename="image_color" />
</standard_surface>
<surfacematerial name="cube_material" type="material">
<input name="surfaceshader" type="surfaceshader" nodename="cube_shader" />
</surfacematerial>
</materialx>
18 changes: 9 additions & 9 deletions source/MaterialXGraphEditor/RenderView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,15 +403,6 @@ void RenderView::updateMaterials(mx::TypedElementPtr typedElem)
// Check for any udim set.
mx::ValuePtr udimSetValue = _document->getGeomPropValue(mx::UDIM_SET_PROPERTY);

// Skip material nodes without upstream shaders.
mx::NodePtr node = typedElem ? typedElem->asA<mx::Node>() : nullptr;
if (node &&
node->getCategory() == mx::SURFACE_MATERIAL_NODE_STRING &&
mx::getShaderNodes(node).empty())
{
typedElem = nullptr;
}

// Create new materials.
if (!typedElem)
{
Expand All @@ -422,6 +413,15 @@ void RenderView::updateMaterials(mx::TypedElementPtr typedElem)
}
}

// Skip material nodes without upstream shaders.
mx::NodePtr node = typedElem ? typedElem->asA<mx::Node>() : nullptr;
if (node &&
node->getCategory() == mx::SURFACE_MATERIAL_NODE_STRING &&
mx::getShaderNodes(node).empty())
{
typedElem = nullptr;
}

mx::TypedElementPtr udimElement = nullptr;
mx::NodePtr materialNode = nullptr;
if (typedElem)
Expand Down