You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When looping over sources to set their visibility (item.setVisible(self.visible)) only the last source was actually updated with the given visibility. It looks like there's a race condition where an item is put into a 'slot' and then the visibility is adjusted. However, when another item has to do the same thing at (nearly) the same time, it might happen that the 'slot' is filled with this newer item before the visibility change is applied. Resulting in it only working on the last item.
This might be related to the comment about async attaching here: #297 (comment)
I circumvented this by awaiting just about everything that is going to Xsplit/xjs, but this was quite unexpected behaviour.
The text was updated successfully, but these errors were encountered:
Shoot... Did a little check and indeed encountered the above-mentioned issue using a simple test
xjs.Scene.getActiveScene().then(scene => {
myScene = scene;
return myScene.getItems();
}).then(items => {
myItems = items
myItems.forEach(item => {
item.setVisible(false)
})
});
// only the last two items are hidden
Looked into it further by getting the properties instead and it now yielded the correct results (two true and two false values). While the second test did support my answer to the mentioned comment, it also showed that there's an inconsistency on the synch-ness of the calls to attach and setting and getting properties. Will check this further on core but as of now, yeah, we might need to use await to ensure that the proper items and their method calls are in synch.
When looping over sources to set their visibility (
item.setVisible(self.visible)
) only the last source was actually updated with the given visibility. It looks like there's a race condition where an item is put into a 'slot' and then the visibility is adjusted. However, when another item has to do the same thing at (nearly) the same time, it might happen that the 'slot' is filled with this newer item before the visibility change is applied. Resulting in it only working on the last item.This might be related to the comment about async attaching here: #297 (comment)
I circumvented this by
await
ing just about everything that is going to Xsplit/xjs, but this was quite unexpected behaviour.The text was updated successfully, but these errors were encountered: