Skip to content
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

3Delight multipart render support #5844

Closed
wants to merge 17 commits into from
Closed
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
5 changes: 5 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.x.x.x (relative to 1.4.x.x)
=======



1.4.x.x (relative to 1.4.2.0)
=======

Expand Down
44 changes: 4 additions & 40 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ if codecs.lookup( locale.getpreferredencoding() ).name != "utf-8" :
###############################################################################################

gafferMilestoneVersion = 1 # for announcing major milestones - may contain all of the below
gafferMajorVersion = 4 # backwards-incompatible changes
gafferMinorVersion = 2 # new backwards-compatible features
gafferMajorVersion = 5 # backwards-incompatible changes
gafferMinorVersion = 0 # new backwards-compatible features
gafferPatchVersion = 0 # bug fixes
gafferVersionSuffix = "" # used for alpha/beta releases : "a1", "b2", etc.

Expand Down Expand Up @@ -833,38 +833,6 @@ if ( int( baseLibEnv["BOOST_MAJOR_VERSION"] ), int( baseLibEnv["BOOST_MINOR_VERS
# the reams of warnings triggered by that.
baseLibEnv.Append( CPPDEFINES = [ "BOOST_BIND_GLOBAL_PLACEHOLDERS" ] )

# Determine Imath version. The transition between 2 and 3 is a bit of a mess.
# Imath 3 provides `Imath/ImathConfig.h` for determining version, but that isn't
# provided by Imath 2, which comes with `OpenEXR/IlmBaseConfig.h` instead. The
# one thing we can rely on existing all the time is the conceptually unrelated
# `OpenEXR/OpenEXRConfig.h`, so we use that, even though we don't directly
# depend on OpenEXR ourselves.

exrVersionHeader = baseLibEnv.FindFile(
"OpenEXR/OpenEXRConfig.h",
[ "$BUILD_DIR/include" ] +
baseLibEnv["LOCATE_DEPENDENCY_SYSTEMPATH"] +
baseLibEnv["LOCATE_DEPENDENCY_CPPPATH"]
)

if not exrVersionHeader :
sys.stderr.write( "ERROR : unable to find \"OpenEXR/OpenEXRConfig.h\".\n" )
Exit( 1 )

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

if baseLibEnv.get( "IMATH_MAJOR_VERSION", None ) is None :
sys.stderr.write( "ERROR : unable to determine version from \"{}\".\n".format( exrVersionHeader ) )
Exit( 1 )

# Imath 2 came with a separate `Half` library but in Imath 3 everything is in
# the `Imath` library.

baseLibEnv["HALF_LIBRARY"] = "Half" if baseLibEnv["IMATH_MAJOR_VERSION"] < 3 else ""

###############################################################################################
# The basic environment for building python modules
###############################################################################################
Expand Down Expand Up @@ -1042,11 +1010,7 @@ cyclesDefines = [

libraries = {

"Gaffer" : {
"envAppends" : {
"LIBS" : [ "$HALF_LIBRARY" ],
},
},
"Gaffer" : {},

"GafferTest" : {
"envAppends" : {
Expand Down Expand Up @@ -1127,7 +1091,7 @@ libraries = {

"GafferScene" : {
"envAppends" : {
"LIBS" : [ "Gaffer", "Iex$IMATH_LIB_SUFFIX", "IECoreGL$CORTEX_LIB_SUFFIX", "IECoreImage$CORTEX_LIB_SUFFIX", "IECoreScene$CORTEX_LIB_SUFFIX", "GafferImage", "GafferDispatch", "$HALF_LIBRARY", "osdCPU" ],
"LIBS" : [ "Gaffer", "Iex$IMATH_LIB_SUFFIX", "IECoreGL$CORTEX_LIB_SUFFIX", "IECoreImage$CORTEX_LIB_SUFFIX", "IECoreScene$CORTEX_LIB_SUFFIX", "GafferImage", "GafferDispatch", "osdCPU" ],
},
"pythonEnvAppends" : {
"LIBS" : [ "GafferBindings", "GafferScene", "GafferDispatch", "GafferImage", "IECoreScene$CORTEX_LIB_SUFFIX", "IECoreGL$CORTEX_LIB_SUFFIX" ],
Expand Down
5 changes: 0 additions & 5 deletions include/Gaffer/BoxPlug.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@
#include "IECore/Export.h"

IECORE_PUSH_DEFAULT_VISIBILITY
#include "OpenEXR/OpenEXRConfig.h"
#if OPENEXR_VERSION_MAJOR < 3
#include "OpenEXR/ImathBox.h"
#else
#include "Imath/ImathBox.h"
#endif
IECORE_POP_DEFAULT_VISIBILITY

namespace Gaffer
Expand Down
6 changes: 0 additions & 6 deletions include/Gaffer/CompoundNumericPlug.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,8 @@
#include "IECore/GeometricTypedData.h"

IECORE_PUSH_DEFAULT_VISIBILITY
#include "OpenEXR/OpenEXRConfig.h"
#if OPENEXR_VERSION_MAJOR < 3
#include "OpenEXR/ImathColor.h"
#include "OpenEXR/ImathVec.h"
#else
#include "Imath/ImathColor.h"
#include "Imath/ImathVec.h"
#endif
IECORE_POP_DEFAULT_VISIBILITY

namespace Gaffer
Expand Down
5 changes: 0 additions & 5 deletions include/Gaffer/MetadataAlgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@
#include "IECore/StringAlgo.h"
#include "IECore/TypeIds.h"

#include "OpenEXR/OpenEXRConfig.h"
#if OPENEXR_VERSION_MAJOR < 3
#include "OpenEXR/ImathColor.h"
#else
#include "Imath/ImathColor.h"
#endif

#include <vector>

Expand Down
5 changes: 0 additions & 5 deletions include/GafferImage/BufferAlgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@
#include "IECore/Export.h"

IECORE_PUSH_DEFAULT_VISIBILITY
#include "OpenEXR/OpenEXRConfig.h"
#if OPENEXR_VERSION_MAJOR < 3
#include "OpenEXR/ImathBox.h"
#else
#include "Imath/ImathBox.h"
#endif
IECORE_POP_DEFAULT_VISIBILITY

namespace GafferImage
Expand Down
5 changes: 0 additions & 5 deletions include/GafferImage/FilterAlgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@
#include "OpenImageIO/filter.h"

IECORE_PUSH_DEFAULT_VISIBILITY
#include "OpenEXR/OpenEXRConfig.h"
#if OPENEXR_VERSION_MAJOR < 3
#include "OpenEXR/ImathVec.h"
#else
#include "Imath/ImathVec.h"
#endif
IECORE_POP_DEFAULT_VISIBILITY

namespace GafferImage
Expand Down
5 changes: 0 additions & 5 deletions include/GafferImage/Format.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@
#include "IECore/MurmurHash.h"

IECORE_PUSH_DEFAULT_VISIBILITY
#include "OpenEXR/OpenEXRConfig.h"
#if OPENEXR_VERSION_MAJOR < 3
#include "OpenEXR/ImathBox.h"
#else
#include "Imath/ImathBox.h"
#endif
IECORE_POP_DEFAULT_VISIBILITY

#include <string>
Expand Down
5 changes: 0 additions & 5 deletions include/GafferImage/ImageAlgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,7 @@
#include "IECore/Export.h"

IECORE_PUSH_DEFAULT_VISIBILITY
#include "OpenEXR/OpenEXRConfig.h"
#if OPENEXR_VERSION_MAJOR < 3
#include "OpenEXR/ImathBox.h"
#else
#include "Imath/ImathBox.h"
#endif
IECORE_POP_DEFAULT_VISIBILITY

#include <vector>
Expand Down
5 changes: 0 additions & 5 deletions include/GafferScene/SceneAlgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,7 @@
#include "IECore/Export.h"

IECORE_PUSH_DEFAULT_VISIBILITY
#include "OpenEXR/OpenEXRConfig.h"
#if OPENEXR_VERSION_MAJOR < 3
#include "OpenEXR/ImathVec.h"
#else
#include "Imath/ImathVec.h"
#endif
IECORE_POP_DEFAULT_VISIBILITY

#include <unordered_set>
Expand Down
5 changes: 0 additions & 5 deletions include/GafferSceneUI/RotateTool.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@
#include "GafferUI/Style.h"

IECORE_PUSH_DEFAULT_VISIBILITY
#include "OpenEXR/OpenEXRConfig.h"
#if OPENEXR_VERSION_MAJOR < 3
#include "OpenEXR/ImathEuler.h"
#else
#include "Imath/ImathEuler.h"
#endif
IECORE_POP_DEFAULT_VISIBILITY

namespace GafferSceneUI
Expand Down
5 changes: 0 additions & 5 deletions include/GafferUI/Gadget.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,7 @@
#include "IECore/Export.h"

IECORE_PUSH_DEFAULT_VISIBILITY
#include "OpenEXR/OpenEXRConfig.h"
#if OPENEXR_VERSION_MAJOR < 3
#include "OpenEXR/ImathBox.h"
#else
#include "Imath/ImathBox.h"
#endif
IECORE_POP_DEFAULT_VISIBILITY

#include <functional>
Expand Down
5 changes: 0 additions & 5 deletions include/GafferUI/GraphLayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@
#include "IECore/RunTimeTyped.h"

IECORE_PUSH_DEFAULT_VISIBILITY
#include "OpenEXR/OpenEXRConfig.h"
#if OPENEXR_VERSION_MAJOR < 3
#include "OpenEXR/ImathVec.h"
#else
#include "Imath/ImathVec.h"
#endif
IECORE_POP_DEFAULT_VISIBILITY

namespace Gaffer
Expand Down
5 changes: 0 additions & 5 deletions include/GafferUI/KeyEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@
#include "IECore/Export.h"

IECORE_PUSH_DEFAULT_VISIBILITY
#include "OpenEXR/OpenEXRConfig.h"
#if OPENEXR_VERSION_MAJOR < 3
#include "OpenEXR/ImathVec.h"
#else
#include "Imath/ImathVec.h"
#endif
IECORE_POP_DEFAULT_VISIBILITY

namespace GafferUI
Expand Down
5 changes: 2 additions & 3 deletions include/GafferUI/NoduleLayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@

#include "IECore/StringAlgo.h"

#include "boost/variant.hpp"

#include <functional>
#include <variant>

namespace Gaffer
{
Expand Down Expand Up @@ -112,7 +111,7 @@ class GAFFERUI_API NoduleLayout : public Gadget
GadgetPtr gadget;
};
// Either a plug or the name of a custom widget
using GadgetKey = boost::variant<const Gaffer::Plug *, IECore::InternedString>;
using GadgetKey = std::variant<const Gaffer::Plug *, IECore::InternedString>;
// Map from plugs and custom gadget names to the gadgets
// that represent them.
using GadgetMap = std::map<GadgetKey, TypeAndGadget>;
Expand Down
5 changes: 0 additions & 5 deletions include/GafferUI/RotateHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@
#include "GafferUI/Handle.h"

IECORE_PUSH_DEFAULT_VISIBILITY
#include "OpenEXR/OpenEXRConfig.h"
#if OPENEXR_VERSION_MAJOR < 3
#include "OpenEXR/ImathEuler.h"
#else
#include "Imath/ImathEuler.h"
#endif
IECORE_POP_DEFAULT_VISIBILITY

namespace GafferUI
Expand Down
5 changes: 0 additions & 5 deletions include/GafferUI/StandardStyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@
#include "IECore/Export.h"

IECORE_PUSH_DEFAULT_VISIBILITY
#include "OpenEXR/OpenEXRConfig.h"
#if OPENEXR_VERSION_MAJOR < 3
#include "OpenEXR/ImathColor.h"
#else
#include "Imath/ImathColor.h"
#endif
IECORE_POP_DEFAULT_VISIBILITY

#include <array>
Expand Down
5 changes: 0 additions & 5 deletions include/GafferUI/Style.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,7 @@
#include "IECore/RunTimeTyped.h"

IECORE_PUSH_DEFAULT_VISIBILITY
#include "OpenEXR/OpenEXRConfig.h"
#if OPENEXR_VERSION_MAJOR < 3
#include "OpenEXR/ImathBox.h"
#else
#include "Imath/ImathBox.h"
#endif
IECORE_POP_DEFAULT_VISIBILITY

namespace IECoreGL
Expand Down
2 changes: 1 addition & 1 deletion python/GafferSceneUI/CropWindowToolUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
masked area which can be adjusted using drag and drop.

Note that the view must be locked to a render camera for this tool to be used.
Additionally, an upstream node much be capable of setting the crop window so
Additionally, an upstream node must be capable of setting the crop window so
that there is something to adjust - typically this will be a StandardOptions
node. The name of the plug being manipulated is displayed underneath the
cropped area - it can be used to verify that the expected node is being adjusted.
Expand Down
38 changes: 38 additions & 0 deletions python/IECoreDelightTest/RendererTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import IECoreScene
import IECoreDelight
import IECoreVDB
import IECoreImage

import GafferTest
import GafferScene
Expand Down Expand Up @@ -101,6 +102,43 @@ def testOutput( self ) :

self.assertTrue( ( self.temporaryDirectory() / "beauty.exr" ).exists() )

def testOutputMultipart( self ) :

r = GafferScene.Private.IECoreScenePreview.Renderer.create(
"3Delight",
GafferScene.Private.IECoreScenePreview.Renderer.RenderType.Batch
)

r.output(
"layer_a",
IECoreScene.Output(
str( self.temporaryDirectory() / "multipart.exr" ),
"exr",
"rgba"
)
)

r.output(
"layer_b",
IECoreScene.Output(
str( self.temporaryDirectory() / "multipart.exr" ),
"exr",
"color shader:diffuse"
)
)

r.render()
del r

self.assertTrue( ( self.temporaryDirectory() / "multipart.exr" ).exists() )

i = IECoreImage.ImageReader( os.path.join( self.temporaryDirectory(), "multipart.exr" ) )
h = i.readHeader()
subimages = h['oiio:subimages']
del i
Comment on lines +135 to +138
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not essential that you change this now, but we're close to phasing out IECoreImage.ImageReader everywhere, so if you have time it'd be great if this check could be performed with the OpenImageIO module directly instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it! Absolutely no problem to switch the test to the OpenImageIO module.


self.assertEqual( subimages, IECore.IntData( 2 ) )

def testAOVs( self ) :

for data, expected in {
Expand Down
5 changes: 0 additions & 5 deletions src/Gaffer/Animation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@
#include "Gaffer/Context.h"
#include "Gaffer/Private/ScopedAssignment.h"

#include "OpenEXR/OpenEXRConfig.h"
#if OPENEXR_VERSION_MAJOR < 3
#include "OpenEXR/ImathFun.h"
#else
#include "Imath/ImathFun.h"
#endif

#include <algorithm>
#include <cassert>
Expand Down
5 changes: 0 additions & 5 deletions src/Gaffer/NumericPlug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@

#include "Gaffer/TypedPlug.h"

#include "OpenEXR/OpenEXRConfig.h"
#if OPENEXR_VERSION_MAJOR < 3
#include "OpenEXR/ImathFun.h"
#else
#include "Imath/ImathFun.h"
#endif

using namespace IECore;
using namespace Gaffer;
Expand Down
6 changes: 0 additions & 6 deletions src/Gaffer/Random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,8 @@
#include "Gaffer/Context.h"
#include "Gaffer/StringPlug.h"

#include "OpenEXR/OpenEXRConfig.h"
#if OPENEXR_VERSION_MAJOR < 3
#include "OpenEXR/ImathColorAlgo.h"
#include "OpenEXR/ImathRandom.h"
#else
#include "Imath/ImathColorAlgo.h"
#include "Imath/ImathRandom.h"
#endif

#include "boost/functional/hash.hpp"

Expand Down
Loading
Loading