GafferHQ / gaffer

Gaffer is a node-based application for lookdev, lighting and automation
http://www.gafferhq.org
BSD 3-Clause "New" or "Revised" License
960 stars 206 forks source link

Cycles : Shader assignments "leaking" onto identical meshes #4890

Open johnhaddon opened 2 years ago

johnhaddon commented 2 years ago

Description

When rendering two instances of an identical mesh, GafferCycles is assigning the shader for the first instance to the second instance as well. Cycles appears to assign shaders to ccl::Geometry rather than to ccl:Object, so it's inherently unfriendly when it comes to instancing like this.

Steps to reproduce

  1. Open the scene below.
  2. Switch to the Cycles viewport.
  3. Turn on full shading.
  4. Both spheres will have the same shading, and it will be pot luck as to whether they are both pink or both grey.

Debug log

Click to Expand

``` import Gaffer import GafferCycles import GafferScene import IECore import imath Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 1, persistent=False ) Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 1, persistent=False ) Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 0, persistent=False ) Gaffer.Metadata.registerValue( parent, "serialiser:patchVersion", 0, persistent=False ) __children = {} __children["Group"] = GafferScene.Group( "Group" ) parent.addChild( __children["Group"] ) __children["Group"]["in"].addChild( GafferScene.ScenePlug( "in1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Group"]["in"].addChild( GafferScene.ScenePlug( "in2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Group"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["ShaderAssignment"] = GafferScene.ShaderAssignment( "ShaderAssignment" ) parent.addChild( __children["ShaderAssignment"] ) __children["ShaderAssignment"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["PathFilter"] = GafferScene.PathFilter( "PathFilter" ) parent.addChild( __children["PathFilter"] ) __children["PathFilter"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["principled_bsdf"] = GafferCycles.CyclesShader( "principled_bsdf" ) parent.addChild( __children["principled_bsdf"] ) __children["principled_bsdf"].loadShader( "principled_bsdf" ) __children["principled_bsdf"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Sphere"] = GafferScene.Sphere( "Sphere" ) parent.addChild( __children["Sphere"] ) __children["Sphere"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Sphere1"] = GafferScene.Sphere( "Sphere1" ) parent.addChild( __children["Sphere1"] ) __children["Sphere1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Group"]["in"][0].setInput( __children["Sphere"]["out"] ) __children["Group"]["in"][1].setInput( __children["Sphere1"]["out"] ) __children["Group"]["__uiPosition"].setValue( imath.V2f( -3.20000005, -6.75 ) ) __children["ShaderAssignment"]["in"].setInput( __children["Group"]["out"] ) __children["ShaderAssignment"]["filter"].setInput( __children["PathFilter"]["out"] ) __children["ShaderAssignment"]["shader"].setInput( __children["principled_bsdf"]["out"]["BSDF"] ) __children["ShaderAssignment"]["__uiPosition"].setValue( imath.V2f( -3.19999886, -14.9140625 ) ) __children["PathFilter"]["paths"].setValue( IECore.StringVectorData( [ '/group/sphere' ] ) ) __children["PathFilter"]["__uiPosition"].setValue( imath.V2f( 11.0722179, -8.83143139 ) ) __children["principled_bsdf"]["parameters"]["metallic"].setValue( 1.0 ) __children["principled_bsdf"]["parameters"]["specular"].setValue( 1.0 ) __children["principled_bsdf"]["parameters"]["emission"].setValue( imath.Color3f( 1, 0.5, 1 ) ) __children["principled_bsdf"]["__uiPosition"].setValue( imath.V2f( -29.1457577, -14.9140615 ) ) __children["Sphere"]["__uiPosition"].setValue( imath.V2f( -13.5070086, 7.79442358 ) ) __children["Sphere1"]["transform"]["translate"].setValue( imath.V3f( 1.81982362, 0, 0 ) ) __children["Sphere1"]["__uiPosition"].setValue( imath.V2f( 1.80817854, 8.23983002 ) ) del __children ```

boberfly commented 1 year ago

I think we could just uncomment this line: https://github.com/GafferHQ/gaffer/blob/main/src/GafferCycles/IECoreCyclesPreview/Renderer.cpp#L1210

I forget why I commented it out, but that should fix things.

boberfly commented 1 year ago

Ok a quick test does fix this for a batch and interactive render, but in the viewport case it has already applied the default dot-product shader and wouldn't have a unique hash. The solution here would be to return false on https://github.com/GafferHQ/gaffer/blob/main/src/GafferCycles/IECoreCyclesPreview/Renderer.cpp#L1076 for every shader change, but this seems a bit expensive to do.

johnhaddon commented 1 year ago

The solution here would be to return false for every shader change

That's my fear - from what I've seen, that's the only general solution, other than not doing any auto-instancing. Ideally Cycles would assign shaders to the ccl::Object and not the ccl::Geometry so that shading was orthogonal to instancing.

boberfly commented 1 year ago

The solution here would be to return false for every shader change

That's my fear - from what I've seen, that's the only general solution, other than not doing any auto-instancing. Ideally Cycles would assign shaders to the ccl::Object and not the ccl::Geometry so that shading was orthogonal to instancing.

I had a bit of fun with the codebase and came up with what we want: https://developer.blender.org/D17158

Might be tricky to upstream though...

johnhaddon commented 1 year ago

I had a bit of fun with the codebase and came up with what we want

Nice one!

Might be tricky to upstream though...

I've added a comment on the review to emphasise that this would be valuable to us (and that every other renderer under the sun does it that way :) ).

jedypod commented 1 year ago

A behavior I'm experiencing may be related to this issue. I'll share it here in case it's helpful.

Basically, it seems like if there are duplicates of the same geometry in the scene, the shader assignment does not work reliably. Initially I was generating copies of a sphere with a duplicate node. I was trying to make two spheres diffuse blue, and the other two spheres chrome. It seems like Cycles randomly assigns one or the other to all of the spheres.

