public void SetBoneMask(uint mask, bool includingDescendants)
    {
        NPVoxBoneModel transformedModel = CurrentModelFactory.GetProduct() as NPVoxBoneModel;

        NPVoxBone[] allBones = ((NPVoxBoneModel)transformedModel).AllBones;
        SetBoneMask(includingDescendants ? NPVoxBone.GetMaskWithDescendants(ref allBones, mask) : mask);
    }
    public void ToggleBoneMask(uint mask, bool includingDescendants)
    {
        NPVoxSkeletonTransformer t = ((NPVoxSkeletonTransformer)SelectedTransformer);
        NPVoxBoneModel           transformedModel = CurrentModelFactory.GetProduct() as NPVoxBoneModel;

        NPVoxBone[] allBones   = ((NPVoxBoneModel)transformedModel).AllBones;
        uint        toggleMask = includingDescendants ? NPVoxBone.GetMaskWithDescendants(ref allBones, mask) : mask;

        if ((mask & t.BoneMask) != 0)
        {
            SetBoneMask(t.BoneMask & ~toggleMask);
        }
        else
        {
            SetBoneMask(t.BoneMask | toggleMask);
        }
    }