Page 1 of 2

Refreshing a Variable when Using Scene Port & Case Switching

Posted: 07 Nov 2014, 18:48
by dondi
Working on my Music Visualization project as Ventuz practice and I am having trouble trying to refresh a String Variable that I am using in a loaded scene.

I have a Master Scene that contains all my logic and variable assignments depending upon the song currently playing. I have split-up my scene where I have background visuals and Music Info. These two portions in my master scene are using a case switch node so that I may cycle-through multiple versions of each based on a keystroke. I have currently designated 5 cases each in order to load-in 5 scenes with different layouts.

My issue is occurring when I have a background scene (Music_Vis_01) loaded into the Master Scene at Case_0 which is passing a string variable for the Artist Name to Music_Vis_01. The Music_Vis_01 scene updates the art fine when it is active and the song changes; it is able to update to the appropriate art associated with the currently-playing song. However, if I have Music_Vis_01 active and ARTIST-X is playing and displaying correctly, I run into trouble when I cycle the case away from Music_Vis_01 and change the song. When I cycle back to Music_Vis_01, instead of ARTIST-Y being displayed inside Music_Vis_01, ARTIST-X is still being displayed until the song changes while Music_Vis_01 is active.

I have tried using Scene events and manually nudging to get the artist name to update/refresh inside Music_Vis_01 after cycling through the cases and changing the song while Music_Vis_01 is not active and returning, but to no avail.

Music_Vis_01 has a String Expression for the currently-playing Artist that is exposed and connected to my Master scene. It just seems to be a disconnect when the song changes while Music_Vis_01 is not active and I cannot seem to find a way to poke that string variable back into the Music_Vis_01 scene.

-- D

Re: Refreshing a Variable when Using Scene Port & Case Switc

Posted: 07 Nov 2014, 22:34
by dondi
I got this to work, but I am not so sure it is the most efficient/elegant way of doing this in Ventuz. Suggestions are most welcome for a better method than what I did (below):

I used the KeyUp method of the keystroke that I am using to cycle through the Music_Vis cases, as a trigger bound to an Event Dispatcher Node with a 10f delay inside the Master Scene. From here, I am using a Value Dispatcher Node that is grabbing the String Variable from the Master Scene and sending it to the newly-activated Music_Vis_01 scene. This is effectively refreshing the loaded scene with the ARTIST variable, but I am not so sure this is the best method to do this.

Incidentally, I noticed that if I hi Ctrl + S to save either of my scenes (before dong the above), the art/variables would update and I'd get the result I was expecting in the first place.

Re: Refreshing a Variable when Using Scene Port & Case Switc

Posted: 09 Nov 2014, 13:23
by chriss0212
maybe you can post the scene, to take a look and how we can help...

greetz

christian

Re: Refreshing a Variable when Using Scene Port & Case Switc

Posted: 09 Nov 2014, 19:05
by dondi
I have posted my entire Project folder (external link at bottom of post) after thinning it out best I can from >15GB to the posted .zip file that is about 150Mb, without destroying the functionality while providing as much of the assets in order to see what is going on with my project. I don't think providing just the scene files or a .vza would have been suitable for troubleshooting.

Simply unzip and it should create a Project Hierarchy named MusicPlayer with everything inside.
• MusicPlayer.vzp (Project)
• 4 Scene files:
— Music_Master_Try-01.vzs (The master scene file I was having the issue with)
— Music_Master_Try-02.vzs (Master Scene file where I did a hack around the issue I was having with Music_Master_Try-01.vzs; workaround described in previous post)
— Music_Info_Try-01.vzs (Scene that displays info about song that is currently playing; i.e., cover art, cd art, ID3 Tag info, remaining time & remaining time progress bar and album review)
— Music_Vis_Try-01.vzs (Scene that displays background fanart; this is the scene involved with my issue along with Music_Master_Try-01.vzs)

