GafferHQ / gaffer

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

Output plugs don't accept drops in NodeEditor #3574

Open andrewkaufman opened 4 years ago

andrewkaufman commented 4 years ago

Version: Gaffer 0.55.3.0-linux

Description

Output plugs can be manually added to a Box, and their widgets can be useful for visualization purposes. In Gaffer 0.55.3.0 (and back to 0.54.2.2) those widgets no longer accept drag/drop events. In 0.55.2.1 this did work.

I suspect its related to this changelog in Gaffer 0.55.2.2, but I haven't verified as I can't easily find the PR or relevant commit:

NodeEditor : Fixed bug that allowed drag and drop to create unwanted input connections to output plugs.

Note the desired behaviour can be achieved using the API (eg root["Box"]["mySum"].setInput( root["Box"]["AddNode"]["sum"] ) or via the UI if you author the Box out plug via promotion (see Box.sum in the example script).

Steps to reproduce

  1. Load the script provided below
  2. Open a NodeEditor for the Box
  3. Open a NodeEditor for the AddNode inside it
  4. Try to drag AddNode.sum onto Box.mySum

Test script

Click to Expand

``` import Gaffer import GafferTest import IECore import imath Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 0, persistent=False ) Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 55, persistent=False ) Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 3, persistent=False ) Gaffer.Metadata.registerValue( parent, "serialiser:patchVersion", 0, persistent=False ) __children = {} __children["Box"] = Gaffer.Box( "Box" ) parent.addChild( __children["Box"] ) __children["Box"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Box"].addChild( GafferTest.AddNode( "AddNode" ) ) __children["Box"]["AddNode"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Box"].addChild( Gaffer.BoxOut( "BoxOut" ) ) __children["Box"]["BoxOut"].setup( Gaffer.IntPlug( "in", defaultValue = 0, ) ) __children["Box"]["BoxOut"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Box"].addChild( Gaffer.IntPlug( "sum", direction = Gaffer.Plug.Direction.Out, defaultValue = 0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Box"].addChild( Gaffer.IntPlug( "mySum", direction = Gaffer.Plug.Direction.Out, defaultValue = 0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Box"]["__uiPosition"].setValue( imath.V2f( 15.7000008, 1.5 ) ) __children["Box"]["AddNode"]["op1"].setValue( 1 ) __children["Box"]["AddNode"]["op2"].setValue( 2 ) __children["Box"]["BoxOut"]["name"].setValue( 'sum' ) __children["Box"]["BoxOut"]["in"].setInput( __children["Box"]["AddNode"]["sum"] ) __children["Box"]["BoxOut"]["__uiPosition"].setValue( imath.V2f( 1.4993149, -8.33203125 ) ) __children["Box"]["sum"].setInput( __children["Box"]["BoxOut"]["__out"] ) del __children ```

johnhaddon commented 4 years ago

I suspect its related to this changelog in Gaffer 0.55.2.2, but I haven't verified as I can't easily find the PR

'Twas this one : https://github.com/GafferHQ/gaffer/pull/3435