Skip to content

Commit

Permalink
Merge branch 'RB-10.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhaddon committed Feb 21, 2024
2 parents d0aed85 + 5dedde4 commit 8669056
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 104 deletions.
28 changes: 26 additions & 2 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
10.5.x.x (relative to 10.5.6.0)
10.5.x.x (relative to 10.5.6.2)
========



10.5.6.2 (relative to 10.5.6.1)
========

Fixes
-----

- USDScene : Fixed round-tripping of `ai:light` shader type for the output shader of light networks.

10.5.6.1 (relative to 10.5.6.0)
========

Fixes
-----

- USDScene : Fixed round-tripping of `__lights` set membership for non-UsdLux lights.
- DisplayDriverServer : Fixed delays connecting to the server on Windows.

Build
-----

- SConstruct : Support detection of OpenEXR versions with a patch version containing multiple digits.
- Fixed building with MSVC and Gaffer Dependencies 8.x.

10.5.6.0 (relative to 10.5.5.0)
========

Expand All @@ -11,7 +36,6 @@ Improvements
- `IECoreGL::ColorTexture`: Added new constructor that accepts an argument specifying the internal storage format to use.



10.5.5.0 (relative to 10.5.4.2)
========

Expand Down
6 changes: 4 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ SConsignFile()
ieCoreMilestoneVersion = 10 # for announcing major milestones - may contain all of the below
ieCoreMajorVersion = 5 # backwards-incompatible changes
ieCoreMinorVersion = 6 # new backwards-compatible features
ieCorePatchVersion = 0 # bug fixes
ieCorePatchVersion = 2 # bug fixes
ieCoreVersionSuffix = "" # used for alpha/beta releases. Example: "a1", "b2", etc.

###########################################################################################
Expand Down Expand Up @@ -1174,7 +1174,9 @@ else:
# that "C4275 can be ignored if you are deriving from a type in the
# C++ Standard Library", which is the case
"/wd4275",
"/wd4003", # suppress warning "not enough arguments for function-like macro invocation 'BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY'"
"/D_CRT_SECURE_NO_WARNINGS", # suppress warnings about getenv and similar
"/DHAVE_SNPRINTF", # Fixes error "multiple definitions of snprintf"
]
)

Expand Down Expand Up @@ -1308,7 +1310,7 @@ if doConfigure :

exrMajorVersion = None
for line in open( str( exrVersionHeader ) ) :
m = re.match( r'^#define OPENEXR_VERSION_STRING "(\d)\.(\d)\.(\d)"$', line )
m = re.match( r'^#define OPENEXR_VERSION_STRING "(\d)\.(\d)\.(\d+)"$', line )
if m :
exrMajorVersion = int( m.group( 1 ) )

Expand Down
36 changes: 15 additions & 21 deletions config/ie/buildAll
Original file line number Diff line number Diff line change
Expand Up @@ -115,30 +115,24 @@ nukeVersions = IEBuild.utils.versionsToInstall( "nuke" )
houdiniVersions = IEBuild.utils.versionsToInstall( "houdini" )
rvVersions = IEBuild.utils.versionsToInstall( "rv" )

if platform in ( "cent7.x86_64", ) :

for compilerVersion in compilerVersions:
for pythonVersion in pythonVersions :
build( [ "COMPILER_VERSION="+compilerVersion, "PYTHON_VERSION="+pythonVersion, "DL_VERSION=UNDEFINED" ] )
for compilerVersion in compilerVersions:
for pythonVersion in pythonVersions :
build( [ "COMPILER_VERSION="+compilerVersion, "PYTHON_VERSION="+pythonVersion, "DL_VERSION=UNDEFINED" ] )

for mayaVersion in mayaVersions :
compilerVersion = IEEnv.registry["apps"]["maya"][mayaVersion][platform]["compilerVersion"]
build( [ "APP=maya", "APP_VERSION="+mayaVersion ] )
for mayaVersion in mayaVersions :
compilerVersion = IEEnv.registry["apps"]["maya"][mayaVersion][platform]["compilerVersion"]
build( [ "APP=maya", "APP_VERSION="+mayaVersion ] )

