Skip to content

HYDRA-1586 : Add a unit test to check against regression with bifrost… #278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,10 @@ def BuildAndInstall(context, buildArgs, stages):
if context.lookdevxLocation:
extraArgs.append('-DLOOKDEVX_LOCATION="{lookdevxLocation}"'
.format(lookdevxLocation=context.lookdevxLocation))

if context.bifrostLocation:
extraArgs.append('-DBIFROST_LOCATION="{bifrostLocation}"'
.format(bifrostLocation=context.bifrostLocation))

if context.pxrUsdLocation:
extraArgs.append('-DPXR_USD_LOCATION="{pxrUsdLocation}"'
Expand Down Expand Up @@ -614,6 +618,9 @@ def Package(context):

parser.add_argument("--lookdevx-location", type=str,
help="Directory where LookdevX is installed.")

parser.add_argument("--bifrost-location", type=str,
help="Directory where Bifrost is installed.")

parser.add_argument("--pxrusd-location", type=str,
help="Directory where Pixar USD is installed.")
Expand Down Expand Up @@ -750,6 +757,10 @@ def __init__(self, args):
self.lookdevxLocation = (os.path.abspath(args.lookdevx_location).replace("\\","/")
if args.lookdevx_location else None)

# Bifrost Location
self.bifrostLocation = (os.path.abspath(args.bifrost_location).replace("\\","/")
if args.bifrost_location else None)

# PXR USD Location
self.pxrUsdLocation = (os.path.abspath(args.pxrusd_location)
if args.pxrusd_location else None)
Expand Down
39 changes: 37 additions & 2 deletions cmake/test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -367,15 +367,50 @@ finally:
list(APPEND MAYAUSD_VARNAME_PATH
"${LOOKDEVX_LOCATION}/plug-ins")
list(APPEND MAYAUSD_VARNAME_MAYA_SCRIPT_PATH
"${LOOKDEVX_LOCATION}/AEtemplate")
"${LOOKDEVX_LOCATION}/scripts") #Contains some AE templates files
list(APPEND MAYAUSD_VARNAME_PYTHONPATH
"${LOOKDEVX_LOCATION}/scripts")
"${LOOKDEVX_LOCATION}/scripts")#Contains some python scripts
list(APPEND MAYAUSD_VARNAME_PYTHONPATH
"${LOOKDEVX_LOCATION}/python")
list(APPEND MAYAUSD_VARNAME_MAYA_PLUG_IN_PATH
"${LOOKDEVX_LOCATION}/plug-ins")
endif()

# bifrost
# Debug Print all subfolders from BIFROST_LOCATION
if(DEFINED BIFROST_LOCATION)
file(GLOB subdirs LIST_DIRECTORIES true "${BIFROST_LOCATION}/*")
foreach(subdir ${subdirs})
if(IS_DIRECTORY "${subdir}")
message(STATUS "BIFROST subfolder: ${subdir}")
endif()
endforeach()

# Check if ${BIFROST_LOCATION}/plug-ins exists
if(IS_DIRECTORY "${BIFROST_LOCATION}/plug-ins")
message(STATUS "${BIFROST_LOCATION}/plug-ins exists.")
else()
message(WARNING "${BIFROST_LOCATION}/plug-ins does not exist.")
endif()
else()
message(WARNING "BIFROST_LOCATION is not defined.")
endif()

if(DEFINED BIFROST_LOCATION)
list(APPEND MAYAUSD_VARNAME_PATH
"${BIFROST_LOCATION}/bin")
list(APPEND MAYAUSD_VARNAME_PATH
"${BIFROST_LOCATION}/plug-ins")
list(APPEND MAYAUSD_VARNAME_MAYA_SCRIPT_PATH
"${BIFROST_LOCATION}/scripts")#Contains some AE templates files
list(APPEND MAYAUSD_VARNAME_PYTHONPATH
"${BIFROST_LOCATION}/scripts")#Contains some python scripts
list(APPEND MAYAUSD_VARNAME_PYTHONPATH
"${BIFROST_LOCATION}/python")
list(APPEND MAYAUSD_VARNAME_MAYA_PLUG_IN_PATH
"${BIFROST_LOCATION}/plug-ins")
endif()

