diff --git a/test/lib/mayaUsd/render/mayaToHydra/CMakeLists.txt b/test/lib/mayaUsd/render/mayaToHydra/CMakeLists.txt index 8a0b39ef1c..69149d3e27 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/CMakeLists.txt +++ b/test/lib/mayaUsd/render/mayaToHydra/CMakeLists.txt @@ -19,6 +19,7 @@ set(INTERACTIVE_TEST_SCRIPT_FILES testStageVariants.py testArnoldLights.py testNurbsPrimitives.py + testPolygonPrimitives.py cpp/testColorPreferences.py cpp/testCppFramework.py cpp/testMayaSceneFlattening.py diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/cube_fresh.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/cube_fresh.png new file mode 100644 index 0000000000..2910843aa1 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/cube_fresh.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/cube_modified.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/cube_modified.png new file mode 100644 index 0000000000..b2972a2f10 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/cube_modified.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/cylinder_fresh.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/cylinder_fresh.png new file mode 100644 index 0000000000..c83082c27f Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/cylinder_fresh.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/cylinder_modified.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/cylinder_modified.png new file mode 100644 index 0000000000..0948abdde4 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/cylinder_modified.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/cylinder_roundCap.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/cylinder_roundCap.png new file mode 100644 index 0000000000..0ff9dcfae8 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/cylinder_roundCap.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/cylinder_roundCapHeightCompensation.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/cylinder_roundCapHeightCompensation.png new file mode 100644 index 0000000000..a462af2f7c Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/cylinder_roundCapHeightCompensation.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/disc_fresh.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/disc_fresh.png new file mode 100644 index 0000000000..69adcd423f Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/disc_fresh.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/disc_subdivision_caps.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/disc_subdivision_caps.png new file mode 100644 index 0000000000..df7bff1301 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/disc_subdivision_caps.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/disc_subdivision_circle.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/disc_subdivision_circle.png new file mode 100644 index 0000000000..d5da210e89 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/disc_subdivision_circle.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/disc_subdivision_pie.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/disc_subdivision_pie.png new file mode 100644 index 0000000000..c0d2c49ed1 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/disc_subdivision_pie.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/disc_subdivision_quads.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/disc_subdivision_quads.png new file mode 100644 index 0000000000..496de028f8 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/disc_subdivision_quads.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/disc_subdivision_triangles.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/disc_subdivision_triangles.png new file mode 100644 index 0000000000..799a711d42 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/disc_subdivision_triangles.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/gear_fresh.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/gear_fresh.png new file mode 100644 index 0000000000..5fddb1de43 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/gear_fresh.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/gear_modified.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/gear_modified.png new file mode 100644 index 0000000000..2837c0f7c8 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/gear_modified.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/helix_clockwise.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/helix_clockwise.png new file mode 100644 index 0000000000..4e728a69b8 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/helix_clockwise.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/helix_fresh.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/helix_fresh.png new file mode 100644 index 0000000000..d54e16a1de Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/helix_fresh.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/helix_modified.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/helix_modified.png new file mode 100644 index 0000000000..ba1c56ad87 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/helix_modified.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/helix_roundCap.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/helix_roundCap.png new file mode 100644 index 0000000000..ecd60268cf Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/helix_roundCap.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pipe_fresh.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pipe_fresh.png new file mode 100644 index 0000000000..2a0744d817 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pipe_fresh.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pipe_modified.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pipe_modified.png new file mode 100644 index 0000000000..562b3c60af Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pipe_modified.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pipe_roundCap.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pipe_roundCap.png new file mode 100644 index 0000000000..4da8c263b6 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pipe_roundCap.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pipe_roundCapHeightCompensation.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pipe_roundCapHeightCompensation.png new file mode 100644 index 0000000000..4db2d3974d Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pipe_roundCapHeightCompensation.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/platonic_cube_triangles.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/platonic_cube_triangles.png new file mode 100644 index 0000000000..c832caa11f Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/platonic_cube_triangles.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/platonic_dodecahedron_caps.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/platonic_dodecahedron_caps.png new file mode 100644 index 0000000000..7bba41d699 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/platonic_dodecahedron_caps.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/platonic_fresh.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/platonic_fresh.png new file mode 100644 index 0000000000..ed4942e7c4 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/platonic_fresh.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/platonic_icosahedron_triangles.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/platonic_icosahedron_triangles.png new file mode 100644 index 0000000000..07194e2f6e Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/platonic_icosahedron_triangles.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/platonic_octahedron_pie.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/platonic_octahedron_pie.png new file mode 100644 index 0000000000..2d19ff4685 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/platonic_octahedron_pie.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/platonic_tetrahedron_quads.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/platonic_tetrahedron_quads.png new file mode 100644 index 0000000000..824856c093 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/platonic_tetrahedron_quads.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/prism_5sides.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/prism_5sides.png new file mode 100644 index 0000000000..4f5a6c322e Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/prism_5sides.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/prism_8sides.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/prism_8sides.png new file mode 100644 index 0000000000..7ab16d0fd5 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/prism_8sides.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/prism_fresh.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/prism_fresh.png new file mode 100644 index 0000000000..5c3a42594b Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/prism_fresh.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pyramid_3sides.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pyramid_3sides.png new file mode 100644 index 0000000000..640be6c80a Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pyramid_3sides.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pyramid_4sides.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pyramid_4sides.png new file mode 100644 index 0000000000..23cc872d84 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pyramid_4sides.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pyramid_5sides.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pyramid_5sides.png new file mode 100644 index 0000000000..a4e3b92011 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pyramid_5sides.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pyramid_fresh.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pyramid_fresh.png new file mode 100644 index 0000000000..738f84d1bc Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/pyramid_fresh.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/soccerball_fresh.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/soccerball_fresh.png new file mode 100644 index 0000000000..38a8a27b61 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/soccerball_fresh.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/soccerball_modified.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/soccerball_modified.png new file mode 100644 index 0000000000..1e66d59ebb Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/soccerball_modified.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/sphericalHarmonics_fresh.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/sphericalHarmonics_fresh.png new file mode 100644 index 0000000000..3a9e35f314 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/sphericalHarmonics_fresh.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/sphericalHarmonics_helix.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/sphericalHarmonics_helix.png new file mode 100644 index 0000000000..be7e228cd2 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/sphericalHarmonics_helix.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/sphericalHarmonics_modified.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/sphericalHarmonics_modified.png new file mode 100644 index 0000000000..70674dd260 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/sphericalHarmonics_modified.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/superEllipse_fresh.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/superEllipse_fresh.png new file mode 100644 index 0000000000..5cde184119 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/superEllipse_fresh.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/superEllipse_helix.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/superEllipse_helix.png new file mode 100644 index 0000000000..9644ac0428 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/superEllipse_helix.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/superEllipse_mirror.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/superEllipse_mirror.png new file mode 100644 index 0000000000..c3be3bd22f Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/superEllipse_mirror.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/superEllipse_modified.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/superEllipse_modified.png new file mode 100644 index 0000000000..0926bdd719 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/superEllipse_modified.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/torus_fresh.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/torus_fresh.png new file mode 100644 index 0000000000..89ea4186d9 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/torus_fresh.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/torus_modified.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/torus_modified.png new file mode 100644 index 0000000000..77cae01075 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/torus_modified.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/ultra_fresh.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/ultra_fresh.png new file mode 100644 index 0000000000..3a9e35f314 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/ultra_fresh.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/ultra_helix.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/ultra_helix.png new file mode 100644 index 0000000000..d7e12b3300 Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/ultra_helix.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/ultra_modified.png b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/ultra_modified.png new file mode 100644 index 0000000000..5bee7f49ec Binary files /dev/null and b/test/lib/mayaUsd/render/mayaToHydra/PolygonPrimitivesTest/ultra_modified.png differ diff --git a/test/lib/mayaUsd/render/mayaToHydra/testArnoldLights.py b/test/lib/mayaUsd/render/mayaToHydra/testArnoldLights.py index 4e171e08ae..3592dc3450 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testArnoldLights.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testArnoldLights.py @@ -31,7 +31,7 @@ def imageDiffFailThreshold(self): @property def imageDiffFailPercent(self): - # Wireframes seem to have a slightly different color on macOS. We'll increase the thresholds + # HYDRA-837 : Wireframes seem to have a slightly different color on macOS. We'll increase the thresholds # for that platform specifically for now, so we can still catch issues on other platforms. if platform.system() == "Darwin": return 3 diff --git a/test/lib/mayaUsd/render/mayaToHydra/testMayaLights.py b/test/lib/mayaUsd/render/mayaToHydra/testMayaLights.py index 43a2467991..11ee9c441c 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testMayaLights.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testMayaLights.py @@ -32,7 +32,7 @@ def imageDiffFailThreshold(self): @property def imageDiffFailPercent(self): - # Wireframes seem to have a slightly different color on macOS. We'll increase the thresholds + # HYDRA-837 : Wireframes seem to have a slightly different color on macOS. We'll increase the thresholds # for that platform specifically for now, so we can still catch issues on other platforms. if platform.system() == "Darwin": return 3 diff --git a/test/lib/mayaUsd/render/mayaToHydra/testPolygonPrimitives.py b/test/lib/mayaUsd/render/mayaToHydra/testPolygonPrimitives.py new file mode 100644 index 0000000000..6ce36c1832 --- /dev/null +++ b/test/lib/mayaUsd/render/mayaToHydra/testPolygonPrimitives.py @@ -0,0 +1,361 @@ +# Copyright 2024 Autodesk +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import maya.cmds as cmds +import fixturesUtils +import mtohUtils + +import platform + +class TestPolygonPrimitives(mtohUtils.MtohTestCase): + # MayaHydraBaseTestCase.setUpClass requirement. + _file = __file__ + + @property + def imageDiffFailThreshold(self): + return 0.1 + + @property + def imageDiffFailPercent(self): + # HYDRA-837 : Wireframes seem to have a slightly different color on macOS. We'll increase the thresholds + # for that platform specifically for now, so we can still catch issues on other platforms. + if platform.system() == "Darwin": + return 2 + return 0.5 + + def compareSnapshot(self, referenceFilename, cameraDistance=15): + self.setBasicCam(cameraDistance) + cmds.refresh() + self.assertSnapshotClose(referenceFilename, self.imageDiffFailThreshold, self.imageDiffFailPercent) + + def setupScene(self, polygonCreationCallable): + self.setHdStormRenderer() + polyCreatorNodeName = polygonCreationCallable()[1] + cmds.refresh() + return polyCreatorNodeName + + def getSuperShapeCreationCallable(self, shapeType): + # Base parameters to have an actually visible mesh + return lambda: cmds.polySuperShape( + shape=shapeType, + radius=1, + horizontalDivisions=1, + verticalDivisions=1, + mergeVertices=True) + + def setupSuperShapeHelix(self, polyCreatorNodeName): + cmds.setAttr(polyCreatorNodeName + ".mergeVertices", False) + cmds.setAttr(polyCreatorNodeName + ".horizontalRevolutions", 1) + cmds.setAttr(polyCreatorNodeName + ".verticalRevolutions", 1) + cmds.setAttr(polyCreatorNodeName + ".verticalOffset", 2) + cmds.setAttr(polyCreatorNodeName + ".internalRadius", 2) + cmds.setAttr(polyCreatorNodeName + ".xOffset", 0.25) + cmds.setAttr(polyCreatorNodeName + ".zOffset", 0.75) + + # Cube attributes is a superset of plane attributes + def test_PolygonCube(self): + polyCreatorNodeName = self.setupScene(cmds.polyCube) + self.compareSnapshot("cube_fresh.png", 5) + + cmds.setAttr(polyCreatorNodeName + ".width", 6) + cmds.setAttr(polyCreatorNodeName + ".height", 10) + cmds.setAttr(polyCreatorNodeName + ".depth", 4) + cmds.setAttr(polyCreatorNodeName + ".heightBaseline", -0.5) + cmds.setAttr(polyCreatorNodeName + ".subdivisionsWidth", 5) + cmds.setAttr(polyCreatorNodeName + ".subdivisionsHeight", 6) + cmds.setAttr(polyCreatorNodeName + ".subdivisionsDepth", 7) + cmds.setAttr(polyCreatorNodeName + ".axisX", 1) + cmds.setAttr(polyCreatorNodeName + ".axisY", 2) + cmds.setAttr(polyCreatorNodeName + ".axisZ", -1) + self.compareSnapshot("cube_modified.png") + + # Cylinder attributes is a superset of sphere and cone + def test_PolygonCylinder(self): + polyCreatorNodeName = self.setupScene(cmds.polyCylinder) + self.compareSnapshot("cylinder_fresh.png", 5) + + cmds.setAttr(polyCreatorNodeName + ".radius", 3) + cmds.setAttr(polyCreatorNodeName + ".height", 5) + cmds.setAttr(polyCreatorNodeName + ".heightBaseline", 0.5) + cmds.setAttr(polyCreatorNodeName + ".subdivisionsAxis", 10) + cmds.setAttr(polyCreatorNodeName + ".subdivisionsHeight", 5) + cmds.setAttr(polyCreatorNodeName + ".subdivisionsCaps", 5) + cmds.setAttr(polyCreatorNodeName + ".axisX", 1) + cmds.setAttr(polyCreatorNodeName + ".axisY", 2) + cmds.setAttr(polyCreatorNodeName + ".axisZ", -1) + self.compareSnapshot("cylinder_modified.png") + + cmds.setAttr(polyCreatorNodeName + ".roundCap", True) + self.compareSnapshot("cylinder_roundCap.png") + + cmds.setAttr(polyCreatorNodeName + ".roundCapHeightCompensation", True) + self.compareSnapshot("cylinder_roundCapHeightCompensation.png") + + def test_PolygonTorus(self): + polyCreatorNodeName = self.setupScene(cmds.polyTorus) + self.compareSnapshot("torus_fresh.png", 5) + + cmds.setAttr(polyCreatorNodeName + ".radius", 4) + cmds.setAttr(polyCreatorNodeName + ".sectionRadius", 2) + cmds.setAttr(polyCreatorNodeName + ".twist", 15) + cmds.setAttr(polyCreatorNodeName + ".heightBaseline", 1) + cmds.setAttr(polyCreatorNodeName + ".subdivisionsAxis", 10) + cmds.setAttr(polyCreatorNodeName + ".subdivisionsHeight", 10) + cmds.setAttr(polyCreatorNodeName + ".axisX", 1) + cmds.setAttr(polyCreatorNodeName + ".axisY", 2) + cmds.setAttr(polyCreatorNodeName + ".axisZ", -1) + self.compareSnapshot("torus_modified.png") + + def test_PolygonDisc(self): + polyCreatorNodeName = self.setupScene(cmds.polyDisc) + self.compareSnapshot("disc_fresh.png", 5) + + cmds.setAttr(polyCreatorNodeName + ".sides", 10) + cmds.setAttr(polyCreatorNodeName + ".subdivisions", 2) + cmds.setAttr(polyCreatorNodeName + ".radius", 5) + cmds.setAttr(polyCreatorNodeName + ".heightBaseline", 0.5) + + cmds.setAttr(polyCreatorNodeName + ".subdivisionMode", 0) + self.compareSnapshot("disc_subdivision_quads.png") + + cmds.setAttr(polyCreatorNodeName + ".subdivisionMode", 1) + self.compareSnapshot("disc_subdivision_triangles.png") + + cmds.setAttr(polyCreatorNodeName + ".subdivisionMode", 2) + self.compareSnapshot("disc_subdivision_pie.png") + + cmds.setAttr(polyCreatorNodeName + ".subdivisionMode", 3) + self.compareSnapshot("disc_subdivision_caps.png") + + cmds.setAttr(polyCreatorNodeName + ".subdivisionMode", 4) + self.compareSnapshot("disc_subdivision_circle.png") + + def test_PolygonPlatonicSolid(self): + polyCreatorNodeName = self.setupScene(cmds.polyPlatonic) + self.compareSnapshot("platonic_fresh.png", 5) + + cmds.setAttr(polyCreatorNodeName + ".subdivisions", 2) + cmds.setAttr(polyCreatorNodeName + ".radius", 4) + cmds.setAttr(polyCreatorNodeName + ".heightBaseline", 0.5) + cmds.setAttr(polyCreatorNodeName + ".sphericalInflation", 0.5) + + cmds.setAttr(polyCreatorNodeName + ".primitive", 0) + cmds.setAttr(polyCreatorNodeName + ".subdivisionMode", 0) + self.compareSnapshot("platonic_tetrahedron_quads.png") + + cmds.setAttr(polyCreatorNodeName + ".primitive", 1) + cmds.setAttr(polyCreatorNodeName + ".subdivisionMode", 1) + self.compareSnapshot("platonic_cube_triangles.png") + + cmds.setAttr(polyCreatorNodeName + ".primitive", 2) + cmds.setAttr(polyCreatorNodeName + ".subdivisionMode", 2) + self.compareSnapshot("platonic_octahedron_pie.png") + + cmds.setAttr(polyCreatorNodeName + ".primitive", 3) + cmds.setAttr(polyCreatorNodeName + ".subdivisionMode", 3) + self.compareSnapshot("platonic_dodecahedron_caps.png") + + cmds.setAttr(polyCreatorNodeName + ".primitive", 4) + cmds.setAttr(polyCreatorNodeName + ".subdivisionMode", 1) + self.compareSnapshot("platonic_icosahedron_triangles.png") + + def test_PolygonPyramid(self): + polyCreatorNodeName = self.setupScene(cmds.polyPyramid) + self.compareSnapshot("pyramid_fresh.png", 5) + + cmds.setAttr(polyCreatorNodeName + ".sideLength", 5) + cmds.setAttr(polyCreatorNodeName + ".heightBaseline", -0.5) + cmds.setAttr(polyCreatorNodeName + ".subdivisionsHeight", 5) + cmds.setAttr(polyCreatorNodeName + ".subdivisionsCaps", 2) + cmds.setAttr(polyCreatorNodeName + ".axisX", 1) + cmds.setAttr(polyCreatorNodeName + ".axisY", -3) + cmds.setAttr(polyCreatorNodeName + ".axisZ", -0.25) + + cmds.setAttr(polyCreatorNodeName + ".numberOfSides", 3) + self.compareSnapshot("pyramid_3sides.png") + + cmds.setAttr(polyCreatorNodeName + ".numberOfSides", 4) + self.compareSnapshot("pyramid_4sides.png") + + cmds.setAttr(polyCreatorNodeName + ".numberOfSides", 5) + self.compareSnapshot("pyramid_5sides.png") + + def test_PolygonPrism(self): + polyCreatorNodeName = self.setupScene(cmds.polyPrism) + self.compareSnapshot("prism_fresh.png", 5) + + cmds.setAttr(polyCreatorNodeName + ".length", 4) + cmds.setAttr(polyCreatorNodeName + ".sideLength", 5) + cmds.setAttr(polyCreatorNodeName + ".heightBaseline", 0.5) + cmds.setAttr(polyCreatorNodeName + ".subdivisionsHeight", 5) + cmds.setAttr(polyCreatorNodeName + ".subdivisionsCaps", 2) + cmds.setAttr(polyCreatorNodeName + ".axisX", 0.25) + cmds.setAttr(polyCreatorNodeName + ".axisY", -3) + cmds.setAttr(polyCreatorNodeName + ".axisZ", -0.5) + + cmds.setAttr(polyCreatorNodeName + ".numberOfSides", 5) + self.compareSnapshot("prism_5sides.png") + + cmds.setAttr(polyCreatorNodeName + ".numberOfSides", 8) + self.compareSnapshot("prism_8sides.png") + + def test_PolygonPipe(self): + polyCreatorNodeName = self.setupScene(cmds.polyPipe) + self.compareSnapshot("pipe_fresh.png", 5) + + cmds.setAttr(polyCreatorNodeName + ".radius", 3) + cmds.setAttr(polyCreatorNodeName + ".height", 5) + cmds.setAttr(polyCreatorNodeName + ".thickness", 1) + cmds.setAttr(polyCreatorNodeName + ".heightBaseline", 0.5) + cmds.setAttr(polyCreatorNodeName + ".subdivisionsAxis", 10) + cmds.setAttr(polyCreatorNodeName + ".subdivisionsHeight", 5) + cmds.setAttr(polyCreatorNodeName + ".subdivisionsCaps", 2) + cmds.setAttr(polyCreatorNodeName + ".axisX", 1) + cmds.setAttr(polyCreatorNodeName + ".axisY", 2) + cmds.setAttr(polyCreatorNodeName + ".axisZ", -0.25) + self.compareSnapshot("pipe_modified.png") + + cmds.setAttr(polyCreatorNodeName + ".roundCap", True) + self.compareSnapshot("pipe_roundCap.png") + + cmds.setAttr(polyCreatorNodeName + ".roundCapHeightCompensation", True) + self.compareSnapshot("pipe_roundCapHeightCompensation.png") + + def test_PolygonHelix(self): + polyCreatorNodeName = self.setupScene(cmds.polyHelix) + self.compareSnapshot("helix_fresh.png", 5) + + cmds.setAttr(polyCreatorNodeName + ".coils", 2) + cmds.setAttr(polyCreatorNodeName + ".height", 5) + cmds.setAttr(polyCreatorNodeName + ".width", 5) + cmds.setAttr(polyCreatorNodeName + ".radius", 0.5) + cmds.setAttr(polyCreatorNodeName + ".heightBaseline", 0.5) + cmds.setAttr(polyCreatorNodeName + ".subdivisionsAxis", 10) + cmds.setAttr(polyCreatorNodeName + ".subdivisionsCoil", 10) + cmds.setAttr(polyCreatorNodeName + ".subdivisionsCaps", 1) + cmds.setAttr(polyCreatorNodeName + ".axisX", 1) + cmds.setAttr(polyCreatorNodeName + ".axisY", 2) + cmds.setAttr(polyCreatorNodeName + ".axisZ", -0.25) + self.compareSnapshot("helix_modified.png") + + cmds.setAttr(polyCreatorNodeName + ".roundCap", True) + self.compareSnapshot("helix_roundCap.png") + + cmds.setAttr(polyCreatorNodeName + ".direction", 0) + self.compareSnapshot("helix_clockwise.png") + + def test_PolygonGear(self): + polyCreatorNodeName = self.setupScene(cmds.polyGear) + self.compareSnapshot("gear_fresh.png", 5) + + cmds.setAttr(polyCreatorNodeName + ".sides", 10) + cmds.setAttr(polyCreatorNodeName + ".radius", 5) + cmds.setAttr(polyCreatorNodeName + ".internalRadius", 2) + cmds.setAttr(polyCreatorNodeName + ".height", 5) + cmds.setAttr(polyCreatorNodeName + ".heightDivisions", 5) + cmds.setAttr(polyCreatorNodeName + ".heightBaseline", 0.5) + cmds.setAttr(polyCreatorNodeName + ".gearSpacing", 0.5) + cmds.setAttr(polyCreatorNodeName + ".gearOffset", 2) + cmds.setAttr(polyCreatorNodeName + ".gearTip", 1) + cmds.setAttr(polyCreatorNodeName + ".gearMiddle", 0.75) + cmds.setAttr(polyCreatorNodeName + ".twist", 10) + cmds.setAttr(polyCreatorNodeName + ".taper", 1.25) + self.compareSnapshot("gear_modified.png") + + def test_PolygonSoccerBall(self): + polyCreatorNodeName = self.setupScene(cmds.polyPrimitive) + self.compareSnapshot("soccerball_fresh.png", 5) + + cmds.setAttr(polyCreatorNodeName + ".radius", 4) + cmds.setAttr(polyCreatorNodeName + ".sideLength", 2) + # Radius and side length are tied together, changing one changes the other + self.assertAlmostEqual(cmds.getAttr(polyCreatorNodeName + ".radius"), 4.955, 3) + cmds.setAttr(polyCreatorNodeName + ".heightBaseline", 0.5) + cmds.setAttr(polyCreatorNodeName + ".axisX", 1) + cmds.setAttr(polyCreatorNodeName + ".axisY", 2) + cmds.setAttr(polyCreatorNodeName + ".axisZ", -1) + self.compareSnapshot("soccerball_modified.png") + + def test_PolygonSuperEllipse(self): + polyCreatorNodeName = self.setupScene(self.getSuperShapeCreationCallable("SuperEllipse")) + self.compareSnapshot("superEllipse_fresh.png", 5) + + cmds.setAttr(polyCreatorNodeName + ".radius", 5) + cmds.setAttr(polyCreatorNodeName + ".heightBaseline", 0.5) + cmds.setAttr(polyCreatorNodeName + ".horizontalDivisions", 4) + cmds.setAttr(polyCreatorNodeName + ".verticalDivisions", 4) + cmds.setAttr(polyCreatorNodeName + ".ellipse0", 0.75) + cmds.setAttr(polyCreatorNodeName + ".ellipse1", 1.25) + self.compareSnapshot("superEllipse_modified.png") + + cmds.setAttr(polyCreatorNodeName + ".ellipseMirror", True) + self.compareSnapshot("superEllipse_mirror.png") + + self.setupSuperShapeHelix(polyCreatorNodeName) + self.compareSnapshot("superEllipse_helix.png") + + def test_PolygonSphericalHarmonics(self): + polyCreatorNodeName = self.setupScene(self.getSuperShapeCreationCallable("SphericalHarmonics")) + self.compareSnapshot("sphericalHarmonics_fresh.png", 5) + + cmds.setAttr(polyCreatorNodeName + ".radius", 5) + cmds.setAttr(polyCreatorNodeName + ".heightBaseline", 0.5) + cmds.setAttr(polyCreatorNodeName + ".horizontalDivisions", 4) + cmds.setAttr(polyCreatorNodeName + ".verticalDivisions", 4) + cmds.setAttr(polyCreatorNodeName + ".harmonics0", 1) + cmds.setAttr(polyCreatorNodeName + ".harmonics1", 2) + cmds.setAttr(polyCreatorNodeName + ".harmonics2", 1) + cmds.setAttr(polyCreatorNodeName + ".harmonics3", 2) + cmds.setAttr(polyCreatorNodeName + ".harmonics4", 0.1) + cmds.setAttr(polyCreatorNodeName + ".harmonics5", 2) + cmds.setAttr(polyCreatorNodeName + ".harmonics6", 0.1) + cmds.setAttr(polyCreatorNodeName + ".harmonics7", 2) + self.compareSnapshot("sphericalHarmonics_modified.png") + + self.setupSuperShapeHelix(polyCreatorNodeName) + self.compareSnapshot("sphericalHarmonics_helix.png") + + def test_PolygonUltra(self): + polyCreatorNodeName = self.setupScene(self.getSuperShapeCreationCallable("UltraShape")) + self.compareSnapshot("ultra_fresh.png", 5) + + cmds.setAttr(polyCreatorNodeName + ".radius", 5) + cmds.setAttr(polyCreatorNodeName + ".heightBaseline", 0.5) + cmds.setAttr(polyCreatorNodeName + ".horizontalDivisions", 4) + cmds.setAttr(polyCreatorNodeName + ".verticalDivisions", 4) + # Horizontal attributes + cmds.setAttr(polyCreatorNodeName + ".ultra0", 2) # Horizontal Multiplier 1 + cmds.setAttr(polyCreatorNodeName + ".ultra1", 2) # Horizontal Exponent 1 + cmds.setAttr(polyCreatorNodeName + ".ultra2", 2) # Horizontal Exponent 2 + cmds.setAttr(polyCreatorNodeName + ".ultra3", 0.25) # Horizontal Mixer + cmds.setAttr(polyCreatorNodeName + ".ultra4", 3) # Horizontal Multiplier 2 + cmds.setAttr(polyCreatorNodeName + ".ultra5", 3) # Horizontal Exponent 3 + cmds.setAttr(polyCreatorNodeName + ".ultra6", 3) # Horizontal Exponent 4 + cmds.setAttr(polyCreatorNodeName + ".ultra7", 1.5) # Horizontal Exponent 5 + # Vertical attributes + cmds.setAttr(polyCreatorNodeName + ".ultra8", 3) # Vertical Multiplier 1 + cmds.setAttr(polyCreatorNodeName + ".ultra9", 3) # Vertical Exponent 1 + cmds.setAttr(polyCreatorNodeName + ".ultra10", 3) # Vertical Exponent 2 + cmds.setAttr(polyCreatorNodeName + ".ultra11", 0.75) # Vertical Mixer + cmds.setAttr(polyCreatorNodeName + ".ultra12", 2) # Vertical Multiplier 2 + cmds.setAttr(polyCreatorNodeName + ".ultra13", 2) # Vertical Exponent 3 + cmds.setAttr(polyCreatorNodeName + ".ultra14", 2) # Vertical Exponent 4 + cmds.setAttr(polyCreatorNodeName + ".ultra15", 1.5) # Vertical Exponent 5 + self.compareSnapshot("ultra_modified.png") + + self.setupSuperShapeHelix(polyCreatorNodeName) + self.compareSnapshot("ultra_helix.png") + +if __name__ == '__main__': + fixturesUtils.runTests(globals()) diff --git a/test/lib/mayaUsd/render/mayaToHydra/testUSDLights.py b/test/lib/mayaUsd/render/mayaToHydra/testUSDLights.py index 5d14f1b05c..53f36fd3ed 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testUSDLights.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testUSDLights.py @@ -31,7 +31,7 @@ def imageDiffFailThreshold(self): @property def imageDiffFailPercent(self): - # Wireframes seem to have a slightly different color on macOS. We'll increase the thresholds + # HYDRA-837 : Wireframes seem to have a slightly different color on macOS. We'll increase the thresholds # for that platform specifically for now, so we can still catch issues on other platforms. if platform.system() == "Darwin": return 5 diff --git a/test/testUtils/fixturesUtils.py b/test/testUtils/fixturesUtils.py index 36cc1a61b6..ab0dd39195 100644 --- a/test/testUtils/fixturesUtils.py +++ b/test/testUtils/fixturesUtils.py @@ -20,7 +20,7 @@ import unittest # Plugins that are bundled and loaded by default in a Maya installation -DEFAULT_PLUGINS = ['ArubaTessellator'] +DEFAULT_PLUGINS = ['ArubaTessellator', 'modelingToolkit'] def _setUpClass(modulePathName, pluginName, initializeStandalone): '''