for nukeVersion in nukeVersions :
compilerVersion = IEEnv.registry["apps"]["nuke"][nukeVersion][platform]["compilerVersion"]
build( [ "APP=nuke", "APP_VERSION="+nukeVersion ] )
for nukeVersion in nukeVersions :
compilerVersion = IEEnv.registry["apps"]["nuke"][nukeVersion][platform]["compilerVersion"]
build( [ "APP=nuke", "APP_VERSION="+nukeVersion ] )

for houdiniVersion in houdiniVersions :
compilerVersion = IEEnv.registry["apps"]["houdini"][houdiniVersion][platform]["compilerVersion"]
build( [ "APP=houdini", "APP_VERSION="+houdiniVersion ] )
for houdiniVersion in houdiniVersions :
compilerVersion = IEEnv.registry["apps"]["houdini"][houdiniVersion][platform]["compilerVersion"]
build( [ "APP=houdini", "APP_VERSION="+houdiniVersion ] )

for rvVersion in rvVersions :
build( [ "APP=rv", "APP_VERSION="+rvVersion, "DL_VERSION=UNDEFINED" ] )

installDocs()

else :

raise RuntimeError( "Unknown platform" )
for rvVersion in rvVersions :
build( [ "APP=rv", "APP_VERSION="+rvVersion, "DL_VERSION=UNDEFINED" ] )

installDocs()
29 changes: 18 additions & 11 deletions contrib/IECoreUSD/src/IECoreUSD/ShaderAlgo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "pxr/usd/usd/schemaRegistry.h"
#endif

#include "boost/algorithm/string/predicate.hpp"
#include "boost/algorithm/string/replace.hpp"
#include "boost/pointer_cast.hpp"

