Skip to content

Toggling a button widget's Inline mode causes it to disappear #6938

Description

@brendanholt

Version: Gaffer 1.6.18.0-linux and 1.4.15.6-linux
Third-party tools: N/A
Third-party modules: N/A

Description

In the UI Editor, toggling the Inline checkbox of a button (an IntPlug's widget set to Button mode) causes the button and the adjacent widget to disappear from the Node Editor interface.

Workaround: Cut and paste the node back into the graph or reload the Gaffer script.

Steps to reproduce

  1. Create a Box node and add a StringPlug and an IntPlug.
import Gaffer
import imath

Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 1, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 6, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 18, 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( Gaffer.StringPlug( "StringPlug", defaultValue = '', flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Box"].addChild( Gaffer.IntPlug( "IntPlug", defaultValue = 0, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Box"]["__uiPosition"].setValue( imath.V2f( -7.80000019, 13 ) )
Gaffer.Metadata.registerValue( __children["Box"]["StringPlug"], 'nodule:type', '' )
Gaffer.Metadata.registerValue( __children["Box"]["IntPlug"], 'nodule:type', '' )
Gaffer.Metadata.registerValue( __children["Box"]["IntPlug"], 'plugValueWidget:type', 'GafferUI.ButtonPlugValueWidget' )


del __children
  1. In the UI Editor, change the IntPlug's Widget to Button.
  2. Click the Inline checkbox twice.
  3. Observe that both the StringPlug and IntPlug have disappeared from the Node Editor.

Debug log

Click to Expand

ERROR : EventLoop.__qtIdleCallback : Traceback (most recent call last):
ERROR :   File "/home/brendan/apps/gaffer/1.6.18.0/python/GafferUI/EventLoop.py", line 292, in __qtIdleCallback
ERROR :     if not c() :
ERROR :            ^^^
ERROR :   File "/home/brendan/apps/gaffer/1.6.18.0/python/GafferUI/LazyMethod.py", line 166, in __idle
ERROR :     cls.__doPendingCalls( widget, method )
ERROR :   File "/home/brendan/apps/gaffer/1.6.18.0/python/GafferUI/LazyMethod.py", line 200, in __doPendingCalls
ERROR :     method( widget, *pendingCall.args, **pendingCall.kw )
ERROR :   File "/home/brendan/apps/gaffer/1.6.18.0/python/GafferUI/PlugLayout.py", line 261, in __updateLazily
ERROR :     self.__update()
ERROR :   File "/home/brendan/apps/gaffer/1.6.18.0/python/GafferUI/PlugLayout.py", line 280, in __update
ERROR :     self.__layout.update(
ERROR :   File "/home/brendan/apps/gaffer/1.6.18.0/python/GafferUI/PlugLayout.py", line 817, in update
ERROR :     updatedTabVisibilities.append( tab.getChild().update( subsection, revealChildren ) )
ERROR :                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR :   File "/home/brendan/apps/gaffer/1.6.18.0/python/GafferUI/PlugLayout.py", line 907, in update
ERROR :     self.__column[:] = widgets
ERROR :     ~~~~~~~~~~~~~^^^
ERROR :   File "/home/brendan/apps/gaffer/1.6.18.0/python/GafferUI/ListContainer.py", line 189, in __setitem__
ERROR :     self.insert( insertionIndex + i, children[i], expands[i] )
ERROR :   File "/home/brendan/apps/gaffer/1.6.18.0/python/GafferUI/ListContainer.py", line 129, in insert
ERROR :     oldParent = child.parent()
ERROR :                 ^^^^^^^^^^^^^^
ERROR :   File "/home/brendan/apps/gaffer/1.6.18.0/python/GafferUI/Widget.py", line 383, in parent
ERROR :     parentWidget = q.parentWidget()
ERROR :                    ^^^^^^^^^^^^^^^^
ERROR : RuntimeError: Internal C++ object (PySide6.QtWidgets.QWidget) already deleted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions