Last active
July 6, 2017 09:01
-
-
Save fwilleke80/6d0887db70a3f66ed4db9baa8f763689 to your computer and use it in GitHub Desktop.
[C4D] Show or hide an element from a node's description
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// 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