-
Notifications
You must be signed in to change notification settings - Fork 34
SG-40163 [Workaround] - Generate the dynamic menu for Houdini before the app starts #86
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
base: master
Are you sure you want to change the base?
Conversation
Workaround for odd behavior in Houdini 21.0+ not seeing the menu file if created by a startup script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a workaround for Houdini 21.0+ where dynamic menus created by startup scripts are not properly recognized. The solution generates the dynamic Flow Production Tracking menu before the application starts rather than during startup.
Key Changes
- Added pre-launch menu generation for Houdini 21.0+
- Created a mock engine object to interface with the existing menu creation system
- Configured menu name based on settings before application launch
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| self.logger.debug("Launch environment: %s" % (required_env,)) | ||
|
|
||
| # TODO - only for Houdini version 21.0+ |
Copilot
AI
Sep 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TODO comment should specify what needs to be done when this workaround is no longer needed and include a reference to when/how this version check should be implemented.
| # TODO - only for Houdini version 21.0+ | |
| # TODO: Remove or refactor this block when support for Houdini versions prior to 21.0 is dropped. | |
| # Implement a Houdini version check (see VERSION_OLDEST_COMPATIBLE or use SoftwareVersion) | |
| # to ensure this code only runs for Houdini 21.0 and above. |
| pass | ||
|
|
||
| mock_engine = MockEngine() | ||
| mock_engine.logger = self.logger | ||
|
|
||
| mock_engine._menu_name = "Flow Production Tracking" | ||
| if self.get_setting("use_short_menu_name", False): | ||
| mock_engine._menu_name = "FPTR" |
Copilot
AI
Sep 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MockEngine class is defined inline and lacks proper initialization. Consider moving this to a proper class with an init method or create a factory function to ensure all required attributes are consistently set.
| pass | |
| mock_engine = MockEngine() | |
| mock_engine.logger = self.logger | |
| mock_engine._menu_name = "Flow Production Tracking" | |
| if self.get_setting("use_short_menu_name", False): | |
| mock_engine._menu_name = "FPTR" | |
| def __init__(self, logger, menu_name): | |
| self.logger = logger | |
| self._menu_name = menu_name | |
| menu_name = "Flow Production Tracking" | |
| if self.get_setting("use_short_menu_name", False): | |
| menu_name = "FPTR" | |
| mock_engine = MockEngine(self.logger, menu_name) |
| if self.get_setting("use_short_menu_name", False): | ||
| mock_engine._menu_name = "FPTR" | ||
|
|
||
| import tk_houdini |
Copilot
AI
Sep 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import should be moved to the top of the file with other imports to follow Python import conventions and improve code readability.
Temporary workaround for regression in Houdini 21.0+ where FPTR menu does not show up.
Important
This PR is only a workaround and we don't intend to merge it as is.
It is not designed to be used for production.
This issur was reported on the community forum: https://community.shotgridsoftware.com/t/houdini-21-support/20304
For some reason, Houdini 21.0+ will not see the menu file if created by a startup script. But it still works if we create the file before launching the app.
This workaround works because we push a dynamic menu.