Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Houdini: Fix outdated containers pop-up on opening last workfile on launch #5567

Merged
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
48 changes: 30 additions & 18 deletions openpype/hosts/houdini/api/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,28 @@ def on_save():
lib.set_id(node, new_id, overwrite=False)


def _show_outdated_content_popup():
# Get main window
parent = lib.get_main_window()
if parent is None:
log.info("Skipping outdated content pop-up "
"because Houdini window can't be found.")
else:
from openpype.widgets import popup

# Show outdated pop-up
def _on_show_inventory():
from openpype.tools.utils import host_tools
host_tools.show_scene_inventory(parent=parent)

dialog = popup.Popup(parent=parent)
dialog.setWindowTitle("Houdini scene has outdated content")
dialog.setMessage("There are outdated containers in "
"your Houdini scene.")
dialog.on_clicked.connect(_on_show_inventory)
dialog.show()


def on_open():

if not hou.isUIAvailable():
Expand All @@ -316,28 +338,18 @@ def on_open():
lib.validate_fps()

if any_outdated_containers():
from openpype.widgets import popup

log.warning("Scene has outdated content.")

# Get main window
parent = lib.get_main_window()
if parent is None:
log.info("Skipping outdated content pop-up "
"because Houdini window can't be found.")
# When opening Houdini with last workfile on launch the UI hasn't
# initialized yet completely when the `on_open` callback triggers.
# We defer the dialog popup to wait for the UI to become available.
# We assume it will open because `hou.isUIAvailable()` returns True
import hdefereval
hdefereval.executeDeferred(_show_outdated_content_popup)
else:
_show_outdated_content_popup()

# Show outdated pop-up
def _on_show_inventory():
from openpype.tools.utils import host_tools
host_tools.show_scene_inventory(parent=parent)

dialog = popup.Popup(parent=parent)
dialog.setWindowTitle("Houdini scene has outdated content")
dialog.setMessage("There are outdated containers in "
"your Houdini scene.")
dialog.on_clicked.connect(_on_show_inventory)
dialog.show()
log.warning("Scene has outdated content.")


def on_new():
Expand Down
Loading