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

Bone Slot class setVisible change suggest #187

Open
namuda opened this issue Aug 14, 2018 · 0 comments
Open

Bone Slot class setVisible change suggest #187

namuda opened this issue Aug 14, 2018 · 0 comments

Comments

@namuda
Copy link

namuda commented Aug 14, 2018

void Bone::setVisible(bool value)
{
if (_visible == value)
{
return;
}
_visible = value;
for (const auto & slot : _armature->getSlots())
{
if (slot->getParent() == this)
{
slot->_updateVisible();
}
}
}

void Slot::setVisible(bool value)
{
if (_visible == value)
{
return;
}
_visible = value;
_updateVisible();
}

void CCSlot::_updateVisible()
{
_renderDisplay->setVisible(_parent->getVisible()); // Only the visible state of the bone is used.
}

-- suggest
Bone class
void Bone::setVisible(bool value)
{
if (_visible == value)
{
return;
}
_visible = value;
for (const auto & slot : _armature->getSlots())
{
if (slot->getParent() == this)
{
slot->setVisible(_visible); //Change:Apply to bone sub-slot visible state
slot->_updateVisible();
}
}
}

CCSlot class
void CCSlot::_updateVisible()
{
_renderDisplay->setVisible(getVisible());//Change:Apply slot visible state
}

The existing setVisible() function can not apply the visible state on a slot by itself.
I hope you can use both the slot and the visible state of the bone.
I would like to be able to use both the slot and bone visible states.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant