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

[BUG] - bindVisibility does not work when attaching to MeasuredTemplates #204

Open
346184 opened this issue Sep 19, 2023 · 0 comments
Open

Comments

@346184
Copy link

346184 commented Sep 19, 2023

Describe the bug
Toggling the visibility of templates (by right clicking the templates icon) works for the template, but does not change the visibility of any attached Sequencer effects, even if they are attached and have bindVisibility set to true.

bindVisibility seems to currently hook sightRefresh, and it seems when MeasuredTemplate.hidden gets updated, only updateMeasuredTemplate gets called:

if (this.data.attachTo?.bindVisibility) {
hooksManager.addHook(
this.uuid,
"sightRefresh",
() => {
const sourceVisible =
this.source && (this.sourceMesh?.visible ?? true);
const sourceHidden =
this.sourceDocument && (this.sourceDocument?.hidden ?? false);
const targetVisible =
this.target &&
(!attachedToTarget || (this.targetMesh?.visible ?? true));
this.renderable =
baseRenderable &&
(sourceVisible || targetVisible) &&
this._checkWallCollisions();
this.alpha = sourceVisible && sourceHidden ? 0.5 : 1.0;
renderable = baseRenderable && this.renderable;
},
true
);
}

To Reproduce
Steps to reproduce the behavior:

  1. Create a persistent effect attached to a template with bound visibility
  2. Toggle the template's visibility
  3. See that the template got hidden, but the Sequencer effect remains unaffected

Expected behavior
The Sequencer effect should be shown or hidden depending on the template it is attached to, if bindVisibility is enabled.

Setup:

  • Foundry Version: v11.308
  • System Version: 5E 2.3.0
  • Sequencer Version: Latest
  • Browser & version: Chrome, but should not matter
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