ynput / ayon-core

Apache License 2.0
18 stars 30 forks source link

Houdini: support opening workfile on launch #682

Closed MustafaJafar closed 1 week ago

MustafaJafar commented 1 week ago

Changelog Description

Support opening workfile on launching Houdini. Also, it removes the redundant if statement.

Additional Info

For future reference This doesn't work

if os.environ.get("AYON_WORKFILE_TOOL_ON_START"):
    hdefereval.executeDeferred(host_tools.show_workfiles(parent=hou.qt.mainWindow()))

but, this works! :'D

if os.environ.get("AYON_WORKFILE_TOOL_ON_START"):
    hdefereval.executeDeferred(lambda: host_tools.show_workfiles(parent=hou.qt.mainWindow()))

Testing notes:

  1. Enable ayon+settings://core/tools/Workfiles/open_workfile_tool_on_startup image
  2. Launch Houdini
fabiaserra commented 1 week ago

Yes! Thank you!! My implementation was a bit uglier https://github.com/fabiaserra/ayon-core/blob/release/alkemyx/server_addon/houdini/client/ayon_houdini/api/lib.py#L1277 but we have been using successfully for a while