Zbrush: AYON menu missing

Hi there, so it seems like our AYON menu is missing in Zbrush after some updates.
I’m unable to pinpoint which update it is that caused it. The addon and menu have been working well up until now.

It seems to still be working on my testing personal server but not on my work server…both tested on the same workstation and same version of zbrush.

Version of addons (see pic):

I also tried the latest zbrush addon ( it didn’t make a difference)

Server version: 1.5.1+202410141209
OS: Windows 11 Pro
Zbrush Version: 2022 Maxon

Thanks. Debugging this is currently unfortunately relatively hard - because I don’t believe there’s an easy way to access the actual command line output from the zbrush process we launch.

I created this issue earlier today to track that we should REALLY make that accessible: Simplify debugging by outputting to ayon console · Issue #20 · ynput/ayon-zbrush · GitHub

In this case there’s this open PR for zbrush menu issues: Bugfix/remove zscript menu by moonyuet · Pull Request #17 · ynput/ayon-zbrush · GitHub which may happen to be resolving this.

However, there recently was a massive discord chat here with @munkybutt - which I don’t think has been implemented yet either - but at least he was able to see the Zbrush AYON menu.

1 Like

Hey - I managed to get it functional last week, or at least I thought I had.
It was broken again today and I have finally managed to get it functioning properly.

This is the updated create_zmenu_script.py:

"""Pre-launch to force zbrush startup script."""

import os
from ayon_applications import PreLaunchHook, LaunchTypes
from ayon_core.lib import get_ayon_launcher_args
from ayon_zbrush import ZBRUSH_HOST_DIR


class CreateZMenuScript(PreLaunchHook):
    """Create AYON Menu Zscript to Zbrush.

    Note that this works in combination whit Zbrush startup script
    to successfully install zscripts.menu

    Hook `GlobalHostDataHook` must be executed before this hook.
    """

    app_groups = {"zbrush"}
    order = 12
    launch_types = {LaunchTypes.local}

    def execute(self):
        zscript_path = os.path.join(ZBRUSH_HOST_DIR, "api", "zscripts")
        os.makedirs(zscript_path, exist_ok=True)
        zscript_txt = os.path.join(zscript_path, "ayon_zbrush_menu.txt")
        with open(zscript_txt, "w") as zscript:
            zscript.write(self.ayon_menu())
            zscript.close()

    def ayon_menu(self):
        launch_command_list = get_ayon_launcher_args(
            "addon", "zbrush", "run-with-zscript", "--launcher"
        )

        launch_command = (
            '", #quote]]\n\t[VarSet, cmd, [StrMerge, cmd, " ", #quote, "'.join(
                launch_command_list
            )
        )
        launch_command = (
            '[VarSet, cmd, [StrMerge, "call", " ", #quote, "'
            + launch_command
            + '", #quote]]'
        )
        ayon_script = (
            """
// Set a variable to " so we can quote the command line arguments for ShellExecute
[VarSet, quote, [StrFromAsc, 34]]
[IPalette, "AYON", 1]

[ISubPalette, "AYON:Tools", 2]
// Load
[IButton, "AYON:Tools:Load...", "Open AYON Loader",
    {launch_command}
    [VarSet, cmd, [StrMerge, cmd, " ", #quote, "loader_tool", #quote]]
    [ShellExecute, cmd], 0, 120
]

// Publish
[IButton, "AYON:Tools:Publish...", "Open AYON Publisher",
    {launch_command}
    [VarSet, cmd, [StrMerge, cmd, " ", #quote, "publish_tool", #quote]]
    [ShellExecute, cmd], 0, 120
]

// Manage
[IButton, "AYON:Tools:Manage...", "Open AYON Scene Inventory UI",
    {launch_command}
    [VarSet, cmd, [StrMerge, cmd, " ", #quote, "scene_inventory_tool", #quote]]
    [ShellExecute, cmd], 0, 120
]

[ISubPalette, "AYON:Project", 2]
// Workfile
[IButton, "AYON:Project:Work Files...", "Open AYON Work Files UI",
    {launch_command}
    [VarSet, cmd, [StrMerge, cmd, " ", #quote, "workfiles_tool", #quote]]
    [ShellExecute, cmd], 0, 120
]"""
        ).format(launch_command=launch_command)
        return ayon_script

Major difference is changing the start command to call - this might be a windows only thing though?

1 Like

Hey Thanks @munkybutt !
I created the package with your script in it (replacing the original), but the AYON menu still isn’t showing up.

Did I implement it the right way?

Thanks @BigRoy !

It looks like @munkybutt 's issue had an AYON menu that wasn’t really working.

Mine is not showing up at all.

Its very strange, because I matched up all of the addon versions to my test ayon server setup where the AYON menu in Zbrush IS working, but no luck.

The server version is the same.

The workstations are all “frozen” with deep freeze, so there are no updates.

What else could it be?

We had issues where the menu didn’t show up.
You can run the generated menu txt file manually from within zbrush and see if that will kick start it?

Hmm…didn’t work.

But I did notice this in the Ayon Console:

*** WRN: >>> { ZBrushStartupScript }: [ There are unexpected launch arguments in Zbrush launch. [‘’] ]

[ Launching “zbrush/2024” with args (6): [‘C:\Program Files\Ynput\AYON 1.0.3\ayon.exe’, ‘run’, ‘C:\Users\steve.kahwati\AppData\Local\Ynput\AYON\addons\zbrush_0.3.0\ayon_zbrush\api\launch_script.py’, ‘C:\Program Files\Pixologic\ZBrush 2022 FL\ZBrush.exe’, ‘C:\Users\steve.kahwati\AppData\Local\Ynput\AYON\addons\zbrush_0.3.0\ayon_zbrush\startup\startup.txt’, ‘’] ]

I looked through, I don’t see anything out of place.

This happens with both versions of the Addon … from marketplace, and modified by @munkybutt

Looks like there is a trailing " at the end of the arguments:

startup\startup.txt’, ‘’

And yeah the my code will only run once zbrush starts properly.
If the argument list is malformed you would expect zbrush not to run at all.

1 Like

It seems that you are using Pixologic version of Zbrush instead of the Maxon one.
The ayon menu is not compatible with the Pixologic version of Zbrush and we did make the pull request (which is closed) to make the menu compatible with the Pixologic.
Enhancement: make the zscript compatible for older version of zbrush by moonyuet · Pull Request #4 · ynput/ayon-zbrush
The menu is a bit different and you need to access the AYON plugin through the tool.

I was able to use it for months on the same version.

What’s weirder though, is that it works on Zbrush 2022 on my home machine, but not on our school machines that use the same version but with floating licenses.

They have a slightly different path to the exe

C:\Program Files\Pixologic\ZBrush 2022 FL\ZBrush.exe

but it was working about a week or two ago on both

Using @munkybutt 's modified addon in addition to some other addon seemed to get zbrush (pixologic Zbrush 2022 and 2022 FL ) working with a functional AYON menu again.

I didn’t see any feedback in the console, so it was a trial and error situation enabling different versions of addons that got it to work.

Here is my list of them in case anyone else runs into this issue and maybe I can be of help.

Here is my entry in the applications addon.
It wouldn’t work if I changed the label to 2022 which is why its 2024

1 Like

That’s great. You mentioned the modified addon. Where did you get it? Did you have a link to it?

Or did you apply the changes he mentioned manually?

I haven’t uploaded the modified addon anywhere so must have been the code I posted above.

yes, from the code you posted above