Skip to content

Commit

Permalink
Merge pull request #6283 from GafferHQ/gafferRenderManPR1
Browse files Browse the repository at this point in the history
RenderManOptions and RenderManAttributes nodes
  • Loading branch information
johnhaddon authored Feb 27, 2025
2 parents 9c2ba12 + ad4881e commit f496abb
Show file tree
Hide file tree
Showing 32 changed files with 1,678 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
os: ubuntu-20.04
buildType: RELEASE
publish: true
containerImage: ghcr.io/gafferhq/build/build:3.0.0
containerImage: ghcr.io/gafferhq/build/build:3.2.0
# GitHub container builds run as root. This causes failures for tests that
# assert that filesystem permissions are respected, because root doesn't
# respect permissions. So we run the final test suite as a dedicated
Expand All @@ -52,7 +52,7 @@ jobs:
os: ubuntu-20.04
buildType: DEBUG
publish: false
containerImage: ghcr.io/gafferhq/build/build:3.0.0
containerImage: ghcr.io/gafferhq/build/build:3.2.0
testRunner: su testUser -c
testArguments: -excludedCategories performance
# Debug builds are ludicrously big, so we must use a larger cache
Expand Down
5 changes: 5 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ Build

- Cortex : Updated to version 10.5.13.0.

API
---

- Attributes, Options : Added protected constructors for initialising from attributes/options defined by metadata.

1.5.6.0 (relative to 1.5.5.0)
=======

Expand Down
27 changes: 27 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,33 @@ libraries = {
"requiredOptions" : [ "RENDERMAN_ROOT" ],
},

"GafferRenderMan" : {
"envAppends" : {
"CPPPATH" : [ "$RENDERMAN_ROOT/include" ],
# The RenderMan headers contain deprecated functionality that we don't use,
# but which nonetheless emit compilation warnings. We turn them off so we
# can continue to compile with warnings as errors.
"CPPDEFINES" : [ "RMAN_RIX_NO_WARN_DEPRECATED" ],
"LIBS" : [
"Iex$OPENEXR_LIB_SUFFIX", "Gaffer", "GafferDispatch", "GafferScene", "IECoreScene$CORTEX_LIB_SUFFIX",
"prman" if env["PLATFORM"] != "win32" else "libprman",
"pxrcore" if env["PLATFORM"] != "win32" else "libpxrcore",
],
"LIBPATH" : [ "$RENDERMAN_ROOT/lib" ],
},
"pythonEnvAppends" : {
"LIBS" : [ "GafferBindings", "GafferDispatch", "GafferRenderMan", "GafferScene" ],
"LIBPATH" : [ "$RENDERMAN_ROOT/lib" ],
},
"requiredOptions" : [ "RENDERMAN_ROOT" ],
},

"GafferRenderManTest" : {},

"GafferRenderManUI" : {},

"GafferRenderManUITest" : {},

"GafferTractor" : {},

"GafferTractorTest" : {},
Expand Down
43 changes: 43 additions & 0 deletions include/GafferRenderMan/Export.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2018, John Haddon. 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 Image Engine Design 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.
//
//////////////////////////////////////////////////////////////////////////

#pragma once

#include "IECore/Export.h"

#ifdef GafferRenderMan_EXPORTS
#define GAFFERRENDERMAN_API IECORE_EXPORT
#else
#define GAFFERRENDERMAN_API IECORE_IMPORT
#endif
61 changes: 61 additions & 0 deletions include/GafferRenderMan/RenderManAttributes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2019, John Haddon. 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.
//
//////////////////////////////////////////////////////////////////////////

#pragma once

#include "GafferRenderMan/Export.h"
#include "GafferRenderMan/TypeIds.h"

#include "GafferScene/Attributes.h"

namespace GafferRenderMan
{

class GAFFERRENDERMAN_API RenderManAttributes : public GafferScene::Attributes
{

public :

RenderManAttributes( const std::string &name=defaultName<RenderManAttributes>() );
~RenderManAttributes() override;

IE_CORE_DECLARERUNTIMETYPEDEXTENSION( GafferRenderMan::RenderManAttributes, RenderManAttributesTypeId, GafferScene::Attributes );

};

IE_CORE_DECLAREPTR( RenderManAttributes )

} // namespace GafferRenderMan
61 changes: 61 additions & 0 deletions include/GafferRenderMan/RenderManOptions.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2019, John Haddon. 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.
//
//////////////////////////////////////////////////////////////////////////

#pragma once

#include "GafferRenderMan/Export.h"
#include "GafferRenderMan/TypeIds.h"

#include "GafferScene/Options.h"

namespace GafferRenderMan
{

class GAFFERRENDERMAN_API RenderManOptions : public GafferScene::Options
{

public :

RenderManOptions( const std::string &name=defaultName<RenderManOptions>() );
~RenderManOptions() override;

IE_CORE_DECLARERUNTIMETYPEDEXTENSION( GafferRenderMan::RenderManOptions, RenderManOptionsTypeId, GafferScene::Options );

};

IE_CORE_DECLAREPTR( RenderManOptions );

} // namespace GafferRenderMan
49 changes: 49 additions & 0 deletions include/GafferRenderMan/TypeIds.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2018, John Haddon. 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.
//
//////////////////////////////////////////////////////////////////////////

#pragma once

namespace GafferRenderMan
{

enum TypeId
{
RenderManAttributesTypeId = 110400,
RenderManOptionsTypeId = 110401,
LastTypeId = 110450
};

} // namespace GafferRenderMan
4 changes: 4 additions & 0 deletions include/GafferScene/Attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ class GAFFERSCENE_API Attributes : public AttributeProcessor

protected :

/// Automatically adds plugs for all attributes for the specified renderer, based
/// on `attribute:{rendererPrefix}:*` metadata registrations.
Attributes( const std::string &name, const std::string &rendererPrefix );

void hashGlobals( const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const override;
IECore::ConstCompoundObjectPtr computeGlobals( const Gaffer::Context *context, const ScenePlug *parent ) const override;

Expand Down
4 changes: 4 additions & 0 deletions include/GafferScene/Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ class GAFFERSCENE_API Options : public GlobalsProcessor

protected :

/// Automatically adds plugs for all options for the specified renderer, based
/// on `option:{rendererPrefix}:*` metadata registrations.
Options( const std::string &name, const std::string &rendererPrefix );

void hashProcessedGlobals( const Gaffer::Context *context, IECore::MurmurHash &h ) const override;
IECore::ConstCompoundObjectPtr computeProcessedGlobals( const Gaffer::Context *context, IECore::ConstCompoundObjectPtr inputGlobals ) const override;

Expand Down
2 changes: 1 addition & 1 deletion include/GafferUI/TypeIds.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ enum TypeId
ViewDisplayTransformTypeId = 110293,
DragEditGadgetTypeId = 110294,

LastTypeId = 110450
LastTypeId = 110399
};

} // namespace GafferUI
Loading

0 comments on commit f496abb

Please sign in to comment.