Skip to content

Commit

Permalink
Merge branch 'GafferHQ:main' into 3dl_outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
gkocov authored Feb 3, 2024
2 parents 96c8a02 + a4661d7 commit de3d35a
Show file tree
Hide file tree
Showing 120 changed files with 9,530 additions and 1,341 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,41 +28,55 @@ jobs:
# and then use `include` to define their settings.

name: [
linux,
linux-debug,
linux-gcc9,
linux-debug-gcc9,
linux-gcc11,
windows,
]

include:

- name: linux
- name: linux-gcc9
os: ubuntu-20.04
buildType: RELEASE
publish: true
containerImage: ghcr.io/gafferhq/build/build:2.0.0
containerImage: ghcr.io/gafferhq/build/build:2.1.1
# 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
# test user rather than as root.
testRunner: su testUser -c
sconsCacheMegabytes: 400

- name: linux-debug
- name: linux-debug-gcc9
os: ubuntu-20.04
buildType: DEBUG
publish: false
containerImage: ghcr.io/gafferhq/build/build:2.0.0
containerImage: ghcr.io/gafferhq/build/build:2.1.1
testRunner: su testUser -c
testArguments: -excludedCategories performance
# Debug builds are ludicrously big, so we must use a larger cache
# limit. In practice this compresses down to 4-500Mb.
sconsCacheMegabytes: 2500

- name: linux-gcc11
os: ubuntu-20.04
buildType: RELEASE
publish: true
containerImage: ghcr.io/gafferhq/build/build:3.0.0a4
# 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
# test user rather than as root.
testRunner: su testUser -c
sconsCacheMegabytes: 400

- name: windows
os: windows-2019
buildType: RELEASE
publish: true
containerImage:
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/8.0.0a1/gafferDependencies-8.0.0a1-windows.zip
testRunner: Invoke-Expression
testArguments: -excludedCategories performance GafferTest GafferVDBTest GafferUSDTest GafferSceneTest GafferDispatchTest GafferOSLTest GafferImageTest GafferUITest GafferImageUITest GafferSceneUITest GafferDispatchUITest GafferOSLUITest GafferUSDUITest GafferVDBUITest GafferDelightUITest GafferTractorTest GafferTractorUITest
sconsCacheMegabytes: 400
Expand Down Expand Up @@ -131,7 +145,7 @@ jobs:
# containing the hash of the archive, for use in the cache key
# below.
run: |
echo GAFFER_DEPENDENCIES_HASH=`python .github/workflows/main/installDependencies.py --dependenciesDir ${{ env.GAFFER_BUILD_DIR }} --outputFormat "{archiveDigest}"` >> $GITHUB_ENV
echo GAFFER_DEPENDENCIES_HASH=`python .github/workflows/main/installDependencies.py ${{ matrix.dependenciesURL != '' && format( '--archiveURL {0}', matrix.dependenciesURL ) || '' }} --dependenciesDir ${{ env.GAFFER_BUILD_DIR }} --outputFormat "{archiveDigest}"` >> $GITHUB_ENV
./.github/workflows/main/installDelight.py
echo DELIGHT=$GITHUB_WORKSPACE/3delight >> $GITHUB_ENV
shell: bash
Expand Down Expand Up @@ -176,7 +190,7 @@ jobs:
import sys
import os
for arnoldVersion in [ "7.1.1.0", "7.2.1.0" ] :
for arnoldVersion in [ "7.2.1.0" ] :
arnoldRoot = os.path.join( os.environ["GITHUB_WORKSPACE"], "arnoldRoot", arnoldVersion )
os.environ["ARNOLD_ROOT"] = arnoldRoot
Expand Down
27 changes: 19 additions & 8 deletions .github/workflows/main/installDependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#
##########################################################################

import os
import pathlib
import sys
import argparse
Expand All @@ -48,10 +49,7 @@

# Determine default archive URL.

defaultURL = "https://github.com/GafferHQ/dependencies/releases/download/8.0.0a1/gafferDependencies-8.0.0a1-{platform}.{extension}".format(
platform = { "darwin" : "osx", "win32" : "windows" }.get( sys.platform, "linux" ),
extension = "tar.gz" if sys.platform != "win32" else "zip"
)
defaultURL = "https://github.com/GafferHQ/dependencies/releases/download/8.0.0a3/gafferDependencies-8.0.0a3-{platform}{buildEnvironment}.{extension}"

# Parse command line arguments.

Expand All @@ -63,6 +61,13 @@
default = defaultURL,
)

