Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project config : Do not import GafferSceneUI in headless mode #6241

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Project config : Do not import GafferSceneUI in headless mode
Longer term we plan to migrate ScriptNodeAlgo to GafferScene once we can remove GafferSceneUI::ContextAlgo.

Fixes #6239
  • Loading branch information
murraystevenson committed Jan 29, 2025
commit edc934b4d743da72fb804bd3bc0686061819930a
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Fixes
-----

- ContactSheetCore : Fixed bugs handling changes to the input and output image formats.
- Dispatch app : Fixed configuration bug which caused GafferSceneUI to be loaded unnecessarily (#6239).

1.5.4.0 (relative to 1.5.3.0)
=======
Expand Down
12 changes: 8 additions & 4 deletions startup/gui/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
import GafferDispatch
import GafferTractor

import GafferSceneUI

##########################################################################
# Note this file is shared with the `dispatch` app. We need to ensure any
# changes here have the desired behaviour in both applications.
Expand All @@ -69,8 +67,14 @@ def __scriptAdded( container, script ) :

GafferImage.FormatPlug.acquireDefaultFormatPlug( script )

renderPassPlug = GafferSceneUI.ScriptNodeAlgo.acquireRenderPassPlug( script )
Gaffer.Metadata.registerValue( renderPassPlug["value"], "plugValueWidget:type", "GafferSceneUI.RenderPassEditor._RenderPassPlugValueWidget" )
# We don't want to load UI modules unless we're in a UI context.
## \todo We plan to eventually migrate ScriptNodeAlgo to GafferScene,
# which will allow us to remove this hack.
if "GafferUI" in sys.modules :
import GafferSceneUI

renderPassPlug = GafferSceneUI.ScriptNodeAlgo.acquireRenderPassPlug( script )
Gaffer.Metadata.registerValue( renderPassPlug["value"], "plugValueWidget:type", "GafferSceneUI.RenderPassEditor._RenderPassPlugValueWidget" )

application.root()["scripts"].childAddedSignal().connect( __scriptAdded )

Expand Down
Loading