From ede0333fbc3cc4fcddc310a3d3ed00e8949ec6b5 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Wed, 12 Apr 2023 11:57:31 +0200 Subject: [PATCH] Fix `hou.ui.readInput` not returning cancel correctly --- openpype/hosts/houdini/api/creator_node_shelves.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/openpype/hosts/houdini/api/creator_node_shelves.py b/openpype/hosts/houdini/api/creator_node_shelves.py index 7e6e019b63..3638e14296 100644 --- a/openpype/hosts/houdini/api/creator_node_shelves.py +++ b/openpype/hosts/houdini/api/creator_node_shelves.py @@ -42,9 +42,16 @@ def create_interactive(creator_identifier): """ # TODO Use Qt instead - result, variant = hou.ui.readInput('Set variant', initial_contents='Main') - if result == -1: - raise RuntimeError("User interrupted") + result, variant = hou.ui.readInput('Define variant name', + buttons=("Ok", "Cancel"), + initial_contents='Main', + title="Define variant", + help="Set the variant for the " + "publish instance", + close_choice=1) + if result == 1: + # User interrupted + return variant = variant.strip() if not variant: raise RuntimeError("Empty variant value entered.")