parser.add_argument(
"--buildEnvironment",
help = "The build environment of the dependencies archive to download.",
choices = [ "gcc9", "gcc11" ],
default = os.environ.get( "GAFFER_BUILD_ENVIRONMENT", "gcc9" ),
)

parser.add_argument(
"--dependenciesDir",
help = "The directory to unpack the dependencies into.",
Expand All @@ -79,10 +84,16 @@

args = parser.parse_args()

archiveURL = args.archiveURL.format(
platform = { "darwin" : "osx", "win32" : "windows" }.get( sys.platform, "linux" ),
buildEnvironment = "-{}".format( args.buildEnvironment ) if args.buildEnvironment else "",
extension = "tar.gz" if sys.platform != "win32" else "zip"
)

# Download and unpack the archive.

sys.stderr.write( "Downloading dependencies \"%s\"\n" % args.archiveURL )
archiveFileName, headers = urlretrieve( args.archiveURL )
sys.stderr.write( "Downloading dependencies \"{}\"\n".format( archiveURL ) )
archiveFileName, headers = urlretrieve( archiveURL )

pathlib.Path( args.dependenciesDir ).mkdir( parents = True )
if sys.platform != "win32" :
Expand All @@ -94,7 +105,7 @@
)
# 7z (and zip extractors generally) don't have an equivalent of --strip-components=1
# Copy the files up one directory level to compensate
extractedPath = pathlib.Path( args.dependenciesDir ) / pathlib.Path( args.archiveURL ).stem
extractedPath = pathlib.Path( args.dependenciesDir ) / pathlib.Path( archiveURL ).stem
for p in extractedPath.glob( "*" ) :
shutil.move( str( p ), args.dependenciesDir )

Expand All @@ -110,7 +121,7 @@

print(
args.outputFormat.format(
archiveURL = args.archiveURL,
archiveURL = archiveURL,
archiveDigest = md5.hexdigest()
)
)
64 changes: 63 additions & 1 deletion Changes.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
1.x.x.x (relative to 1.3.x.x)
=======

> Note : This release introduces `linux-gcc11` builds which are only compatible with Linux distributions using glibc 2.28 or higher.
> These specific `linux-gcc11` builds are intended for testing purposes while we upgrade our toolchain and dependencies to better align
> with VFX Platform 2023, and should be considered "beta" in advance of a stable release in Gaffer 1.5.

Features
--------

- Dispatcher : Dispatchers are now TaskNodes, allowing them to be nested in a task graph. Possibilities include :
- Using a LocalDispatcher and a Wedge to launch multiple TractorDispatcher jobs.
- Using a nested LocalDispatcher to perform a group of tasks on a single blade within a TractorDispatcher job.
- DeepSlice : Added a new node for clipping out part of an image based on depth.
- ImageInspector : Added a new panel for inspecting image format, metadata and channel statistics.

Improvements
------------

