Skip to content

Commit

Permalink
Merge pull request #6271 from GafferHQ/rileyRendererPR
Browse files Browse the repository at this point in the history
Add RenderMan renderer backend
  • Loading branch information
johnhaddon authored Feb 21, 2025
2 parents 16b2944 + bec4d43 commit 26c896a
Show file tree
Hide file tree
Showing 29 changed files with 5,668 additions and 2 deletions.
20 changes: 19 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -1348,11 +1348,13 @@ libraries = {
# can continue to compile with warnings as errors.
"CPPDEFINES" : [ "RMAN_RIX_NO_WARN_DEPRECATED" ],
"LIBS" : [
"GafferScene", "IECoreScene",
"GafferScene", "IECoreScene$CORTEX_LIB_SUFFIX",
"IECoreVDB$CORTEX_LIB_SUFFIX",
"prman" if env["PLATFORM"] != "win32" else "libprman",
"pxrcore" if env["PLATFORM"] != "win32" else "libpxrcore",
"oslquery$OSL_LIB_SUFFIX",
"OpenImageIO_Util$OIIO_LIB_SUFFIX",
"openvdb$VDB_LIB_SUFFIX",
],
"LIBPATH" : [ "$RENDERMAN_ROOT/lib" ],
},
Expand All @@ -1362,6 +1364,22 @@ libraries = {
"requiredOptions" : [ "RENDERMAN_ROOT" ],
},

"IECoreRenderManDisplay" : {
"envAppends" : {
"LIBS" : [ "IECoreImage$CORTEX_LIB_SUFFIX" ],
"CPPPATH" : [ "$RENDERMAN_ROOT/include" ],
},
"envReplacements" : {
"SHLIBPREFIX" : "",
},
"installName" : "renderManPlugins/d_ieDisplay",
"requiredOptions" : [ "RENDERMAN_ROOT" ],
},

"IECoreRenderManTest" : {
"requiredOptions" : [ "RENDERMAN_ROOT" ],
},

"GafferTractor" : {},

"GafferTractorTest" : {},
Expand Down
19 changes: 19 additions & 0 deletions bin/gaffer
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,25 @@ if [[ -n $ONNX_ROOT ]] ; then

fi

# Set up RenderMan
##########################################################################

if [[ -n $RMANTREE ]] ; then

if [[ `uname` = "Linux" ]] ; then
appendToPath "$RMANTREE/lib" LD_LIBRARY_PATH
else
appendToPath "$RMANTREE/lib" DYLD_LIBRARY_PATH
fi

appendToPath "$RMANTREE/bin" PATH
appendToPath "$RMANTREE/bin" PYTHONPATH
appendToPath "$RMANTREE/lib/plugins" RMAN_RIXPLUGINPATH
appendToPath "$GAFFER_ROOT/renderManPlugins" RMAN_DISPLAYS_PATH
appendToPath "$RMANTREE/lib/shaders" OSL_SHADER_PATHS

fi

# Set up 3rd Party extensions
##########################################################################

Expand Down
46 changes: 46 additions & 0 deletions contrib/scripts/renderManPrototypeAttributes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
##########################################################################
#
# Copyright (c) 2024, Cinesite VFX Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
#
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided with
# the distribution.
#
# * Neither the name of John Haddon nor the names of
# any other contributors to this software may be used to endorse or
# promote products derived from this software without specific prior
# written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
##########################################################################

import os
import pathlib
from xml.etree import cElementTree

file = pathlib.Path( os.environ["RMANTREE"] ) / "lib" / "defaults" / "PRManPrimVars.args"

for event, element in cElementTree.iterparse( file, events = ( "start", ) ) :

if element.tag == "param" :
print( '{{ "ri:{name}", RtUString( "{name}" ) }},'.format( name = element.attrib.get( "name" ) ) )
37 changes: 37 additions & 0 deletions python/IECoreRenderMan/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
##########################################################################
#
# Copyright (c) 2024, Cinesite VFX Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
#
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided with
# the distribution.
#
# * Neither the name of John Haddon nor the names of
# any other contributors to this software may be used to endorse or
# promote products derived from this software without specific prior
# written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
##########################################################################

from ._IECoreRenderMan import *
Loading

0 comments on commit 26c896a

Please sign in to comment.