bg image in the viewport?

240 views
Skip to first unread message

Michael Kirylo

unread,
Sep 21, 2022, 12:19:37 PM9/21/22
to gaffer-dev
is it possible to see an animated image sequence like a  plate in the gaffer viewport? 

Jakub Vondra

unread,
Sep 21, 2022, 4:57:27 PM9/21/22
to gaffer-dev
For arnold viewport you can just plug aiImage into ArnoldBackground node.
For openGL viewport I don't think there's an out of the box solution, but you can get textured plane like this, with some expressions it should be possible to make a camera plate node I think. for frame number in file name you can use ${frame} variable.
Someone else here might have better info though.
Screenshot from 2022-09-21 22-54-46.png

Dne středa 21. září 2022 v 18:19:37 UTC+2 uživatel mki...@gmail.com napsal:

aurora

unread,
Sep 22, 2022, 1:50:54 AM9/22/22
to gaffer-dev
Here is a prototype put together while learning Gaffer. Not even sure if the math is right.
Mean to be put after a StandardsOptions node where a render camera is chosen. It should dynamicaly switch to the current render camera.
I am sure the values of the camera can be query properly. Still learning.

import Gaffer
import GafferImage
import GafferScene
import IECore
import imath

Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 1, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 0, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 4, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:patchVersion", 0, persistent=False )

__children = {}

