GafferHQ / gaffer

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

Duplicate with Inputs Errors when Dot in Selection #5309

Closed chrisc-lee closed 1 year ago

chrisc-lee commented 1 year ago

Version: Gaffer 1.1.9.5-linux and Gaffer 1.2.4.0-linux Third-party tools: Arnold Third-party modules: Proprietary Plugins (though I confirmed it happens in Gaffer without proprietary stuff as well)

Description

Some of our LookDev artists at IE found when using Duplicate with Inputs (Ctrl+D), sometimes a GraphComponent Index Out of Range exception or a Rejects Input exception is thrown. I was able to replicate it in Gaffer without any IE stuff and have found this to be the case mostly when dots are in the selection.

Steps to reproduce

To get the GraphComponent Index Out of Range exception:

  1. Connect a PathFilter node to the input of a Dot
  2. Duplicate with Inputs with both the PathFilter and Dot in the selection
  3. Should throw the error

To get the Rejects Input exception:

  1. Connect a Checkerboard node to the input of a Dot
  2. Duplicate with Inputs with both the Checkerboard and Dot in the selection
  3. Should throw the error

Debug log

First Case:

Click to Expand

``` ERROR [Errors Occurred During Duplication] IndexError: GraphComponent index out of range DEBUG [Traceback] File "/software/apps/gaffer/1.2.4.0/cent7.x86_64/cortex/10.4/public/python/GafferUI/EditMenu.py", line 248, in duplicateWithInputs newNodes[i] File "/software/apps/gaffer/1.2.4.0/cent7.x86_64/cortex/10.4/public/python/GafferUI/EditMenu.py", line 243, in duplicateInputs duplicateInputs( source[i], dest[i] ) File "/software/apps/gaffer/1.2.4.0/cent7.x86_64/cortex/10.4/public/python/GafferUI/EditMenu.py", line 243, in duplicateInputs duplicateInputs( source[i], dest[i] ) ```

Second Case:

Click to Expand

``` ERROR [Errors Occurred During Duplication] IECore.Exception: Plug "gui.scripts.ScriptNode.Dot6.__uiPosition" rejects input "gui.scripts.ScriptNode.Dot2.in". DEBUG [Traceback] File "/software/apps/gaffer/1.2.4.0/cent7.x86_64/cortex/10.4/public/python/GafferUI/EditMenu.py", line 248, in duplicateWithInputs newNodes[i] File "/software/apps/gaffer/1.2.4.0/cent7.x86_64/cortex/10.4/public/python/GafferUI/EditMenu.py", line 243, in duplicateInputs duplicateInputs( source[i], dest[i] ) File "/software/apps/gaffer/1.2.4.0/cent7.x86_64/cortex/10.4/public/python/GafferUI/EditMenu.py", line 239, in duplicateInputs dest.setInput( source.getInput() ) ```

johnhaddon commented 1 year ago

Thanks for the report Chris. I'm able to reproduce the first one, but not the second. I wonder if I'm missing something in the second, so perhaps you could copy/paste a small node network which shows the problem?

johnhaddon commented 1 year ago

Scratch that - I've reproduced both now. Where I was going wrong was not creating the dot on its own first.