• Inside the AUDIO directory is a subfolder named music that contains the music library with it's proprietary folder hierarchy: music\[Alphabetized subfolders by artists's first letter]\[ARTIST]\[ALBUM_YEAR ALBUM NAME [BITRATE]]\. Each ALBUM contains a FOLDER.jpg for the cover art. Most folders also contain a CDArt.png file for the disc art and most also have an ALBUM REVIEW text file.
• Inside the IMAGES folder are some images for the background, the background gradient, default images for the CDArt and fanart when there are none found in the included libraries. Also inside the IMAGES folder is a subfolder named MUSIC LIBRARY ART. This art library contains art on a per-artist basis; each subfolder is the ARTIST NAME that can contain an artist thumbnail, artist logo and artist banner image. Each of these folders can also contain another subfolder named EXTRAFANART. This is the folder that contains the images I am using to display in Music_Vis_Try-01.

User controls
I mapped 3 keys for user interaction:
RIGHT ARROW = Shuffle song
i = Cycle through 5 Music_Info_Try scenes that contain different layouts and info of currently-playing song. Presently, there is only 1 (Music_Info_Try-01.vzs)
v = Cycle through 5 Music_Vis_Try scenes that contain different background layouts. Presently, there is only 1 (Music_Vis_Try-01.vzs)

To re-create the issue I originally described:
• open Music_Master_Try-01.vzs and it should randomly select a song in the library and start playing with the appropriate art/info coming from both the Music_Vis_Try-01.vzs and Music_Info_Try-01.vzs scenes (Take note of the 3 images mapped to the rotating cylinder in the background. This is the fanart for the currently-playing artist; for this explanation, referred to as ARTIST X).
• Tap v on the keyboard to cycle the background to a case that has no associated scene file and the spinning cylinder with the 3 fanart images should go away. The Master scene should be at the 2nd case of 5 cases for the background art.
• Tap the RIGHT ARROW key to change the song. (The currently-playing artist is now ARTIST Y)
• Tap the v key on the keyboard 4 times to bring the background fanart scene back (Music_Vis_Try-01.vzs) to Case 0 in the Master scene.
It is at this point that Music_Vis_Try-01.vzs becomes active but is displaying art for ARTIST X (the last artist playing when the scene was active) instead of ARTIST Y (currently-playing artist)

My questionable workaround is found on the root of Music_Master_Try-02.vzs where I binded Value Dispatcher and Event Dispatcher nodes to the KeyUp of the v key with a 10 frame delay.

Here is the entire project: ~150Mb
Download MusicPlayer Project

Re: Refreshing a Variable when Using Scene Port & Case Switc

Posted: 09 Nov 2014, 19:26
by dondi
NOTE: If you download the project I posted, beware that I manually cobbled this together and neglected to update the Project properties; this project snowballed while I was using the Tutorials, thus it will show up in the main Ventuz Project browser as TUTORIAL 01.

You are better-off double-clicking the included MusicPlayer.vzp file. Sorry about that.

Re: Refreshing a Variable when Using Scene Port & Case Switc

Posted: 10 Nov 2014, 10:25
by chriss0212
your zip file is broken! just 0 kb ;)

greetz

christian

Re: Refreshing a Variable when Using Scene Port & Case Switc

Posted: 10 Nov 2014, 16:18
by dondi
Thanks Christian. File link should be good now.

Re: Refreshing a Variable when Using Scene Port & Case Switc

Posted: 12 Nov 2014, 23:15
by chriss0212
hi dondi,

for me it seems, that you trying to update disabled scenes. i removed the Music_Vis_01 from the case switch and coupled it with an expression and an alpha node...and it seems to work! dont forget in this case to disable block alpha in the alpha node otherwise you could get same issue

greetz

christian

Re: Refreshing a Variable when Using Scene Port & Case Switc

Posted: 13 Nov 2014, 00:50
by dondi
Thanks for the feedback Christian, I appreciate it. Did you happen to open the Music_Master-02 scene? This was my attempt at solving the issue while trying to keep the case switching of the scenes intact (as this was my own exercise in learning how to import scenes). When I came up with my solution in Music_Master-02, I was questioning whether it was something that someone more experienced with Ventuz would do, which prompted me posting to the forums.

I am just using this project for me to get better at Ventuz. Since posting I have added more scenes with other layouts.

Again, thanks for the feedback,
-- D

Re: Refreshing a Variable when Using Scene Port & Case Switc

Posted: 13 Nov 2014, 07:37
by chriss0212
hi dondi,

v2 is working because of the delayd triggering. but this is not very elegant because you have the wrong picture in the first moment of reactivating the scene. i havnt removed the switch case...but it is not needed anymore ;)

greetz

chritian