__children["ImagePlane"] = Gaffer.Box( "ImagePlane" )
parent.addChild( __children["ImagePlane"] )
__children["ImagePlane"].addChild( GafferScene.OpenGLShader( "Texture" ) )
__children["ImagePlane"]["Texture"].loadShader( "Texture" )
__children["ImagePlane"]["Texture"]["parameters"].addChild( Gaffer.FloatPlug( "mult", defaultValue = 0.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["Texture"]["parameters"].addChild( GafferImage.ImagePlug( "texture", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["Texture"]["parameters"].addChild( Gaffer.Color4fPlug( "tint", defaultValue = imath.Color4f( 0, 0, 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["Texture"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"].addChild( GafferScene.ShaderAssignment( "ShaderAssignment" ) )
__children["ImagePlane"]["ShaderAssignment"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"].addChild( GafferScene.Plane( "image_plane" ) )
__children["ImagePlane"]["image_plane"]["user"].addChild( Gaffer.FloatPlug( "depth", defaultValue = 0.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["image_plane"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"].addChild( GafferImage.ColorSpace( "ColorSpace" ) )
__children["ImagePlane"]["ColorSpace"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"].addChild( Gaffer.BoxIn( "BoxIn2" ) )
__children["ImagePlane"]["BoxIn2"].setup( GafferScene.ScenePlug( "out", ) )
__children["ImagePlane"]["BoxIn2"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"].addChild( GafferScene.ScenePlug( "scene", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"].addChild( GafferScene.SetFilter( "SetFilter" ) )
__children["ImagePlane"]["SetFilter"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"].addChild( GafferScene.Parent( "Parent" ) )
__children["ImagePlane"]["Parent"]["children"].addChild( GafferScene.ScenePlug( "child1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["Parent"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"].addChild( Gaffer.BoxOut( "BoxOut" ) )
__children["ImagePlane"]["BoxOut"].setup( GafferScene.ScenePlug( "in", ) )
__children["ImagePlane"]["BoxOut"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"].addChild( GafferScene.ScenePlug( "out", direction = Gaffer.Plug.Direction.Out, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"].addChild( Gaffer.Expression( "Expression2" ) )
__children["ImagePlane"]["Expression2"]["__in"].addChild( Gaffer.FloatPlug( "p0", defaultValue = 24.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["Expression2"]["__in"].addChild( Gaffer.FloatPlug( "p1", defaultValue = 36.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["Expression2"]["__in"].addChild( Gaffer.FloatPlug( "p2", defaultValue = 0.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["Expression2"]["__in"].addChild( GafferImage.AtomicFormatPlug( "p3", defaultValue = GafferImage.Format(), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["Expression2"]["__in"].addChild( Gaffer.FloatPlug( "p4", defaultValue = 35.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["Expression2"]["__in"].addChild( Gaffer.CompoundObjectPlug( "p5", defaultValue = IECore.CompoundObject(), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["Expression2"]["__out"].addChild( Gaffer.FloatPlug( "p0", direction = Gaffer.Plug.Direction.Out, defaultValue = 1.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["Expression2"]["__out"].addChild( Gaffer.StringPlug( "p1", direction = Gaffer.Plug.Direction.Out, defaultValue = '', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["Expression2"]["__out"].addChild( Gaffer.FloatPlug( "p2", direction = Gaffer.Plug.Direction.Out, defaultValue = 1.0, minValue = 0.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["Expression2"]["__out"].addChild( Gaffer.FloatPlug( "p3", direction = Gaffer.Plug.Direction.Out, defaultValue = 0.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["Expression2"]["__out"].addChild( Gaffer.StringPlug( "p4", direction = Gaffer.Plug.Direction.Out, defaultValue = '', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["Expression2"]["__out"].addChild( Gaffer.FloatPlug( "p5", direction = Gaffer.Plug.Direction.Out, defaultValue = 1.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["Expression2"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"].addChild( GafferScene.CameraTweaks( "CameraTweaks" ) )
__children["ImagePlane"]["CameraTweaks"]["tweaks"].addChild( Gaffer.TweakPlug( Gaffer.FloatPlug( "value", defaultValue = 35.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), "focalLength", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["CameraTweaks"]["tweaks"].addChild( Gaffer.TweakPlug( Gaffer.V2fPlug( "value", defaultValue = imath.V2f( 36, 24 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), "aperture", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["CameraTweaks"]["tweaks"].addChild( Gaffer.TweakPlug( Gaffer.IntPlug( "value", defaultValue = 0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), "filmFit", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"]["CameraTweaks"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"].addChild( Gaffer.Dot( "SceneIn" ) )
__children["ImagePlane"]["SceneIn"].setup( GafferScene.ScenePlug( "in", ) )
__children["ImagePlane"]["SceneIn"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"].addChild( GafferScene.SetFilter( "CameraFilter" ) )
__children["ImagePlane"]["CameraFilter"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"].addChild( Gaffer.FloatPlug( "user_depth", defaultValue = 0.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"].addChild( Gaffer.V2fPlug( "tweaks_aperture_value", defaultValue = imath.V2f( 36, 24 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"].addChild( GafferImage.ImageReader( "ImageReader" ) )
__children["ImagePlane"]["ImageReader"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"].addChild( Gaffer.Dot( "ImageIn" ) )
__children["ImagePlane"]["ImageIn"].setup( GafferImage.ImagePlug( "in", ) )
__children["ImagePlane"]["ImageIn"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ImagePlane"].addChild( Gaffer.StringPlug( "fileName", defaultValue = '', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, substitutions = IECore.StringAlgo.Substitutions.VariableSubstitutions | IECore.StringAlgo.Substitutions.EscapeSubstitutions | IECore.StringAlgo.Substitutions.TildeSubstitutions ) )
__children["ImagePlane"].addChild( Gaffer.FloatPlug( "tweaks_focalLength_value", defaultValue = 35.0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"], 'uiEditor:emptySections', IECore.StringVectorData( [  ] ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"], 'uiEditor:emptySectionIndices', IECore.IntVectorData( [  ] ) )
__children["ImagePlane"]["Texture"]["parameters"]["mult"].setValue( 1.0 )
__children["ImagePlane"]["Texture"]["parameters"]["texture"].setInput( __children["ImagePlane"]["ColorSpace"]["out"] )
__children["ImagePlane"]["Texture"]["parameters"]["tint"].setValue( imath.Color4f( 1, 1, 1, 0.800000012 ) )
__children["ImagePlane"]["Texture"]["__uiPosition"].setValue( imath.V2f( -164.303467, -232.90358 ) )
__children["ImagePlane"]["ShaderAssignment"]["in"].setInput( __children["ImagePlane"]["image_plane"]["out"] )
__children["ImagePlane"]["ShaderAssignment"]["filter"].setInput( __children["ImagePlane"]["SetFilter"]["out"] )
__children["ImagePlane"]["ShaderAssignment"]["shader"].setInput( __children["ImagePlane"]["Texture"]["out"] )
__children["ImagePlane"]["ShaderAssignment"]["__uiPosition"].setValue( imath.V2f( -146.982285, -232.90358 ) )
__children["ImagePlane"]["image_plane"]["user"]["depth"].setInput( __children["ImagePlane"]["user_depth"] )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["image_plane"]["user"]["depth"], 'nodule:type', '' )
__children["ImagePlane"]["image_plane"]["name"].setValue( 'image_plane' )
__children["ImagePlane"]["image_plane"]["transform"]["translate"]["z"].setInput( __children["ImagePlane"]["Expression2"]["__out"]["p3"] )
__children["ImagePlane"]["image_plane"]["transform"]["scale"]["x"].setInput( __children["ImagePlane"]["Expression2"]["__out"]["p0"] )
__children["ImagePlane"]["image_plane"]["transform"]["scale"]["y"].setInput( __children["ImagePlane"]["Expression2"]["__out"]["p5"] )
__children["ImagePlane"]["image_plane"]["dimensions"]["x"].setInput( __children["ImagePlane"]["Expression2"]["__out"]["p2"] )
__children["ImagePlane"]["image_plane"]["__uiPosition"].setValue( imath.V2f( -146.982285, -224.500259 ) )
__children["ImagePlane"]["__uiPosition"].setValue( imath.V2f( -98.1060638, -209.944275 ) )
__children["ImagePlane"]["ColorSpace"]["in"].setInput( __children["ImagePlane"]["ImageIn"]["out"] )
__children["ImagePlane"]["ColorSpace"]["inputSpace"].setValue( 'ACES - ACEScg' )
__children["ImagePlane"]["ColorSpace"]["outputSpace"].setValue( 'out_rec709' )
__children["ImagePlane"]["ColorSpace"]["__uiPosition"].setValue( imath.V2f( -171.165802, -226.283142 ) )
__children["ImagePlane"]["BoxIn2"]["name"].setValue( 'scene' )
__children["ImagePlane"]["BoxIn2"]["__in"].setInput( __children["ImagePlane"]["scene"] )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["BoxIn2"]["__in"], 'nodule:color', imath.Color3f( 0.240099996, 0.339399993, 0.485000014 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["BoxIn2"]["__in"], 'layout:section', 'Settings' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["BoxIn2"]["__in"], 'description', 'The processed output scene.' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["BoxIn2"]["__in"], 'nodule:type', 'GafferUI::StandardNodule' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["BoxIn2"]["out"], 'noduleLayout:section', 'bottom' )
__children["ImagePlane"]["BoxIn2"]["__uiPosition"].setValue( imath.V2f( -201.631287, -203.112854 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["scene"], 'nodule:color', imath.Color3f( 0.240099996, 0.339399993, 0.485000014 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["scene"], 'description', 'The processed output scene.' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["scene"], 'nodule:type', 'GafferUI::StandardNodule' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["scene"], 'noduleLayout:section', 'top' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["scene"], 'layout:section', 'Settings' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["scene"], 'layout:index', 2 )
__children["ImagePlane"]["SetFilter"]["setExpression"].setValue( '/image_plane' )
__children["ImagePlane"]["SetFilter"]["__uiPosition"].setValue( imath.V2f( -125.574768, -231.696762 ) )
__children["ImagePlane"]["Parent"]["in"].setInput( __children["ImagePlane"]["SceneIn"]["out"] )
__children["ImagePlane"]["Parent"]["parent"].setInput( __children["ImagePlane"]["Expression2"]["__out"]["p4"] )
__children["ImagePlane"]["Parent"]["children"][0].setInput( __children["ImagePlane"]["ShaderAssignment"]["out"] )
__children["ImagePlane"]["Parent"]["__uiPosition"].setValue( imath.V2f( -146.982285, -265.220367 ) )
__children["ImagePlane"]["BoxOut"]["in"].setInput( __children["ImagePlane"]["Parent"]["out"] )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["BoxOut"]["in"], 'noduleLayout:section', 'top' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["BoxOut"]["__out"], 'nodule:color', imath.Color3f( 0.240099996, 0.339399993, 0.485000014 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["BoxOut"]["__out"], 'layout:section', 'Settings' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["BoxOut"]["__out"], 'description', 'The processed output scene.' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["BoxOut"]["__out"], 'nodule:type', 'GafferUI::StandardNodule' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["BoxOut"]["passThrough"], 'noduleLayout:section', 'top' )
__children["ImagePlane"]["BoxOut"]["__uiPosition"].setValue( imath.V2f( -145.482285, -296.798248 ) )
__children["ImagePlane"]["out"].setInput( __children["ImagePlane"]["BoxOut"]["__out"] )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["out"], 'nodule:color', imath.Color3f( 0.240099996, 0.339399993, 0.485000014 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["out"], 'description', 'The processed output scene.' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["out"], 'nodule:type', 'GafferUI::StandardNodule' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["out"], 'noduleLayout:section', 'bottom' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["out"], 'layout:section', 'Settings' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["out"], 'layout:index', 5 )
__children["ImagePlane"]["Expression2"]["__in"]["p0"].setInput( __children["ImagePlane"]["CameraTweaks"]["tweaks"]["aperture"]["value"]["y"] )
__children["ImagePlane"]["Expression2"]["__in"]["p1"].setInput( __children["ImagePlane"]["CameraTweaks"]["tweaks"]["aperture"]["value"]["x"] )
__children["ImagePlane"]["Expression2"]["__in"]["p2"].setInput( __children["ImagePlane"]["image_plane"]["user"]["depth"] )
__children["ImagePlane"]["Expression2"]["__in"]["p3"].setInput( __children["ImagePlane"]["ImageIn"]["out"]["format"] )
__children["ImagePlane"]["Expression2"]["__in"]["p4"].setInput( __children["ImagePlane"]["CameraTweaks"]["tweaks"]["focalLength"]["value"] )
__children["ImagePlane"]["Expression2"]["__in"]["p5"].setInput( __children["ImagePlane"]["SceneIn"]["out"]["globals"] )
__children["ImagePlane"]["Expression2"]["__uiPosition"].setValue( imath.V2f( -187.5112, -217.914429 ) )
__children["ImagePlane"]["CameraTweaks"]["in"].setInput( __children["ImagePlane"]["BoxIn2"]["out"] )
__children["ImagePlane"]["CameraTweaks"]["filter"].setInput( __children["ImagePlane"]["CameraFilter"]["out"] )
__children["ImagePlane"]["CameraTweaks"]["tweaks"]["focalLength"]["name"].setValue( 'focalLength' )
__children["ImagePlane"]["CameraTweaks"]["tweaks"]["aperture"]["name"].setValue( 'aperture' )
__children["ImagePlane"]["CameraTweaks"]["tweaks"]["filmFit"]["name"].setValue( 'filmFit' )
__children["ImagePlane"]["CameraTweaks"]["tweaks"]["filmFit"]["enabled"].setValue( False )
__children["ImagePlane"]["CameraTweaks"]["tweaks"]["filmFit"]["value"].setValue( 1 )
__children["ImagePlane"]["CameraTweaks"]["tweaks"]["focalLength"]["value"].setInput( __children["ImagePlane"]["tweaks_focalLength_value"] )
__children["ImagePlane"]["CameraTweaks"]["tweaks"]["aperture"]["value"].setInput( __children["ImagePlane"]["tweaks_aperture_value"] )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["CameraTweaks"]["tweaks"]["aperture"]["value"], 'presetsPlugValueWidget:isCustom', True )
__children["ImagePlane"]["CameraTweaks"]["__uiPosition"].setValue( imath.V2f( -201.631287, -233.954651 ) )
__children["ImagePlane"]["SceneIn"]["in"].setInput( __children["ImagePlane"]["CameraTweaks"]["out"] )
__children["ImagePlane"]["SceneIn"]["__uiPosition"].setValue( imath.V2f( -201.631287, -257.888336 ) )
__children["ImagePlane"]["CameraFilter"]["setExpression"].setInput( __children["ImagePlane"]["Expression2"]["__out"]["p1"] )
__children["ImagePlane"]["CameraFilter"]["__uiPosition"].setValue( imath.V2f( -193.564377, -209.507172 ) )
__children["ImagePlane"]["user_depth"].setValue( 20.0 )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["user_depth"], 'nodule:color', imath.Color3f( 0.246700004, 0.376199991, 0.469999999 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["user_depth"], 'deletable', True )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["user_depth"], 'renameable', True )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["user_depth"], 'nodule:type', '' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["user_depth"], 'layout:section', 'Settings' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["user_depth"], 'layout:index', 1 )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["user_depth"], 'label', 'Image Plane Depth' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["user_depth"], 'divider', True )
__children["ImagePlane"]["tweaks_aperture_value"].setValue( imath.V2f( 23.1000004, 12.1800003 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'nodule:type', 'GafferUI::StandardNodule' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'description', 'The width and height of the aperture when using the\n_Aperture and Focal Length_ perspective mode. Use this in\nconjunction with a focal length to define the camera\'s\nequivalent field of view.\n\n"Aperture" here is equivalent to the film back/sensor on a\nreal camera. A handful of default camera presets are\nprovided, including Full Frame 35mm and several popular\nAlexa and RED bodies. Once the aperture is set, the focal\nlength can then be adjusted on its own to control the field\nof view, just like on a real camera.\n\nWhen setting the aperture manually, the `x` and `y`\ndimensions can be measured in any unit of length, so long\nas they use the same unit as the focal length. You can\nsafely follow convention and use millimeters for both.\n\nThe final field of view of a render will depend on these\nsettings in combination with the `resolution` and `filmFit`\nrender options.' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'presetsPlugValueWidget:allowCustom', True )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'plugValueWidget:type', 'GafferUI.PresetsPlugValueWidget' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'noduleLayout:label', 'aperture' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'spreadsheet:columnName', 'apertureValue' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'label', 'Film Back' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'layout:section', 'Settings' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'layout:index', 4 )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'preset:Academy 35mm   \t21.946 × 16.000', imath.V2f( 21.9459991, 16 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'preset:Super 35mm   \t24.892 × 18.669', imath.V2f( 24.8920002, 18.6690006 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'preset:Micro Four Thirds   \t17.30 × 13.00', imath.V2f( 17.2999992, 13 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'preset:APS-C   \t22.30 × 14.90', imath.V2f( 22.2999992, 14.8999996 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'preset:Full Frame 35mm   \t36.00 × 24.00', imath.V2f( 36, 24 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'preset:Alexa SXT 4:3 2.8k   \t23.76 × 17.82', imath.V2f( 23.7600002, 17.8199997 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'preset:Alexa SXT Open Gate 3.4k   \t28.25 × 18.17', imath.V2f( 28.25, 18.1700001 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'preset:Alexa 65 16:9 5.1k   \t42.24 × 23.76', imath.V2f( 42.2400017, 23.7600002 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'preset:Alexa 65 Open Gate 6.5k   \t54.12 × 25.58', imath.V2f( 54.1199989, 25.5799999 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'preset:RED EPIC-W 5K S35   \t30.72 × 18.00', imath.V2f( 30.7199993, 18 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'preset:RED EPIC-W 8K S35   \t29.90 × 15.77', imath.V2f( 29.8999996, 15.7700005 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'preset:BMPCC 6K Full Sensor', imath.V2f( 23.1000004, 12.9899998 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"], 'preset:BMPCC 6K 4k DCI Crop', imath.V2f( 23.1000004, 12.1800003 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"]["x"], 'nodule:color', imath.Color3f( 0.246700004, 0.376199991, 0.469999999 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_aperture_value"]["y"], 'nodule:color', imath.Color3f( 0.246700004, 0.376199991, 0.469999999 ) )
__children["ImagePlane"]["ImageReader"]["fileName"].setInput( __children["ImagePlane"]["fileName"] )
__children["ImagePlane"]["ImageReader"]["missingFrameMode"].setValue( 1 )
__children["ImagePlane"]["ImageReader"]["__uiPosition"].setValue( imath.V2f( -170.987457, -200.741623 ) )
__children["ImagePlane"]["ImageIn"]["in"].setInput( __children["ImagePlane"]["ImageReader"]["out"] )
__children["ImagePlane"]["ImageIn"]["__uiPosition"].setValue( imath.V2f( -170.987457, -209.819641 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["fileName"], 'nodule:type', '' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["fileName"], 'description', "The name of the file to be read. File sequences with\narbitrary padding may be specified using the '#' character\nas a placeholder for the frame numbers. If this file sequence\nformat is used, then missingFrameMode will be activated." )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["fileName"], 'plugValueWidget:type', 'GafferUI.FileSystemPathPlugValueWidget' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["fileName"], 'path:leaf', True )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["fileName"], 'path:bookmarks', 'image' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["fileName"], 'fileSystemPath:extensions', 'bmp dib cin dds dpx fits hdr rgbe ico iff z jpg jpe jpeg jif jfif jfi jp2 j2k j2c null nul exr sxr mxr png ppm pgm pbm pnm pfm psd pdd psb bay bmq cr2 crw cs1 dc2 dcr dng erf fff k25 kdc mdc mos mrw nef orf pef pxn raf raw rdc sr2 srf x3f arw 3fr cine ia kc2 mef nrw qtk rw2 sti rwl srw drf dsc ptx cap iiq rwz cr3 rla sgi rgb rgba bw int inta socket pic tif tiff tx env sm vsm tga tpic term zfile osl oso oslgroup oslbody' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["fileName"], 'fileSystemPath:extensionsLabel', 'Show only image files' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["fileName"], 'fileSystemPath:includeSequences', True )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["fileName"], 'layout:section', 'Settings' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["fileName"], 'layout:index', 0 )
__children["ImagePlane"]["tweaks_focalLength_value"].setValue( 17.549999237060547 )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_focalLength_value"], 'nodule:color', imath.Color3f( 0.246700004, 0.376199991, 0.469999999 ) )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_focalLength_value"], 'nodule:type', 'GafferUI::StandardNodule' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_focalLength_value"], 'description', "The focal length portion of the _Aperture and Focal Length_\nperspective mode. This is equivalent to the lens's focal\nlength in a real camera setup. Use this in conjunction with\nthe aperture to set the camera's equivalent field of view.\nLike on a real camera, the aperture is typically constant,\nand the focal length is then adjusted to control the field\nof view.\n\nThis can be a distance in any unit of length, as long as\nyou use the same unit for the aperture. You can safely\nfollow convention and use millimeters for both.\n\nThe final field of view of a render using this camera will\ndepend on these settings in combination with the\n`resolution` and `filmFit` render options." )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_focalLength_value"], 'noduleLayout:label', 'focalLength' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_focalLength_value"], 'spreadsheet:columnName', 'focalLengthValue' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_focalLength_value"], 'layout:section', 'Settings' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_focalLength_value"], 'layout:index', 3 )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_focalLength_value"], 'label', 'Focal Length' )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_focalLength_value"], 'noduleLayout:section', None )
Gaffer.Metadata.registerValue( __children["ImagePlane"]["tweaks_focalLength_value"], 'divider', False )
__children["ImagePlane"]["Expression2"]["__engine"].setValue( 'python' )
__children["ImagePlane"]["Expression2"]["__expression"].setValue( 'globals = parent["__in"]["p5"]\ncamera = globals[\'option:render:camera\']\nparent["__out"]["p1"] = camera\nparent["__out"]["p4"] = camera\n\nformat = parent["__in"]["p3"]\nwidth = format.getDisplayWindow().size().x\nheight = format.getDisplayWindow().size().y\npixel_aspect = width/height\nparent["__out"]["p2"] = pixel_aspect\nip_depth = parent["__in"]["p2"]\nparent["__out"]["p3"] = ip_depth*-1\n\n\nfocal = parent["__in"]["p4"]\nhaperture = parent["__in"]["p1"]\nvaperture = parent["__in"]["p0"]\norig_aspect = haperture/vaperture\nmult = (vaperture/focal)/pixel_aspect*orig_aspect\n\nparent["__out"]["p0"] = ip_depth*mult\nparent["__out"]["p5"] = ip_depth*mult' )


del __children

Screenshot from 2022-09-21 22-50-06.png

Michael Kirylo

unread,
Sep 22, 2022, 11:27:36 AM9/22/22
to gaffer-dev
I will try this out thank you 

aurora

unread,
Sep 23, 2022, 12:06:56 AM9/23/22
to gaffer-dev
Cool!
Will be great to see other approaches.
Also if someone can show how to access render:camera parameter like focal lenght and film back in the expression within the Box.... would be awesome!

Aurora Films

unread,
Feb 7, 2023, 11:51:01 AM2/7/23
to gaffe...@googlegroups.com
Just sharing an update on this thread. Attached updated camera plane setup. I have improved it with some methods I have learned since then. Hope you find it useful.
A
 
camera_plane.v01.gfr
2023-02-07_08-46.png

Jean-Charles KERNINON

unread,
Feb 7, 2023, 12:34:53 PM2/7/23
to gaffer-dev
Very useful.
I had to reconnect the boxout to the arnoldattributes in the visibility box node and set some options in the displaytransform node to be able to display the texture in the viewport.
Thank you for sharing.

Jean-Charles

eric...@gmail.com

unread,
Feb 7, 2023, 12:53:30 PM2/7/23
to gaffer-dev
Gaffer 1.1.0.0 added wipes in the viewer, so you could also see a background plate that way :  1.1.0.0 : Catalogue image comparison – The Gaffer HQ Blog

eric...@gmail.com

unread,
Feb 7, 2023, 12:59:59 PM2/7/23
to gaffer-dev
At the time that post was written, you could only compare images in the same catalog, but now you can also use a pinned node, focus node, selected node or bookmarked node. I'm haven't tracked down which version those modes were introduced in, but they're in the recent 1.2.0.0 alpha versions, and maybe older versions too.

aurora

unread,
Feb 7, 2023, 2:49:29 PM2/7/23
to gaffer-dev
Right, but its doesn't work for 3d views... correct?
Nuke's 3d/2d view comparison mode could be a good reference to mimic.

eric...@gmail.com

unread,
Feb 7, 2023, 3:21:34 PM2/7/23
to gaffer-dev
Correct, the wipes work in 2d views.
Reply all
Reply to author
Forward
0 new messages