SOLVED R21 CommandData with option - not working on macOS

I am updating an R20 plugin to work with R21.
The CommandData has changed, and requires an additional argument in most of its methods. Fine!
Plugin is updated and is available in the "Extensions" menu of R21.
However, in R20 it was available as an entry with a cog wheel behind it, since I had registered the CommandData as:

RegisterCommandPlugin(PLUGINID, GeLoadString(IDS_PLUGINNAME), PLUGINFLAG_COMMAND_OPTION_DIALOG, AutoBitmap("plugin.png"_s), "pluginname"_s, NewObjClear(PluginCommand));

I first converted the R20 code to R21 on Windows, and ran Cinema4D in debug. I didn't notice the cogwheel missing on Windows, it still might be the case, I just have currently no possibility to check it. However, now on macOS it is obviously missing.

Worst is that I seem to be unable to access CommandData::Execute() as selecting the plugin entry in the "Extensions" always seems to bring up the option dialog window, thus actually performing CommandData::ExecuteOptionID().
When I assign a shortcut to the plugin without the "option" checked, then hitting the shortcut will perform the CommandData::Execute().

This is on High Sierra, with a freshly installed R21.026 (this exact morning).

Will need to cross check what happens on Windows 10 ...

Just checked on Windows, the cogwheel is present using R21.022 and after upgrading to R21.026 cogwheel is still available on Windows.
So is this a macOS thing only ?

I have modified the subject line in order to better indicate there's an issue on macOS. Also added the "issue" tag.
As it has been 5 days without any feedback, I am starting to fear that this is yet another one that cannot be reproduced ...

Hi Daniel, first and foremost I apologize for the delay getting back here. It simply slipped through our daily checking for a few days and we're indeed grateful to you for having reported the focus on it.

With regard to the reported behavior I confirm that it's a limitation we already know and it appears only on macOS when the Cinema 4D top menu bar is embedded in the macOS menu bar.

If Cinema runs with its own top menu bar, the issue doesn't occur.

What instead looks like a bug to me is that when Cinema uses the macOS menu bar, clicking on the command doesn't fire the Execute() method but rather the ExecuteOptionID() with the subid parameter equal to 0. On the opposite when Cinema uses its own top menu bar clicking on the command just fires the Execute() as expected.
I'm going to file a bug report and see how it evolves.

Best, Riccardo

Thanks for confirming the issue.
Should I leave the topic open until a bugfix is provided, or need I close it since not much more can be done at this point in time?

A question on the side, for documentation purposes:
Is a solution being looked at, in order to provide a work around to the known limitation, or provide an alternative way of having the CommandData option available?

@C4DS said in R21 CommandData with option - not working on macOS:

Is a solution being looked at, in order to provide a work around to the known limitation, or provide an alternative way of having the CommandData option available?

If I properly understood your question, for the time being, the workaround should take in consideration that when the command is called from the "Extension" menu (on Cinema uses macOS menu bar as its menu bar) the value of the subid parameter is zero.

Hope it makes sense (but I might have misunderstood your comment)

Cheers, R

Good to know to check with value zero, but that isn't exactly what I meant.

You see, when user has the default layout with "Extension" menu part of the macOS menu, at that point the user has no possibility to launch the plugin via the cog wheel.
What I thus meant: is MAXON looking to bring back a way to show and use the cog wheel when using the macOS menu. Or is there a way for the user to launch the plugin with or without option (assuming the macOS menu is used).

Hi Daniel,

for the time being I see three options:

  • run Cinema with its own menu bar;
  • drag out the menù containing your CommandData in order to make the cogwheel appear
  • use keyboard modifiers:
    • Alt + LMB -> lunches CommandData::Execute()
    • LMB -> lunches CommandData::ExecuteOptionID()

Best, Riccardo

Hi @r_gigante ,

Has this issue been resolved yet?


Hi @ph1lh00k , no update so far

Cheers, R

Ok, thanks @r_gigante... I'll keeping going with the workaround.