I also tried creating each sphere individually, with unique names. Same behavior. The only thing I found that could break this behavior was to add a small random variation to the scale of the spheres. This seemed to make it work.

Gaffer Repro Scene ```python import Gaffer import GafferCycles import GafferDispatch import GafferImage import GafferScene import IECore import imath Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 1, persistent=False ) Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 2, persistent=False ) Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 0, persistent=False ) Gaffer.Metadata.registerValue( parent, "serialiser:patchVersion", 0, persistent=False ) __children = {} __children["Sphere"] = GafferScene.Sphere( "Sphere" ) parent.addChild( __children["Sphere"] ) __children["Sphere"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Plane"] = GafferScene.Plane( "Plane" ) parent.addChild( __children["Plane"] ) __children["Plane"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Parent"] = GafferScene.Parent( "Parent" ) parent.addChild( __children["Parent"] ) __children["Parent"]["children"].addChild( GafferScene.ScenePlug( "child1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Parent"]["children"].addChild( GafferScene.ScenePlug( "child2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Parent"]["children"].addChild( GafferScene.ScenePlug( "child3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Parent"]["children"].addChild( GafferScene.ScenePlug( "child4", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Parent"]["children"].addChild( GafferScene.ScenePlug( "child5", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Parent"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Camera"] = GafferScene.Camera( "Camera" ) parent.addChild( __children["Camera"] ) __children["Camera"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["CyclesOptions"] = GafferCycles.CyclesOptions( "CyclesOptions" ) parent.addChild( __children["CyclesOptions"] ) __children["CyclesOptions"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["StandardOptions"] = GafferScene.StandardOptions( "StandardOptions" ) parent.addChild( __children["StandardOptions"] ) __children["StandardOptions"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Outputs"] = GafferScene.Outputs( "Outputs" ) parent.addChild( __children["Outputs"] ) __children["Outputs"]["outputs"].addChild( Gaffer.ValuePlug( "output1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Outputs"]["outputs"]["output1"].addChild( Gaffer.StringPlug( "name", defaultValue = '', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Outputs"]["outputs"]["output1"].addChild( Gaffer.BoolPlug( "active", defaultValue = True, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Outputs"]["outputs"]["output1"].addChild( Gaffer.StringPlug( "fileName", defaultValue = '', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Outputs"]["outputs"]["output1"].addChild( Gaffer.StringPlug( "type", defaultValue = '', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Outputs"]["outputs"]["output1"].addChild( Gaffer.StringPlug( "data", defaultValue = '', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Outputs"]["outputs"]["output1"].addChild( Gaffer.CompoundDataPlug( "parameters", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Outputs"]["outputs"]["output1"]["parameters"].addChild( Gaffer.NameValuePlug( "driverType", Gaffer.StringPlug( "value", defaultValue = 'ClientDisplayDriver', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), "driverType", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) ) __children["Outputs"]["outputs"]["output1"]["parameters"].addChild( Gaffer.NameValuePlug( "displayHost", Gaffer.StringPlug( "value", defaultValue = 'localhost', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), "displayHost", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) ) __children["Outputs"]["outputs"]["output1"]["parameters"].addChild( Gaffer.NameValuePlug( "remoteDisplayType", Gaffer.StringPlug( "value", defaultValue = 'GafferImage::GafferDisplayDriver', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), "remoteDisplayType", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) ) __children["Outputs"]["outputs"]["output1"]["parameters"].addChild( Gaffer.NameValuePlug( "displayPort", Gaffer.StringPlug( "value", defaultValue = '${image:catalogue:port}', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), "displayPort", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) ) __children["Outputs"]["outputs"]["output1"]["parameters"].addChild( Gaffer.NameValuePlug( "quantize", Gaffer.IntVectorDataPlug( "value", defaultValue = IECore.IntVectorData( [ 0, 0, 0, 0 ] ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), "quantize", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) ) __children["Outputs"]["outputs"]["output1"]["parameters"].addChild( Gaffer.NameValuePlug( "catalogue:imageName", Gaffer.StringPlug( "value", defaultValue = 'Image', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), "catalogue_imageName", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) ) __children["Outputs"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["InteractiveCyclesRender"] = GafferCycles.InteractiveCyclesRender( "InteractiveCyclesRender" ) parent.addChild( __children["InteractiveCyclesRender"] ) __children["InteractiveCyclesRender"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"] = GafferImage.Catalogue( "Catalogue" ) parent.addChild( __children["Catalogue"] ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image4", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image5", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image6", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image7", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image8", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image9", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image10", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image11", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image12", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image13", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image14", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image15", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image16", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image17", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image18", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image19", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image20", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image21", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image22", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image23", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image24", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"]["images"].addChild( GafferImage.Catalogue.Image( "Image25", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Catalogue"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["glossy_bsdf"] = GafferCycles.CyclesShader( "glossy_bsdf" ) parent.addChild( __children["glossy_bsdf"] ) __children["glossy_bsdf"].loadShader( "glossy_bsdf" ) __children["glossy_bsdf"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["SA_ground"] = GafferScene.ShaderAssignment( "SA_ground" ) parent.addChild( __children["SA_ground"] ) __children["SA_ground"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["PathFilter"] = GafferScene.PathFilter( "PathFilter" ) parent.addChild( __children["PathFilter"] ) __children["PathFilter"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["background_light"] = GafferCycles.CyclesLight( "background_light" ) parent.addChild( __children["background_light"] ) __children["background_light"].loadShader( "background_light" ) __children["background_light"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Parent1"] = GafferScene.Parent( "Parent1" ) parent.addChild( __children["Parent1"] ) __children["Parent1"]["children"].addChild( GafferScene.ScenePlug( "child1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Parent1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Group1"] = GafferScene.Group( "Group1" ) parent.addChild( __children["Group1"] ) __children["Group1"]["in"].addChild( GafferScene.ScenePlug( "in1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Group1"]["in"].addChild( GafferScene.ScenePlug( "in2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Group1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["quad_light"] = GafferCycles.CyclesLight( "quad_light" ) parent.addChild( __children["quad_light"] ) __children["quad_light"].loadShader( "quad_light" ) __children["quad_light"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Duplicate"] = GafferScene.Duplicate( "Duplicate" ) parent.addChild( __children["Duplicate"] ) __children["Duplicate"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["PathFilter3"] = GafferScene.PathFilter( "PathFilter3" ) parent.addChild( __children["PathFilter3"] ) __children["PathFilter3"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["diffuse_bsdf_"] = GafferCycles.CyclesShader( "diffuse_bsdf_" ) parent.addChild( __children["diffuse_bsdf_"] ) __children["diffuse_bsdf_"].loadShader( "diffuse_bsdf" ) __children["diffuse_bsdf_"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["SA_BGBalls"] = GafferScene.ShaderAssignment( "SA_BGBalls" ) parent.addChild( __children["SA_BGBalls"] ) __children["SA_BGBalls"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["PathFilter4"] = GafferScene.PathFilter( "PathFilter4" ) parent.addChild( __children["PathFilter4"] ) __children["PathFilter4"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["CyclesAttributes"] = GafferCycles.CyclesAttributes( "CyclesAttributes" ) parent.addChild( __children["CyclesAttributes"] ) __children["CyclesAttributes"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["PathFilter5"] = GafferScene.PathFilter( "PathFilter5" ) parent.addChild( __children["PathFilter5"] ) __children["PathFilter5"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["SA_FGBalls"] = GafferScene.ShaderAssignment( "SA_FGBalls" ) parent.addChild( __children["SA_FGBalls"] ) __children["SA_FGBalls"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["PathFilter6"] = GafferScene.PathFilter( "PathFilter6" ) parent.addChild( __children["PathFilter6"] ) __children["PathFilter6"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["diffuse_bsdf_2"] = GafferCycles.CyclesShader( "diffuse_bsdf_2" ) parent.addChild( __children["diffuse_bsdf_2"] ) __children["diffuse_bsdf_2"].loadShader( "diffuse_bsdf" ) __children["diffuse_bsdf_2"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["color"] = GafferCycles.CyclesShader( "color" ) parent.addChild( __children["color"] ) __children["color"].loadShader( "color" ) __children["color"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Outputs1"] = GafferScene.Outputs( "Outputs1" ) parent.addChild( __children["Outputs1"] ) __children["Outputs1"]["outputs"].addChild( Gaffer.ValuePlug( "output1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Outputs1"]["outputs"]["output1"].addChild( Gaffer.StringPlug( "name", defaultValue = '', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Outputs1"]["outputs"]["output1"].addChild( Gaffer.BoolPlug( "active", defaultValue = True, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Outputs1"]["outputs"]["output1"].addChild( Gaffer.StringPlug( "fileName", defaultValue = '', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Outputs1"]["outputs"]["output1"].addChild( Gaffer.StringPlug( "type", defaultValue = '', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Outputs1"]["outputs"]["output1"].addChild( Gaffer.StringPlug( "data", defaultValue = '', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Outputs1"]["outputs"]["output1"].addChild( Gaffer.CompoundDataPlug( "parameters", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Outputs1"]["outputs"]["output1"]["parameters"].addChild( Gaffer.NameValuePlug( "quantize", Gaffer.IntVectorDataPlug( "value", defaultValue = IECore.IntVectorData( [ 0, 0, 0, 0 ] ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), "quantize", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) ) __children["Outputs1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["CyclesRender"] = GafferCycles.CyclesRender( "CyclesRender" ) parent.addChild( __children["CyclesRender"] ) __children["CyclesRender"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["ImageReader"] = GafferImage.ImageReader( "ImageReader" ) parent.addChild( __children["ImageReader"] ) __children["ImageReader"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Backdrop"] = Gaffer.Backdrop( "Backdrop" ) parent.addChild( __children["Backdrop"] ) __children["Backdrop"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Backdrop"].addChild( Gaffer.Box2fPlug( "__uiBound", defaultValue = imath.Box2f( imath.V2f( -10, -10 ), imath.V2f( 10, 10 ) ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Backdrop1"] = Gaffer.Backdrop( "Backdrop1" ) parent.addChild( __children["Backdrop1"] ) __children["Backdrop1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Backdrop1"].addChild( Gaffer.Box2fPlug( "__uiBound", defaultValue = imath.Box2f( imath.V2f( -10, -10 ), imath.V2f( 10, 10 ) ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Backdrop2"] = Gaffer.Backdrop( "Backdrop2" ) parent.addChild( __children["Backdrop2"] ) __children["Backdrop2"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Backdrop2"].addChild( Gaffer.Box2fPlug( "__uiBound", defaultValue = imath.Box2f( imath.V2f( -10, -10 ), imath.V2f( 10, 10 ) ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Backdrop3"] = Gaffer.Backdrop( "Backdrop3" ) parent.addChild( __children["Backdrop3"] ) __children["Backdrop3"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Backdrop3"].addChild( Gaffer.Box2fPlug( "__uiBound", defaultValue = imath.Box2f( imath.V2f( -10, -10 ), imath.V2f( 10, 10 ) ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Sphere1"] = GafferScene.Sphere( "Sphere1" ) parent.addChild( __children["Sphere1"] ) __children["Sphere1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Sphere2"] = GafferScene.Sphere( "Sphere2" ) parent.addChild( __children["Sphere2"] ) __children["Sphere2"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Sphere3"] = GafferScene.Sphere( "Sphere3" ) parent.addChild( __children["Sphere3"] ) __children["Sphere3"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Sphere4"] = GafferScene.Sphere( "Sphere4" ) parent.addChild( __children["Sphere4"] ) __children["Sphere4"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Sphere5"] = GafferScene.Sphere( "Sphere5" ) parent.addChild( __children["Sphere5"] ) __children["Sphere5"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Sphere6"] = GafferScene.Sphere( "Sphere6" ) parent.addChild( __children["Sphere6"] ) __children["Sphere6"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Sphere7"] = GafferScene.Sphere( "Sphere7" ) parent.addChild( __children["Sphere7"] ) __children["Sphere7"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Plane1"] = GafferScene.Plane( "Plane1" ) parent.addChild( __children["Plane1"] ) __children["Plane1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Camera1"] = GafferScene.Camera( "Camera1" ) parent.addChild( __children["Camera1"] ) __children["Camera1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Parent2"] = GafferScene.Parent( "Parent2" ) parent.addChild( __children["Parent2"] ) __children["Parent2"]["children"].addChild( GafferScene.ScenePlug( "child1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Parent2"]["children"].addChild( GafferScene.ScenePlug( "child2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Parent2"]["children"].addChild( GafferScene.ScenePlug( "child3", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Parent2"]["children"].addChild( GafferScene.ScenePlug( "child4", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Parent2"]["children"].addChild( GafferScene.ScenePlug( "child5", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Parent2"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Switch"] = Gaffer.Switch( "Switch" ) parent.addChild( __children["Switch"] ) __children["Switch"].setup( GafferScene.ScenePlug( "in", ) ) __children["Switch"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Switch"]["in"].addChild( GafferScene.ScenePlug( "in1", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Switch"]["in"].addChild( GafferScene.ScenePlug( "in2", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Backdrop4"] = Gaffer.Backdrop( "Backdrop4" ) parent.addChild( __children["Backdrop4"] ) __children["Backdrop4"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Backdrop4"].addChild( Gaffer.Box2fPlug( "__uiBound", defaultValue = imath.Box2f( imath.V2f( -10, -10 ), imath.V2f( 10, 10 ) ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Sphere"]["transform"]["translate"].setValue( imath.V3f( 0, 1, 0 ) ) __children["Sphere"]["__uiPosition"].setValue( imath.V2f( 10.381732, 98.4404907 ) ) __children["Plane"]["transform"]["translate"].setValue( imath.V3f( 2, 0, -2 ) ) __children["Plane"]["transform"]["rotate"].setValue( imath.V3f( -90, 0, 0 ) ) __children["Plane"]["transform"]["scale"]["y"].setInput( __children["Plane"]["transform"]["scale"]["x"] ) __children["Plane"]["transform"]["scale"]["z"].setInput( __children["Plane"]["transform"]["scale"]["x"] ) __children["Plane"]["dimensions"].setValue( imath.V2f( 10, 10 ) ) __children["Plane"]["divisions"].setValue( imath.V2i( 10, 10 ) ) __children["Plane"]["__uiPosition"].setValue( imath.V2f( -3.41867733, 76.3770142 ) ) __children["Parent"]["in"].setInput( __children["Camera"]["out"] ) __children["Parent"]["parent"].setValue( '/' ) __children["Parent"]["children"][0].setInput( __children["Plane"]["out"] ) __children["Parent"]["children"][1].setInput( __children["Sphere"]["out"] ) __children["Parent"]["children"][2].setInput( __children["Sphere1"]["out"] ) __children["Parent"]["children"][3].setInput( __children["Sphere2"]["out"] ) __children["Parent"]["children"][4].setInput( __children["Sphere3"]["out"] ) __children["Parent"]["__uiPosition"].setValue( imath.V2f( 11.131732, 68.2129517 ) ) __children["Camera"]["transform"]["translate"].setValue( imath.V3f( 9.11962128, 6.10602617, 4.56587458 ) ) __children["Camera"]["transform"]["rotate"].setValue( imath.V3f( -30.1565895, 46.1459503, 2.7320757e-05 ) ) __children["Camera"]["perspectiveMode"].setValue( 1 ) __children["Camera"]["__uiPosition"].setValue( imath.V2f( -17.1163559, 76.3770142 ) ) Gaffer.Metadata.registerValue( __children["CyclesOptions"], 'annotation:user:text', 'set Background-> transparent=0' ) Gaffer.Metadata.registerValue( __children["CyclesOptions"], 'annotation:user:color', imath.Color3f( 0.25999999, 0.25999999, 0.25999999 ) ) __children["CyclesOptions"]["in"].setInput( __children["StandardOptions"]["out"] ) __children["CyclesOptions"]["options"]["bgUseShader"]["enabled"].setValue( True ) __children["CyclesOptions"]["options"]["bgCameraVisibility"]["value"].setValue( False ) __children["CyclesOptions"]["options"]["bgCameraVisibility"]["enabled"].setValue( True ) __children["CyclesOptions"]["options"]["bgDiffuseVisibility"]["value"].setValue( False ) __children["CyclesOptions"]["options"]["bgDiffuseVisibility"]["enabled"].setValue( True ) __children["CyclesOptions"]["options"]["bgGlossyVisibility"]["value"].setValue( False ) __children["CyclesOptions"]["options"]["bgGlossyVisibility"]["enabled"].setValue( True ) __children["CyclesOptions"]["options"]["bgTransmissionVisibility"]["value"].setValue( False ) __children["CyclesOptions"]["options"]["bgTransmissionVisibility"]["enabled"].setValue( True ) __children["CyclesOptions"]["options"]["bgShadowVisibility"]["value"].setValue( False ) __children["CyclesOptions"]["options"]["bgShadowVisibility"]["enabled"].setValue( True ) __children["CyclesOptions"]["options"]["bgScatterVisibility"]["value"].setValue( False ) __children["CyclesOptions"]["options"]["bgScatterVisibility"]["enabled"].setValue( True ) __children["CyclesOptions"]["options"]["bgTransparent"]["value"].setValue( False ) __children["CyclesOptions"]["options"]["bgTransparent"]["enabled"].setValue( True ) __children["CyclesOptions"]["__uiPosition"].setValue( imath.V2f( 16.3817348, -106.723572 ) ) __children["StandardOptions"]["in"].setInput( __children["Parent1"]["out"] ) __children["StandardOptions"]["options"]["renderCamera"]["value"].setValue( '/camera' ) __children["StandardOptions"]["options"]["renderCamera"]["enabled"].setValue( True ) __children["StandardOptions"]["options"]["renderResolution"]["value"].setValue( imath.V2i( 1920, 1080 ) ) __children["StandardOptions"]["options"]["renderResolution"]["enabled"].setValue( True ) __children["StandardOptions"]["__uiPosition"].setValue( imath.V2f( 16.3817348, -98.5595093 ) ) __children["Outputs"]["in"].setInput( __children["CyclesOptions"]["out"] ) __children["Outputs"]["outputs"]["output1"]["name"].setValue( 'Interactive/Beauty' ) __children["Outputs"]["outputs"]["output1"]["fileName"].setValue( 'beauty' ) __children["Outputs"]["outputs"]["output1"]["type"].setValue( 'ieDisplay' ) __children["Outputs"]["outputs"]["output1"]["data"].setValue( 'rgba' ) __children["Outputs"]["__uiPosition"].setValue( imath.V2f( 16.3817348, -114.887634 ) ) __children["InteractiveCyclesRender"]["in"].setInput( __children["Outputs"]["out"] ) __children["InteractiveCyclesRender"]["__uiPosition"].setValue( imath.V2f( 16.3817348, -128.418335 ) ) Gaffer.MetadataAlgo.setNumericBookmark( __children["Catalogue"].scriptNode(), 5, __children["Catalogue"] ) __children["Catalogue"]["images"]["Image"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/c5a60a2cd59476c3a85342d2d66af83b.exr' ) __children["Catalogue"]["images"]["Image1"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/d9309fd35d3aa4cab9a684174f5ccbba.exr' ) __children["Catalogue"]["images"]["Image2"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/e54a6b9624e2aa5fff096cfe1c55084a.exr' ) __children["Catalogue"]["images"]["Image3"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/30225db0b13731654c7e49c349d88c37.exr' ) __children["Catalogue"]["images"]["Image4"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/5c60bbd4e86d01d13aeba2ad1689a1fc.exr' ) __children["Catalogue"]["images"]["Image5"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/1602d77032d594c53635b7cbac766f39.exr' ) __children["Catalogue"]["images"]["Image6"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/49df8f6dda52972612c418d76959cfb0.exr' ) __children["Catalogue"]["images"]["Image7"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/d673eed541e1f1d88c99587960e821a2.exr' ) __children["Catalogue"]["images"]["Image8"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/f1f274ebe7debfedc3ab6026105fee5d.exr' ) __children["Catalogue"]["images"]["Image9"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/079d99782de14106473e74607f039682.exr' ) __children["Catalogue"]["images"]["Image10"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/28c53f14af264aa2df97edca697605af.exr' ) __children["Catalogue"]["images"]["Image11"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/fd9a5e9e2456d4f9af7bb92b9661ec75.exr' ) __children["Catalogue"]["images"]["Image12"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/90eb82bdd65925d303cc3728229f7c18.exr' ) __children["Catalogue"]["images"]["Image13"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/50e167acb93dd438e0dade625ebb1c93.exr' ) __children["Catalogue"]["images"]["Image14"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/f208e1d6de28b02484942cd603821ebf.exr' ) __children["Catalogue"]["images"]["Image15"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/9e74cb9e1f45297ce1405e72804ef89e.exr' ) __children["Catalogue"]["images"]["Image16"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/597fba0982296983cc1419e99867d466.exr' ) __children["Catalogue"]["images"]["Image17"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/ce733c947adfe9d66992e6a942901e21.exr' ) __children["Catalogue"]["images"]["Image18"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/327e120d57e7cf06f6a24730a6124c47.exr' ) __children["Catalogue"]["images"]["Image19"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/8bb11ea6352f79bece6530f29c2ecd98.exr' ) __children["Catalogue"]["images"]["Image20"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/25f434e229788ffc4bf7c8afdedff851.exr' ) __children["Catalogue"]["images"]["Image21"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/shiny_balls_cycles_v01/a9302ecfc2be51d171369e427fbdcdf9.exr' ) __children["Catalogue"]["images"]["Image22"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/gafferCycles_ShaderAssignment_repro/d06e5434f4de19ded47ea113efbcdaa3.exr' ) __children["Catalogue"]["images"]["Image23"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/gafferCycles_ShaderAssignment_repro/f1a0a7522c856cb645c5eb9455907897.exr' ) __children["Catalogue"]["images"]["Image24"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/gafferCycles_ShaderAssignment_repro/306427a42e10933a9bdec55683a38654.exr' ) __children["Catalogue"]["images"]["Image25"]["fileName"].setValue( '/home/jed/gaffer/projects/default/catalogues/gafferCycles_ShaderAssignment_repro/6c89b22cba3716a76a6e61500639c6e8.exr' ) __children["Catalogue"]["imageIndex"].setValue( 26 ) __children["Catalogue"]["directory"].setValue( '${project:rootDirectory}/catalogues/${script:name}' ) __children["Catalogue"]["__uiPosition"].setValue( imath.V2f( 39.5841446, -127.954643 ) ) __children["glossy_bsdf"]["parameters"]["roughness"].setValue( 0.20000000298023224 ) __children["glossy_bsdf"]["__uiPosition"].setValue( imath.V2f( -6.85183048, 2.6777401 ) ) __children["SA_ground"]["in"].setInput( __children["Switch"]["out"] ) __children["SA_ground"]["filter"].setInput( __children["PathFilter"]["out"] ) __children["SA_ground"]["shader"].setInput( __children["diffuse_bsdf_"]["out"] ) __children["SA_ground"]["__uiPosition"].setValue( imath.V2f( 14.1317339, 20.6905479 ) ) __children["PathFilter"]["paths"].setValue( IECore.StringVectorData( [ '/plane' ] ) ) __children["PathFilter"]["__uiPosition"].setValue( imath.V2f( 34.0293198, 25.1507912 ) ) __children["background_light"]["transform"]["rotate"].setValue( imath.V3f( -1.8669336e-05, 105.281914, 2.23118004e-05 ) ) __children["background_light"]["parameters"]["exposure"].setValue( 1.0 ) __children["background_light"]["parameters"]["color"].setInput( __children["color"]["out"]["color"] ) __children["background_light"]["parameters"]["map_resolution"].setValue( 4096 ) __children["background_light"]["mute"]["enabled"].setValue( True ) __children["background_light"]["visualiserAttributes"]["scale"]["value"].setValue( 10.0 ) __children["background_light"]["visualiserAttributes"]["scale"]["enabled"].setValue( True ) __children["background_light"]["visualiserAttributes"]["lightDrawingMode"]["enabled"].setValue( True ) __children["background_light"]["__uiPosition"].setValue( imath.V2f( 107.147713, -35.7593536 ) ) __children["Parent1"]["in"].setInput( __children["SA_FGBalls"]["out"] ) __children["Parent1"]["parent"].setValue( '/' ) __children["Parent1"]["children"][0].setInput( __children["Group1"]["out"] ) __children["Parent1"]["__uiPosition"].setValue( imath.V2f( 16.3817348, -59.9530983 ) ) __children["Group1"]["in"][0].setInput( __children["CyclesAttributes"]["out"] ) __children["Group1"]["in"][1].setInput( __children["background_light"]["out"] ) __children["Group1"]["name"].setValue( 'lights' ) __children["Group1"]["__uiPosition"].setValue( imath.V2f( 107.147713, -51.7890358 ) ) __children["quad_light"]["transform"]["translate"].setValue( imath.V3f( 3.39444041, 5.05566883, -3.95225286 ) ) __children["quad_light"]["transform"]["rotate"].setValue( imath.V3f( -93.5407486, 0, 0 ) ) __children["quad_light"]["parameters"]["exposure"].setValue( 7.0 ) __children["quad_light"]["__uiPosition"].setValue( imath.V2f( 130.470367, -35.4609184 ) ) Gaffer.Metadata.registerValue( __children["Duplicate"], 'annotation:user:text', 'same behavior with a duplicate' ) Gaffer.Metadata.registerValue( __children["Duplicate"], 'annotation:user:color', imath.Color3f( 0, 0, 0 ) ) __children["Duplicate"]["in"].setInput( __children["Sphere"]["out"] ) __children["Duplicate"]["filter"].setInput( __children["PathFilter3"]["out"] ) __children["Duplicate"]["copies"].setValue( 3 ) __children["Duplicate"]["transform"]["translate"].setValue( imath.V3f( 4, 0, 0 ) ) __children["Duplicate"]["transform"]["rotate"].setValue( imath.V3f( 0, 90, 0 ) ) __children["Duplicate"]["__uiPosition"].setValue( imath.V2f( 44.2628365, 77.8164597 ) ) __children["PathFilter3"]["paths"].setValue( IECore.StringVectorData( [ '/sphere' ] ) ) __children["PathFilter3"]["__uiPosition"].setValue( imath.V2f( 61.4471359, 86.9148712 ) ) __children["diffuse_bsdf_"]["parameters"]["color"]["g"].setInput( __children["diffuse_bsdf_"]["parameters"]["color"]["r"] ) __children["diffuse_bsdf_"]["parameters"]["color"]["b"].setInput( __children["diffuse_bsdf_"]["parameters"]["color"]["r"] ) __children["diffuse_bsdf_"]["__uiPosition"].setValue( imath.V2f( -5.76110554, 20.6905479 ) ) __children["SA_BGBalls"]["in"].setInput( __children["SA_ground"]["out"] ) __children["SA_BGBalls"]["filter"].setInput( __children["PathFilter4"]["out"] ) __children["SA_BGBalls"]["shader"].setInput( __children["glossy_bsdf"]["out"] ) __children["SA_BGBalls"]["__uiPosition"].setValue( imath.V2f( 14.1317348, 2.6777401 ) ) __children["PathFilter4"]["paths"].setValue( IECore.StringVectorData( [ '/sphere', '/sphere3' ] ) ) __children["PathFilter4"]["__uiPosition"].setValue( imath.V2f( 33.9573975, 6.96044922 ) ) Gaffer.Metadata.registerValue( __children["CyclesAttributes"], 'annotation:user:text', 'still seems to be visible in specular reflections :/' ) Gaffer.Metadata.registerValue( __children["CyclesAttributes"], 'annotation:user:color', imath.Color3f( 0.25999999, 0.25999999, 0.25999999 ) ) __children["CyclesAttributes"]["in"].setInput( __children["quad_light"]["out"] ) __children["CyclesAttributes"]["filter"].setInput( __children["PathFilter5"]["out"] ) __children["CyclesAttributes"]["attributes"]["cameraVisibility"]["value"].setValue( False ) __children["CyclesAttributes"]["attributes"]["cameraVisibility"]["enabled"].setValue( True ) __children["CyclesAttributes"]["attributes"]["diffuseVisibility"]["value"].setValue( False ) __children["CyclesAttributes"]["attributes"]["diffuseVisibility"]["enabled"].setValue( True ) __children["CyclesAttributes"]["attributes"]["glossyVisibility"]["value"].setValue( False ) __children["CyclesAttributes"]["attributes"]["glossyVisibility"]["enabled"].setValue( True ) __children["CyclesAttributes"]["attributes"]["transmissionVisibility"]["value"].setValue( False ) __children["CyclesAttributes"]["attributes"]["transmissionVisibility"]["enabled"].setValue( True ) __children["CyclesAttributes"]["attributes"]["shadowVisibility"]["value"].setValue( False ) __children["CyclesAttributes"]["attributes"]["shadowVisibility"]["enabled"].setValue( True ) __children["CyclesAttributes"]["attributes"]["scatterVisibility"]["value"].setValue( False ) __children["CyclesAttributes"]["attributes"]["scatterVisibility"]["enabled"].setValue( True ) __children["CyclesAttributes"]["__uiPosition"].setValue( imath.V2f( 130.470367, -43.6249771 ) ) __children["PathFilter5"]["paths"].setValue( IECore.StringVectorData( [ '/lights/light' ] ) ) __children["PathFilter5"]["__uiPosition"].setValue( imath.V2f( 144.534103, -36.5107841 ) ) __children["SA_FGBalls"]["in"].setInput( __children["SA_BGBalls"]["out"] ) __children["SA_FGBalls"]["filter"].setInput( __children["PathFilter6"]["out"] ) __children["SA_FGBalls"]["shader"].setInput( __children["diffuse_bsdf_2"]["out"]["BSDF"] ) __children["SA_FGBalls"]["__uiPosition"].setValue( imath.V2f( 14.1317348, -14.5023804 ) ) __children["PathFilter6"]["paths"].setValue( IECore.StringVectorData( [ '/sphere1', '/sphere2' ] ) ) __children["PathFilter6"]["__uiPosition"].setValue( imath.V2f( 34.591526, -9.90166378 ) ) __children["diffuse_bsdf_2"]["parameters"]["color"].setValue( imath.Color3f( 0.100000001, 0.400000006, 0.800000012 ) ) __children["diffuse_bsdf_2"]["parameters"]["roughness"].setValue( 1.0 ) __children["diffuse_bsdf_2"]["__uiPosition"].setValue( imath.V2f( -7.33034992, -14.5023804 ) ) __children["color"]["parameters"]["value"]["r"].setValue( 0.05000000074505806 ) __children["color"]["parameters"]["value"]["g"].setInput( __children["color"]["parameters"]["value"]["r"] ) __children["color"]["parameters"]["value"]["b"].setInput( __children["color"]["parameters"]["value"]["r"] ) __children["color"]["__uiPosition"].setValue( imath.V2f( 91.0527267, -35.7593536 ) ) __children["Outputs1"]["in"].setInput( __children["CyclesOptions"]["out"] ) __children["Outputs1"]["outputs"]["output1"]["name"].setValue( 'Batch/Beauty' ) __children["Outputs1"]["outputs"]["output1"]["fileName"].setValue( '${project:rootDirectory}/renders/${script:name}/beauty/beauty.####.exr' ) __children["Outputs1"]["outputs"]["output1"]["type"].setValue( 'exr' ) __children["Outputs1"]["outputs"]["output1"]["data"].setValue( 'rgba' ) __children["Outputs1"]["__uiPosition"].setValue( imath.V2f( -13.8186016, -117.554276 ) ) __children["CyclesRender"]["in"].setInput( __children["Outputs1"]["out"] ) __children["CyclesRender"]["__uiPosition"].setValue( imath.V2f( -15.3186016, -129.068359 ) ) __children["ImageReader"]["fileName"].setValue( '/home/jed/gaffer/projects/default/renders/gafferCycles_ShaderAssignment_repro/beauty/beauty.0001.exr' ) __children["ImageReader"]["refreshCount"].setValue( 2 ) __children["ImageReader"]["__uiPosition"].setValue( imath.V2f( -14.8041077, -140.655121 ) ) Gaffer.Metadata.registerValue( __children["Backdrop"], 'nodeGadget:color', imath.Color3f( 0.275000006, 0.275000006, 0.275000006 ) ) __children["Backdrop"]["title"].setValue( 'Lights' ) __children["Backdrop"]["scale"].setValue( 2.0 ) __children["Backdrop"]["__uiPosition"].setValue( imath.V2f( 119.10421, -43.6249771 ) ) __children["Backdrop"]["__uiBound"].setValue( imath.Box2f( imath.V2f( -45.0273819, -21.3078346 ), imath.V2f( 69.0396576, 25.3681259 ) ) ) Gaffer.Metadata.registerValue( __children["Backdrop1"], 'nodeGadget:color', imath.Color3f( 0.335000008, 0.335000008, 0.335000008 ) ) __children["Backdrop1"]["title"].setValue( 'Geometry' ) __children["Backdrop1"]["__uiPosition"].setValue( imath.V2f( -9.83831978, 103.682022 ) ) __children["Backdrop1"]["__uiBound"].setValue( imath.Box2f( imath.V2f( -33.0424805, -43.2270584 ), imath.V2f( 82.0078354, 28.0426483 ) ) ) Gaffer.Metadata.registerValue( __children["Backdrop2"], 'nodeGadget:color', imath.Color3f( 0.38499999, 0.261799961, 0.261799961 ) ) __children["Backdrop2"]["title"].setValue( 'Shaders' ) __children["Backdrop2"]["__uiPosition"].setValue( imath.V2f( -10.2589865, 13.1236763 ) ) __children["Backdrop2"]["__uiBound"].setValue( imath.Box2f( imath.V2f( -29.4459229, -39.9300537 ), imath.V2f( 56.1036491, 30.3852406 ) ) ) Gaffer.Metadata.registerValue( __children["Backdrop3"], 'nodeGadget:color', imath.Color3f( 0.469999999, 0.469999999, 0.25850001 ) ) __children["Backdrop3"]["title"].setValue( 'Render' ) __children["Backdrop3"]["__uiPosition"].setValue( imath.V2f( 12.1327715, -120.761642 ) ) __children["Backdrop3"]["__uiBound"].setValue( imath.Box2f( imath.V2f( -35.9513741, -29.088726 ), imath.V2f( 41.9513741, 35.088726 ) ) ) __children["Sphere1"]["name"].setValue( 'sphere1' ) __children["Sphere1"]["transform"]["translate"].setValue( imath.V3f( 4, 1, 0 ) ) __children["Sphere1"]["__uiPosition"].setValue( imath.V2f( 24.4251537, 98.1759796 ) ) __children["Sphere2"]["name"].setValue( 'sphere2' ) __children["Sphere2"]["transform"]["translate"].setValue( imath.V3f( 4, 1, -4 ) ) __children["Sphere2"]["__uiPosition"].setValue( imath.V2f( 38.3323784, 98.3089828 ) ) __children["Sphere3"]["name"].setValue( 'sphere3' ) __children["Sphere3"]["transform"]["translate"].setValue( imath.V3f( 0, 1, -4 ) ) __children["Sphere3"]["__uiPosition"].setValue( imath.V2f( 52.071022, 98.0245361 ) ) __children["Sphere4"]["name"].setValue( 'sphere3' ) __children["Sphere4"]["transform"]["translate"].setValue( imath.V3f( 0, 1, 0 ) ) __children["Sphere4"]["radius"].setValue( 1.0010000467300415 ) __children["Sphere4"]["__uiPosition"].setValue( imath.V2f( 169.217987, 107.350128 ) ) __children["Sphere5"]["transform"]["translate"].setValue( imath.V3f( 4, 1, 0 ) ) __children["Sphere5"]["radius"].setValue( 1.0099999904632568 ) __children["Sphere5"]["__uiPosition"].setValue( imath.V2f( 131.127518, 107.531639 ) ) __children["Sphere6"]["name"].setValue( 'sphere1' ) __children["Sphere6"]["transform"]["translate"].setValue( imath.V3f( 4, 1, -4 ) ) __children["Sphere6"]["radius"].setValue( 0.9900000095367432 ) __children["Sphere6"]["__uiPosition"].setValue( imath.V2f( 143.219086, 107.170303 ) ) __children["Sphere7"]["name"].setValue( 'sphere2' ) __children["Sphere7"]["transform"]["translate"].setValue( imath.V3f( 0, 1, -4 ) ) __children["Sphere7"]["radius"].setValue( 1.0199999809265137 ) __children["Sphere7"]["__uiPosition"].setValue( imath.V2f( 156.219086, 107.168678 ) ) __children["Plane1"]["transform"]["translate"].setValue( imath.V3f( 2, 0, -2 ) ) __children["Plane1"]["transform"]["rotate"].setValue( imath.V3f( -90, 0, 0 ) ) __children["Plane1"]["transform"]["scale"]["y"].setInput( __children["Plane1"]["transform"]["scale"]["x"] ) __children["Plane1"]["transform"]["scale"]["z"].setInput( __children["Plane1"]["transform"]["scale"]["x"] ) __children["Plane1"]["dimensions"].setValue( imath.V2f( 10, 10 ) ) __children["Plane1"]["divisions"].setValue( imath.V2i( 10, 10 ) ) __children["Plane1"]["__uiPosition"].setValue( imath.V2f( 121.740273, 84.2245789 ) ) __children["Camera1"]["transform"]["translate"].setValue( imath.V3f( 9.11962128, 6.10602617, 4.56587458 ) ) __children["Camera1"]["transform"]["rotate"].setValue( imath.V3f( -30.1565895, 46.1459503, 2.7320757e-05 ) ) __children["Camera1"]["perspectiveMode"].setValue( 1 ) __children["Camera1"]["__uiPosition"].setValue( imath.V2f( 107.868668, 83.1810608 ) ) __children["Parent2"]["in"].setInput( __children["Plane1"]["out"] ) __children["Parent2"]["parent"].setValue( '/' ) __children["Parent2"]["children"][0].setInput( __children["Camera1"]["out"] ) __children["Parent2"]["children"][1].setInput( __children["Sphere5"]["out"] ) __children["Parent2"]["children"][2].setInput( __children["Sphere6"]["out"] ) __children["Parent2"]["children"][3].setInput( __children["Sphere7"]["out"] ) __children["Parent2"]["children"][4].setInput( __children["Sphere4"]["out"] ) __children["Parent2"]["__uiPosition"].setValue( imath.V2f( 138.649765, 75.0169983 ) ) __children["Switch"]["index"].setValue( 1 ) __children["Switch"]["enabled"].setValue( False ) __children["Switch"]["__uiPosition"].setValue( imath.V2f( 14.1317329, 52.4347115 ) ) Gaffer.Metadata.registerValue( __children["Switch"]["in"], 'noduleLayout:section', 'top' ) __children["Switch"]["in"][0].setInput( __children["Parent"]["out"] ) __children["Switch"]["in"][1].setInput( __children["Parent2"]["out"] ) Gaffer.Metadata.registerValue( __children["Switch"]["out"], 'noduleLayout:section', 'bottom' ) Gaffer.Metadata.registerValue( __children["Backdrop4"], 'nodeGadget:color', imath.Color3f( 0.335000008, 0.335000008, 0.335000008 ) ) __children["Backdrop4"]["title"].setValue( 'Geometry' ) __children["Backdrop4"]["description"].setValue( 'This time with very small variances in the scale of each sphere' ) __children["Backdrop4"]["__uiPosition"].setValue( imath.V2f( 108.799706, 103.664551 ) ) __children["Backdrop4"]["__uiBound"].setValue( imath.Box2f( imath.V2f( -33.0424805, -43.2270584 ), imath.V2f( 82.0078354, 28.0426483 ) ) ) del __children ```
johnhaddon commented 1 year ago

Basically, it seems like if there are duplicates of the same geometry in the scene, the shader assignment does not work reliably.

Yep, that's definitely the same bug we're talking about here. The best way of working around it for the moment is to use a PrimitiveVariables node to add a string primitive variable with a value of ${scene:path} (or any other unique value).

@boberfly, one possible compromise might be to assign the new shader successfully as long as the geometry is only referenced by one object. But then fail the shader assignment if it is instanced, so we only do the geometry regeneration for the instancing case...

BigRoy commented 10 months ago

Just cross-referencing that this issue appeared to have come up yesterday on Gaffer Users discord here as well. Any status update on getting a fix into the Gaffer releases?