Skip to content

Commit

Permalink
Merge pull request #6285 from ericmehl/renderManWindows
Browse files Browse the repository at this point in the history
IECoreRenderMan Windows
  • Loading branch information
johnhaddon authored Feb 25, 2025
2 parents 7ac4311 + 62b96c1 commit 6d20bc9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
11 changes: 11 additions & 0 deletions bin/gaffer.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,17 @@ if "%ONNX_ROOT%" NEQ "" (
call :appendToPath "%ONNX_ROOT%\lib" PATH
)

rem RenderMan
rem =========

if "%RMANTREE%" NEQ "" (
call :appendToPath "%RMANTREE%" GAFFER_EXTENSION_PATHS
call :appendToPath "%RMANTREE%\bin" PYTHONPATH
call :appendToPath "%RMANTREE%\lib\plugins" RMAN_RIXPLUGINPATH
call :appendToPath "%RMANTREE%\lib\shaders" OSL_SHADER_PATHS
call :appendToPath "%GAFFER_ROOT%\renderManPlugins" RMAN_DISPLAYS_PATH
)

rem Set up 3rd party extensions
rem Batch files are awkward at `for` loops. The default `for`, without `/f`
rem uses semi-colons AND spaces as delimiters, meaning we would not be able
Expand Down
9 changes: 9 additions & 0 deletions python/IECoreRenderMan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,12 @@
##########################################################################

from ._IECoreRenderMan import *

import os
import ctypes
if os.name == "nt" :
# Because `_IECoreRenderMan.pyd` currently doesn't require any symbols
# from `IECoreRenderMan.dll`, the Windows linker omits the latter. Load
# it explicitly, because it registers the renderer.
ctypes.CDLL( "IECoreRenderMan.dll" )
del os, ctypes
9 changes: 7 additions & 2 deletions python/IECoreRenderManTest/RendererTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,16 @@ def testOutput( self ) :
del r

self.assertTrue( ( self.temporaryDirectory() / "rgb.exr" ).is_file() )
imageSpec = OpenImageIO.ImageInput.open( str( self.temporaryDirectory() / "rgb.exr" ) ).spec()
imageFile = OpenImageIO.ImageInput.open( str( self.temporaryDirectory() / "rgb.exr" ) )
imageSpec = imageFile.spec()
imageFile.close()
self.assertEqual( imageSpec.nchannels, 3 )
self.assertEqual( imageSpec.channelnames, ( "R", "G", "B" ) )

self.assertTrue( ( self.temporaryDirectory() / "rgba.exr" ).is_file() )
imageSpec = OpenImageIO.ImageInput.open( str( self.temporaryDirectory() / "rgba.exr" ) ).spec()
imageFile = OpenImageIO.ImageInput.open( str( self.temporaryDirectory() / "rgba.exr" ) )
imageSpec = imageFile.spec()
imageFile.close()
self.assertEqual( imageSpec.nchannels, 4 )
self.assertEqual( imageSpec.channelnames, ( "R", "G", "B", "A" ) )

Expand Down Expand Up @@ -184,6 +188,7 @@ def testMissingLightShader( self ) :
self.assertEqual( messageHandler.messages[0].level, IECore.MessageHandler.Level.Warning )
self.assertEqual( messageHandler.messages[0].message, "Unable to find shader \"BadShader\"." )

del lightAttributes
del light
del renderer

Expand Down

0 comments on commit 6d20bc9

Please sign in to comment.