Expand Down Expand Up @@ -391,22 +392,28 @@ IECoreScene::ShaderNetworkPtr IECoreUSD::ShaderAlgo::readShaderNetwork( const px
IECoreScene::ShaderNetworkPtr result = new IECoreScene::ShaderNetwork();
IECoreScene::ShaderNetwork::Parameter outputHandle = readShaderNetworkWalk( usdSource.GetPrim().GetParent().GetPath(), usdSource.GetOutput( usdSourceName ), *result );

// For the output shader, set the type to "ai:surface" if it is "ai:shader".
// This is complete nonsense - there is nothing to suggest that this shader is
// of type surface - it could be a simple texture or noise, or even a
// displacement or volume shader.
// If the output shader has type "ai:shader" then set its type to
// "ai:surface" or "ai:light" as appropriate. This is just a heuristic,
// needed because we don't write the type out in `writeShaderNetwork()`.
// It's fragile because it is possible to assign `ai:shader` types as
// displacements or volumes as well as surfaces. But in the majority of
// cases this allows us to round-trip shader assignments as required by
// Gaffer's conventions.
//
// But arbitrarily setting the type on the output to "ai:surface" matches our
// current Gaffer convention, so it allows round-tripping.
// In the long run, the fact this is working at all appears to indicate that we
// don't use the suffix of the shader type for anything, and we should just set
// everything to prefix:shader ( aside from lights, which are a bit of a
// different question )
/// \todo In the long run, we want to stop relying on shader types
/// completely.
const IECoreScene::Shader *outputShader = result->getShader( outputHandle.shader );
if( outputShader->getType() == "ai:shader" )
{
IECoreScene::ShaderPtr o = outputShader->copy();
o->setType( "ai:surface" );
if( boost::ends_with( outputShader->getName(), "_light" ) )
{
o->setType( "ai:light" );
}
else
{
o->setType( "ai:surface" );
}
result->setShader( outputHandle.shader, std::move( o ) );
}

Expand Down
1 change: 0 additions & 1 deletion contrib/IECoreUSD/src/IECoreUSD/USDScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ IECore::PathMatcher localSet( const pxr::UsdPrim &prim, const pxr::TfToken &name
{
result.addPath( std::vector<IECore::InternedString>() );
}
return result;
}

const size_t prefixSize = prim.GetPath().GetPathElementCount();
Expand Down
28 changes: 28 additions & 0 deletions contrib/IECoreUSD/test/IECoreUSD/USDSceneTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3973,5 +3973,33 @@ def testReadFromStageCache( self ) :
self.assertEqual( root.childNames(), [ "sphere" ] )
self.assertIsInstance( root.child( "sphere" ).readObject( 0 ), IECoreScene.SpherePrimitive )

def testRoundTripArnoldLight( self ) :

lightShader = IECoreScene.ShaderNetwork(
shaders = {
"light" : IECoreScene.Shader( "distant_light", "ai:light", parameters = { "exposure" : 2.0 } )
},
output = "light",
)

root = IECoreScene.SceneInterface.create(
os.path.join( self.temporaryDirectory(), "test.usda" ),
IECore.IndexedIO.OpenMode.Write
)
light = root.createChild( "light" )
light.writeAttribute( "ai:light", lightShader, 0 )
root.writeSet( "__lights", IECore.PathMatcher( [ "/light" ] ) )
del root, light

root = IECoreScene.SceneInterface.create(
os.path.join( self.temporaryDirectory(), "test.usda" ),
IECore.IndexedIO.OpenMode.Read
)
light = root.child( "light" )
self.assertIn( "ai:light", light.attributeNames() )
self.assertEqual( light.readAttribute( "ai:light", 0 ), lightShader )
self.assertIn( "__lights", root.setNames() )
self.assertEqual( root.readSet( "__lights" ), IECore.PathMatcher( [ "/light" ] ) )

if __name__ == "__main__":
unittest.main()
108 changes: 44 additions & 64 deletions contrib/IECoreUSD/test/IECoreUSD/data/arm.usda
Original file line number Diff line number Diff line change
@@ -1,73 +1,53 @@
#usda 1.0
# Source: https://graphics.pixar.com/usd/docs/api/_usd_skel__schema_overview.html
#Source: https://graphics.pixar.com/usd/docs/api/_usd_skel__schema_overview.html
(
startTimeCode = 1
endTimeCode = 10
endTimeCode = 10
startTimeCode = 1
upAxis = "Y"
)

def SkelRoot "Model" (
prepend apiSchemas = ["SkelBindingAPI"]
prepend apiSchemas = ["SkelBindingAPI"]
)
{
def Skeleton "Skel" {
uniform token[] joints = ["Shoulder", "Shoulder/Elbow", "Shoulder/Elbow/Hand"]
uniform matrix4d[] bindTransforms = [
((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1)),
((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,2,1)),
((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,4,1))
]
uniform matrix4d[] restTransforms = [
((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1)),
((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,2,1)),
((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,2,1))
]
def SkelAnimation "Anim" {
uniform token[] joints = ["Shoulder/Elbow"]
def Skeleton "Skel" (
prepend apiSchemas = ["SkelBindingAPI"]
)
{
uniform matrix4d[] bindTransforms = [( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) ), ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 2, 1) ), ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 4, 1) )]
uniform token[] joints = ["Shoulder", "Shoulder/Elbow", "Shoulder/Elbow/Hand"]
uniform matrix4d[] restTransforms = [( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) ), ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 2, 1) ), ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 2, 1) )]
rel skel:animationSource = </Model/Skel/Anim>

float3[] translations = [(0,0,2)]
quatf[] rotations.timeSamples = {
1: [(1,0,0,0)],
10: [(0.7071, 0.7071, 0, 0)]
}
half3[] scales = [(1,1,1)]
}
def SkelAnimation "Anim"
{
uniform token[] joints = ["Shoulder/Elbow"]
quatf[] rotations.timeSamples = {
1: [(1, 0, 0, 0)],
10: [(0.7071, 0.7071, 0, 0)],
}
half3[] scales = [(1, 1, 1)]
float3[] translations = [(0, 0, 2)]
}
}

rel skel:animationSource = <Anim>
}
def Mesh "Arm" (
prepend apiSchemas = ["SkelBindingAPI"]
)
{
int[] faceVertexCounts = [4, 4, 4, 4, 4, 4, 4, 4, 4, 4]
int[] faceVertexIndices = [
2, 3, 1, 0,
6, 7, 5, 4,
8, 9, 7, 6,
3, 2, 9, 8,
10, 11, 4, 5,
0, 1, 11, 10,
7, 9, 10, 5,
9, 2, 0, 10,
3, 8, 11, 1,
8, 6, 4, 11
]
point3f[] points = [
(0.5, -0.5, 4), (-0.5, -0.5, 4), (0.5, 0.5, 4), (-0.5, 0.5, 4),
(-0.5, -0.5, 0), (0.5, -0.5, 0), (-0.5, 0.5, 0), (0.5, 0.5, 0),
(-0.5, 0.5, 2), (0.5, 0.5, 2), (0.5, -0.5, 2), (-0.5, -0.5, 2)
]
rel skel:skeleton = </Model/Skel>
int[] primvars:skel:jointIndices = [
2,2,2,2, 0,0,0,0, 1,1,1,1
] (
interpolation = "vertex"
elementSize = 1
)
float[] primvars:skel:jointWeights = [
1,1,1,1, 1,1,1,1, 1,1,1,1
] (
interpolation = "vertex"
elementSize = 1
)
matrix4d primvars:skel:geomBindTransform = ((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1))
}
def Mesh "Arm" (
prepend apiSchemas = ["SkelBindingAPI"]
)
{
int[] faceVertexCounts = [4, 4, 4, 4, 4, 4, 4, 4, 4, 4]
int[] faceVertexIndices = [2, 3, 1, 0, 6, 7, 5, 4, 8, 9, 7, 6, 3, 2, 9, 8, 10, 11, 4, 5, 0, 1, 11, 10, 7, 9, 10, 5, 9, 2, 0, 10, 3, 8, 11, 1, 8, 6, 4, 11]
point3f[] points = [(0.5, -0.5, 4), (-0.5, -0.5, 4), (0.5, 0.5, 4), (-0.5, 0.5, 4), (-0.5, -0.5, 0), (0.5, -0.5, 0), (-0.5, 0.5, 0), (0.5, 0.5, 0), (-0.5, 0.5, 2), (0.5, 0.5, 2), (0.5, -0.5, 2), (-0.5, -0.5, 2)]
matrix4d primvars:skel:geomBindTransform = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) )
int[] primvars:skel:jointIndices = [2, 2, 2, 2, 0, 0, 0, 0, 1, 1, 1, 1] (
elementSize = 1
interpolation = "vertex"
)
float[] primvars:skel:jointWeights = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] (
elementSize = 1
interpolation = "vertex"
)
rel skel:skeleton = </Model/Skel>
}
}

9 changes: 7 additions & 2 deletions contrib/IECoreUSD/test/IECoreUSD/data/shaderNameConflict.usda
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#usda 1.0
(
upAxis = "Y"
)

def Xform "shaderLocation"
def Xform "shaderLocation" (
prepend apiSchemas = ["MaterialBindingAPI"]
)
{
rel material:binding = </shaderLocation/materials/testMat>
custom float arnold:surface = 7
rel material:binding = </shaderLocation/materials/testMat>

def Scope "materials"
{
Expand Down
3 changes: 2 additions & 1 deletion src/IECoreImage/DisplayDriverServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class DisplayDriverServer::PrivateData : public RefCounted

void openPort( DisplayDriverServer::Port portNumber )
{
m_endpoint = boost::asio::ip::tcp::endpoint( tcp::v4(), portNumber );
m_endpoint = boost::asio::ip::tcp::endpoint( tcp::v6(), portNumber );
m_acceptor.open( m_endpoint.protocol() );
#ifdef _MSC_VER
m_acceptor.set_option( boost::asio::ip::tcp::acceptor::reuse_address( false ) );
Expand All @@ -184,6 +184,7 @@ class DisplayDriverServer::PrivateData : public RefCounted
#else
m_acceptor.set_option( boost::asio::ip::tcp::acceptor::reuse_address( true ) );
#endif
m_acceptor.set_option( boost::asio::ip::v6_only( false ) );
m_acceptor.bind( m_endpoint );
m_acceptor.listen();
}
Expand Down

0 comments on commit 8669056

Please sign in to comment.