Skip to content

Conversation

@julien-lang
Copy link
Contributor

@julien-lang julien-lang commented Sep 4, 2025

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.

Workaround for odd behavior in Houdini 21.0+ not seeing the menu
file if created by a startup script
@julien-lang julien-lang requested a review from Copilot September 4, 2025 23:47
Copy link
Contributor

Copilot AI left a 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+
Copy link

Copilot AI Sep 4, 2025

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.

Suggested change
# 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.

Copilot uses AI. Check for mistakes.
Comment on lines +138 to +145
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"
Copy link

Copilot AI Sep 4, 2025

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.

Suggested change
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)

Copilot uses AI. Check for mistakes.
if self.get_setting("use_short_menu_name", False):
mock_engine._menu_name = "FPTR"

import tk_houdini
Copy link

Copilot AI Sep 4, 2025

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants