Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[request] [Node API] Add support for disabling grouped parameters by disabling the containing group (desc.GroupAttribute) #2638

Open
almarouk opened this issue Jan 6, 2025 · 0 comments
Labels
feature request feature request from the community

Comments

@almarouk
Copy link
Member

almarouk commented Jan 6, 2025

Currently to do that, an 'enabled' parameter should be added to the group attribute's list of parameters and the value of this parameter should be used in each of the other parameters in the list. For example, in:

desc.GroupAttribute(
name="refine",
label="Refine",
description="The refine step computes a similarity volume in higher resolution but with a small depth "
"range around the SGM depth map.\n"
"This allows to compute a depth map with sub-pixel accuracy.",
group=None,
groupDesc=[
desc.BoolParam(
name="refineEnabled",
label="Enable",
description="Enable depth/similarity map refinement process.",
value=True,
),
desc.IntParam(
name="refineScale",
label="Downscale Factor",
description="Downscale factor applied on source images for the Refine step (in addition to the "
"global downscale).",
value=1,
range=(-1, 10, 1),
enabled=lambda node: node.refine.refineEnabled.value,
),
desc.IntParam(
name="refineStepXY",
label="Step XY",
description="The step is used to compute the refine volume for one pixel over N (in the XY image plane).",
value=1,
range=(-1, 10, 1),
enabled=lambda node: node.refine.refineEnabled.value,
),
desc.IntParam(
name="refineMaxTCamsPerTile",
label="Max Nb Neighbour Cameras Per Tile",
description="Maximum number of neighbour cameras used per tile.",
value=4,
range=(1, 20, 1),
enabled=lambda node: node.refine.refineEnabled.value,
),

It would be great to be able to simply do the following instead:

desc.GroupAttribute( 
     name="refine", 
     label="Refine", 
     description="The refine step computes a similarity volume in higher resolution but with a small depth " 
                 "range around the SGM depth map.\n" 
                 "This allows to compute a depth map with sub-pixel accuracy.", 
     group=None, 
     groupEnabled=True, // if not null, would automatically add a desc.BoolParam to the group
     groupDesc=[ 
         desc.IntParam( 
             name="refineScale", 
             label="Downscale Factor", 
             description="Downscale factor applied on source images for the Refine step (in addition to the " 
                         "global downscale).", 
             value=1, 
             range=(-1, 10, 1), 
         ), 
         desc.IntParam( 
             name="refineStepXY", 
             label="Step XY", 
             description="The step is used to compute the refine volume for one pixel over N (in the XY image plane).", 
             value=1, 
             range=(-1, 10, 1), 
         ), 
         desc.IntParam( 
             name="refineMaxTCamsPerTile", 
             label="Max Nb Neighbour Cameras Per Tile", 
             description="Maximum number of neighbour cameras used per tile.", 
             value=4, 
             range=(1, 20, 1), 
         ), 
@almarouk almarouk added the feature request feature request from the community label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request feature request from the community
Projects
None yet
Development

No branches or pull requests

1 participant