Skip to content

Instantly share code, notes, and snippets.

@fwilleke80
Last active July 6, 2017 09:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fwilleke80/6d0887db70a3f66ed4db9baa8f763689 to your computer and use it in GitHub Desktop.
Save fwilleke80/6d0887db70a3f66ed4db9baa8f763689 to your computer and use it in GitHub Desktop.
[C4D] Show or hide an element from a node's description
/// Show or hide an element from a node's description
///
/// param[in] node The node whose description we're changing
/// param[in] descr The description we're changing
/// param[in] MyDescID The ID of the element
/// param[in] show Pass true to show, or false to hide
/// return False if an error occurred, otherwise true
static Bool ShowDescription(GeListNode *node, Description *descr, Int32 descID, Bool show)
{
AutoAlloc<AtomArray> ar;
if (!ar)
return false;
ar->Append(static_cast<C4DAtom*>(node));
BaseContainer *bc = descr->GetParameterI(DescLevel(descID), ar);
if (bc)
bc->SetBool(DESC_HIDE, !show);
else
return false;
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment