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

GafferImage: CopyChannels bug with no RGB layer #3201

Closed masterkeech closed 5 years ago

masterkeech commented 5 years ago

Version: Gaffer 0.53.3.0-linux Third-party tools: N/A Third-party modules: N/A

Description

When copying channel layers using the ChannelCopy node without an RGB channel and channels set to 'All', the last channel does not get copied.

Steps to reproduce

# run the following script and view layer3 from the CopyChannels node
import itertools
import GafferImage

copy_channels = GafferImage.CopyChannels()
copy_channels["channels"].setValue("*")
root.addChild(copy_channels)

colours = [x for x in itertools.product([0.0, 1.0], repeat=3)][1:5]
for index in range(4):
    constant = GafferImage.Constant("Constant%d" % index)
    constant["format"].setValue(GafferImage.Format(imath.Box2i(imath.V2i(0, 0), imath.V2i(10, 10))))
    constant["color"].setValue(imath.Color4f(colours[index][0], colours[index][1], colours[index][2], 1.0))
    constant["layer"].setValue("layer%d" % index)
    root.addChild(constant)
    copy_channels["in"]["in%d" % index].setInput(constant["out"])

Work Around

  1. add a RBG layer into the image stream
  2. connect the last input twice, eg. to both 'in3' and 'in4'
johnhaddon commented 5 years ago

I can't reproduce this - for me, layer3 shows as solid red with a solid alpha, which I think is what is expected. Am I missing something?

masterkeech commented 5 years ago

Nope, I had this same code failing a unit test in our code base, just reran it now and everything passes, I am going to close this as it seems to be a non issues.

Cheers

johnhaddon commented 5 years ago

OK, cool. I had a quick look through the source to see if anything looked suspicious, but didn't come up with something. Please reopen if you find another repro...