- Arnold : Gaffer's native OpenColorIO config is now automatically translated to Arnold. Use an ArnoldColorManager node to override this behaviour.
- Toolbars : Changed hotkey behavior to toogle any tool on and off. Exclusive tools such as the Translate and Crop Window tools activate the first tool (currently Selection Tool) when they are toggled off.
- CropWindowTool : Added <kbd>`Alt` + <kbd>`C` for toggling both the crop window tool and the relevant crop window `enabled` plug.
- TaskList, FrameMask : Reimplemented in C++ for improved performance.
Expand All @@ -21,6 +29,9 @@ Improvements
- Cache : Increased default computation cache size to 8Gb. Call `Gaffer.ValuePlug.setCacheMemoryLimit()` from a startup file to override this.
- Dispatcher : Reduced internal overhead of `dispatch()` call, with one benchmark showing around a 3x speedup.
- ScriptWindow : Added "Save" option to dialogue shown when closing a window containing unsaved changes.
- Resize :
- Added support for deep images.
- Added "Nearest" filter.
- Shuffle :
- Reimplemented to match ShuffleAttributes and ShufflePrimitiveVariables.
- Any number of shuffles can be added using the UI.
Expand All @@ -42,11 +53,16 @@ Improvements
- Added support for reading `dl:` and `user:` attributes from shaders.
- Added `importanceSampleFilter` plug to DelightOptions, providing denoiser-compatible output.
- Matched DelightOptions default values for `oversampling` and `shadingSamples` to 3Delight's own default values.
- Added support for external procedurals.
- GraphEditor : Improved logic used to connect a newly created node to the selected nodes.
- ScenePlug, ImagePlug : Child plugs are now serialisable. Among other things, this enables them to be driven by expressions (#3986).
- Premultiply : Added `useDeepVisibility` plug, which weights samples according to their visibility based on the opacity of samples in front.

Fixes
-----

- BackgroundTask : Fixed potential deadlock caused by destroying a BackgroundTask from Python while it was still running.
- Dispatcher : The job directory is no longer created when dispatch is cancelled by a slot connected to `preDispatchSignal()`.
- LocalDispatcher :
- Fixed delays and zombie processes caused by shutting down Gaffer while background jobs were running. Background jobs are now killed before Gaffer exits instead.
- Stopped failed jobs jumping to the end of the Local Jobs UI.
Expand All @@ -57,6 +73,9 @@ Fixes
- Results for min/max now correctly reflect zero values outside the data window.
- NodeMenu, NodeEditor : `userDefault` metadata is now evaluated in the script context, so it can depend on script variables.
- 3Delight : Fixed loading of surface shaders such as `dlStandard` so that they can be connected to the inputs of shaders such as `dlLayeredMaterial`.
- DeepState : Fixed handling of `NaN` values and samples where `ZBack` is less than `Z`.
- Premultiply : Fixed handling of non-existent alpha channel.
- PlugAlgo : Fixed promotion of CompoundDataPlugs with non-dynamic children, such as the `Camera.renderSettingOverrides` plug.

API
---
Expand Down Expand Up @@ -87,10 +106,12 @@ API
- ShufflePlugValueWidget : Widgets for the `source` and `destination` plugs can now be customised using standard `plugValueWidget:type` metadata.
- ImageTestCase : in `assertImageEqual` function, maxDifference may now be a tuple, to specify an asymmetric range.
- Editor : Added `Settings` class, which should be used to store settings for subclasses. See LightEditor and ImageInspector for examples.
- DeepPixelAccessor : Added utility class for accessing deep samples while abstracting away the underlying tile storage.

Breaking Changes
----------------

- Arnold : Removed support for Arnold 7.1.
- Render : Changed `render:includedPurposes` default to `"default", "render"`.
- Backdrop : Changed default drawing order. Use the new `depth` plug to override the order if necessary.
- ValuePlug : Removed deprecated `getObjectValue()` overload.
Expand All @@ -102,6 +123,12 @@ Breaking Changes
- Removed `createMatching()` method.
- Removed non-const TaskBatch accessors `frames()` and `preTasks()`.
- Made `TaskBatch` constructors private.
- The job directory is no longer available in slots connected to `preDispatchSignal()`.
- Removed `nodes` arguments from dispatch signals. Use the `dispatcher["tasks"]` plug instead.
- Removed `script` and `context` arguments from `frameRange()` method. The current frame and full frame range are now queried from the current context.
- DispatcherUI :
- Removed `appendMenuDefinitions()`, `appendNodeContextMenuDefinitions()`, `executeSelected()` and `repeatPrevious()` functions.
- Removed `DispatcherWindow` class.
- LocalDispatcher :
- Removed `JobPool.jobFailedSignal()`.
- Removed `JobPool.failedJobs()` method. Failed jobs now remain in place in the main `jobs()` container.
Expand All @@ -125,25 +152,59 @@ Breaking Changes
- 3Delight : Changed NSI scene description export with `.nsi` file extension from ASCII to binary (`.nsia` is used for ASCII now).
- OSLShader : Output parameters are now loaded onto the `out` plug for all types (`surface`, `displacement` etc), not just `shader`.
- DelightOptions : Changed default values for `oversampling` and `shadingSamples` plugs.
- SceneProcessor : Subclasses no longer serialise internal connections to the `out` plug.
- ImageProcessor : Internal connections to the `out` plug are no longer serialised.

Build
-----

- Imath : Updated to version 3.1.9.
- MaterialX : Updated to version 1.38.8.
- LibWebP : Added version 1.3.2.
- OpenEXR : Updated to version 3.1.9.
- OpenImageIO : Updated to version 2.4.17.0.
- OpenSubdiv : Updated to version 3.5.1.
- OpenSSL : Removed.
- OpenVDB : Updated to version 10.0.1.
- PsUtil : Added version 5.9.6.
- PySide : Updated to version 5.15.12.
- Qt :
- Updated to version 5.15.12.
- Removed QtPurchasing library.
- Removed QtNetworkAuth library.
- USD : Updated to version 23.11.

1.3.x.x (relative to 1.3.10.0)
=======

Features
--------

- 3Delight : Added support for USD `SphereLight`, `RectLight`, `DiskLight`, `DistantLight`, `DomeLight` and `CylinderLight`.
- RenderPassEditor : Added a new editor UI for inspecting and editing render passes.

Improvements
------------

- ArnoldShader : Added a colour space presets menu for the `image` shader.
- Arnold :
- ArnoldShader : Added a colour space presets menu for the `image` shader.
- Added specific warning for outputs with space in name.
- Added normal and depth AOVs.
- CyclesShader : Added a colour space presets menu for the `image_texture` and `environment_texture` shaders (#5618).

Fixes
-----

- Reference : Fixed bug where `GAFFER_REFERENCE_PATHS` was not being searched when performing "Duplicate as Box" action.
- Outputs :
- Fixed bug which meant that adding an output via the UI was not undoable.
- Fixed bug which allowed outputs to be added to a read-only node via the UI.

API
---

- ArnoldShaderUI : Added support for `colorSpace` widget type metadata, allowing an OpenColorIO colour space to be chosen.
- PathColumn : Added `CellData::foreground` member, to provide additional control over foreground colours in the PathListingWidget.

1.3.10.0 (relative to 1.3.9.0)
========
Expand Down Expand Up @@ -613,6 +674,7 @@ Improvements
- OpenColorIO :
- Updated default config to ACES Studio 1.3.
- Added `openColorIO` plug to ScriptNode, allowing the OpenColorIO config, working space, variables and display transform to be customised on a per-script basis.
- Added automatic configuration of Arnold color manager from Gaffer's OpenColorIO configuration. This may be overridden by using an ArnoldColorManager node to define an alternative color manager.
- Improved colorspace menus :
- Organised colorspaces into submenus by family.
- Removed unwanted title-casing, so that names are now displayed verbatim.
Expand Down
7 changes: 4 additions & 3 deletions apps/stats/stats-1.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,23 +628,24 @@ def __writeTask( self, script, args ) :
import GafferDispatch

task = script.descendant( args["task"].value )
if isinstance( task, GafferDispatch.TaskNode.TaskPlug ) :
task = task.node()
if isinstance( task, Gaffer.Node ) :
task = next( GafferDispatch.TaskNode.TaskPlug.RecursiveOutputRange( task ), None )

if task is None :
IECore.msg( IECore.Msg.Level.Error, "stats", "Task \"%s\" does not exist" % args["task"].value )
return

dispatcher = GafferDispatch.LocalDispatcher( jobPool = GafferDispatch.LocalDispatcher.JobPool() )
dispatcher["jobsDirectory"].setValue( tempfile.mkdtemp( prefix = "gafferStats" ) )
dispatcher["tasks"][0].setInput( task )

memory = _Memory.maxRSS()
with _Timer() as taskTimer :
with self.__performanceMonitor or contextlib.nullcontext(), self.__contextMonitor or contextlib.nullcontext(), self.__vtuneMonitor or contextlib.nullcontext() :
with self.__context( script, args ) as context :
for frame in self.__frames( script, args ) :
context.setFrame( frame )
dispatcher.dispatch( [ task ] )
dispatcher["task"].execute()

self.__timers["Task execution"] = taskTimer
self.__memory["Task execution"] = _Memory.maxRSS() - memory
Expand Down
4 changes: 2 additions & 2 deletions doc/source/WorkingWithImages/AnatomyOfAnImage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ Channel names is a list of arbitrary names specifying the channels in the image.
Additional channels are grouped into layers using a prefix-based naming convention. For example, `diffuse.R`, `diffuse.G` and `diffuse.B` are the RGB channels of the `diffuse` layer. By convention, `Z` identifies a depth channel, and any other name identifies an auxiliary channel.

> Note :
> Gaffer follows the [OpenEXR convention for channel names](http://www.openexr.com/documentation/InterpretingDeepPixels.pdf).
> Gaffer follows the [OpenEXR convention for channel names](https://openexr.com/en/latest/InterpretingDeepPixels.html).

### Channel data ###

**Channel data** contains each channel's list of pixel values. Internally, Gaffer represents pixels as 32-bit floating point values, which are converted to and from other bit depths by the ImageReader or ImageWriter nodes, as needed.

Channel data contains no positional information. When an image's pixel data is processed by a computation, the pixels of each channel are grouped into 64x64 pixel tiles, which are arranged in rows and columns to form the complete image. Images can be computed in parallel, on a per-tile, per-channel basis.
Channel data contains no positional information. When an image's pixel data is processed by a computation, the pixels of each channel are grouped into 128x128 pixel tiles, which are arranged in rows and columns to form the complete image. Images can be computed in parallel, on a per-tile, per-channel basis.


### Image coordinate system ###
Expand Down
Loading

0 comments on commit de3d35a

Please sign in to comment.