if(IS_WINDOWS AND DEFINED ENV{PYTHONHOME})
# If the environment contains a PYTHONHOME, also set the path to
# that folder so that we can find the python DLLs.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 18 additions & 13 deletions test/lib/mayaUsd/render/mayaToHydra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,25 @@ set(INTERACTIVE_TEST_SCRIPT_FILES
testStageAddPrim.py
testTransforms.py
testRefinement.py
testMaterialXOnNative.py|depOnPlugins:lookdevx
testNewSceneWithStage.py
# To be reenabled after investigation
#testMayaDisplayModes.py|skipOnPlatform:osx
testMayaShadingModes.py
testMayaDisplayLayers.py
testMayaIsolateSelect.py
testMayaLights.py
testUSDLights.py
testUVandUDIM.py
#Tests that have a dependency on other plugins
testMaterialXOnNative.py|depOnPlugins:lookdevx
testArnoldLights.py|depOnPlugins:mtoa
testViewportFilters.py|depOnPlugins:mtoa
testMayaLightingModes.py|depOnPlugins:mtoa
testBifrostGraphUpdate.py|depOnPlugins:bifrost
#End of tests that have a dependency on other plugins
testLookThrough.py
testObjectTemplate.py
testStandardSurface.py
testOpenPBRSurface.py
testFlowViewportAPI.py
testStageVariants.py|skipOnPlatform:osx # HYDRA-1127 : refinedWire not working on OSX
testStagePayloadsReferences.py
testNurbsPrimitives.py
testCurveTools.py
Expand All @@ -44,25 +46,27 @@ set(INTERACTIVE_TEST_SCRIPT_FILES
testGrid.py
testUsdTextureToggle.py
testUsdStageDefaultLighting.py
# To be reenabled after investigation
testDataProducerSelHighlight.py|skipOnPlatform:osx # HYDRA-1127 : refinedWire not working on OSX
testPassingNormalsOnMayaNative.py
testViewportFilters.py|depOnPlugins:mtoa
testMayaComponentsPicking.py
testFlowPluginsHierarchicalProperties.py
testCustomShadersNode.py
testMayaDefaultMaterial.py
testMayaLightingModes.py|depOnPlugins:mtoa
testSceneModified.py
testIsolateSelectWithGeomSubset.py
testMayaReference.py
testUsdInheritsSpecializes.py
testBoundingBox.py
#Disabled tests on OSX
testDataProducerSelHighlight.py|skipOnPlatform:osx # HYDRA-1127 : refinedWire not working on OSX
testPointInstancingWireframeHighlight.py|skipOnPlatform:osx # HYDRA-1127 : refinedWire not working on OSX
testGeomSubsetsWireframeHighlight.py|skipOnPlatform:osx # HYDRA-1127 : refinedWire not working on OSX
testNativeInstancingWireframeHighlight.py|skipOnPlatform:osx # HYDRA-1127 : refinedWire not working on OSX
testMeshWireframeHighlight.py|skipOnPlatform:osx # HYDRA-1127 : refinedWire not working on OSX
testSceneModified.py
testStageInstanceablePrimsSelHighlight.py|skipOnPlatform:osx # HYDRA-1315 : Wire not showing on OSX
testIsolateSelectWithGeomSubset.py
testMayaReference.py
testUsdInheritsSpecializes.py
testBoundingBox.py
testStageVariants.py|skipOnPlatform:osx # HYDRA-1127 : refinedWire not working on OSX
#HYDRA-1660 re-enable testMayaDisplayModes
#testMayaDisplayModes.py|skipOnPlatform:osx # HYDRA-1127 : refinedWire not working on OSX
#CPP tests
cpp/testColorPreferences.py
cpp/testCppFramework.py
cpp/testDataProducerExample.py
Expand All @@ -88,6 +92,7 @@ set(INTERACTIVE_TEST_SCRIPT_FILES
cpp/testSinglePicking.py
cpp/testSceneIndexDirtying.py
cpp/testUsdStageInvalidate.py
#CPP tests disabled on OSX
cpp/testWriteFile.py|skipOnPlatform:osx # HYDRA-1127 : refinedWire not working on OSX
)

Expand Down
43 changes: 43 additions & 0 deletions test/lib/mayaUsd/render/mayaToHydra/testBifrostGraphUpdate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright 2025 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 mayaUtils
import fixturesUtils
import mtohUtils
import maya.mel as mel

class TestBifrostGraphUpdate(mtohUtils.MayaHydraBaseTestCase):
_file = __file__
_requiredPlugins = ['bifrostGraph']

IMAGEDIFF_FAIL_THRESHOLD = 0.01
IMAGEDIFF_FAIL_PERCENT = 0.1

def verifySnapshot(self, imageName):
cmds.refresh()
self.assertSnapshotClose(imageName,
self.IMAGEDIFF_FAIL_THRESHOLD,
self.IMAGEDIFF_FAIL_PERCENT)

def test_BifrostGraphUpdate(self):
mayaUtils.openTestScene("testBifrost", "bifrost_node_update_hydra.ma")
self.setHdStormRenderer()
self.verifySnapshot("bifrostBeforeUpdate.png")
#Update the number of instances in the bifrost graph
mel.eval("vnnNode \"|createPointInstancerFromUsdFile|createPointInstancerFromUsdFileShape\" \"/scatter_points\" -setPortDefaultValues \"amount\" \"150\";")
self.verifySnapshot("bifrostAfterUpdate.png")

if __name__ == '__main__':
fixturesUtils.runTests(globals())
Loading
Loading