SOLVED [Python API] - Foldable Group Bug Still?

Howdy everyone. First post, great to be here! I'm running on Windows w/ vR26

I'm trying to get a group to fold, but seem to be unable to get it working. After poking around in the forum, I'm finding multiple posts about how this feature has been broken since ~2018.

Reference Thread

Would someone be able to provide confirmation that this is still a bug ~5 years later?

This is as far as I was able to get - https://www.screencast.com/t/XntK6IqSS49

Clearly not the intended functionality if my group is just going to zap out of existence.

I have not attempted the suggested work around referenced here. I wanted to make sure it was still broken before sinking more time into it.

Thank you,
Clayton

hi,

sorry for the delay. As you said the flag is marked deprecated. The issue is not easy to fix and will probably not.
The way to do it is to create a button that will use LayoutFlush()/LayoutChanged to update the Layout of the GeDialog. That is a bit more complicated but doable.

Cheers,
Manuel

Hi,

Is it possible to share the code you are using?

Cheers,
Manuel

@m_magalhaes - Most definitely!

This is a section of a general c4d.gui.GeDialog class inheritance under the "CreateLayout" class method.

First attempt, only one that yielded a dropdown arrow -

        self.GroupBegin(id=101, flags=c4d.BFH_CENTER, cols=1, rows=1,
                                groupflags=c4d.BFV_BORDERGROUP_FOLD, title="Group", initw=200, inith=100)
        self.GroupBorder(c4d.BORDER_NONE)
        self.AddButton(102, flags=c4d.BFH_SCALE | c4d.BFH_FIT | c4d.BFV_SCALE | c4d.BFV_FIT, name="das_button")
        self.GroupEnd()

However, docs note that the "BFV_BORDERGROUP_FOLD" flag is deprecated. This example above was what the video in the original thread shows with the fold arrow icon disappearing w/ the group contents.

From there I experimented with the "BFV_BORDERGROUP_FOLD2" and "BFV_BORDERGROUP_FOLD_OPEN" flags. Together, soloed, in different orders. None of which gave me a fold arrow icon.

Let me know what you think. I'm only a month into C4D in general (API included), so I'm still getting a general foundation established.

Appreciate you time and input. Thank you.

hi,

sorry for the delay. As you said the flag is marked deprecated. The issue is not easy to fix and will probably not.
The way to do it is to create a button that will use LayoutFlush()/LayoutChanged to update the Layout of the GeDialog. That is a bit more complicated but doable.

Cheers,
Manuel

@m_magalhaes - All good! Just wanted to make certain that the issue hasn't been fixed yet (since 2018..).

In the future I'll write a python class, extending a group that is collapsible using the workaround you mentioned.

Thank you for getting back to me and looking into this! Cheers.