Hi there, i’m trying to do a scrollable vertical menu of videos, like Netflix or YT, but vertical
The videos will be placed on a grid SOP, they will be moved up and down in Y axis with a Kinect. The image help to understand better the logic behind this. Grid #4 will be the default video, this grid will feedback the user that its on the video, just about to play if the user commands, the others are kinda blur in the background.
The goal here is to see the translation in Y, see the increase and/or decrease of all grids, and the translation should be by steps.
If i do it with a simple ty, i cant get the right scale if the grid goes from 0.95, then 1, 0,95 and ends in 0.9. I’m trying with a pattern CHOP triangle, but wanna see if there’s a cleaner way to do it with scripts, im not so sure
And also, the translation of all SOPs should rest in the others vídeo previous position. Meaning that the movement should be limited by steps. If the user do an up translation, goes From -4, to 0 should rest there a sec and show a preview, not continue without control.
Hope My doubt it’s understandable. I’m new to python and to UI in TD
interfaces, especially when interacting with things like the kinect, can be build and animated with SOPs and Geometry instancing. Instances can be driven by CHOPs, DATs, TOPs or SOPs giving great flexibility in how you might solve this.
My approach is usually to solve with operators as much as possible and only use python if necessary or more performant.
In the attached file I use a Pattern CHOP with a Sine type curve that i set to the range you want to scale with. Another Pattern CHOP with a Ramp type and only 7 samples (number of videos) is used as the ty position for my instances. Now I also can use the ty position as a lookup into the scale to get the correct scale for each video.
By controlling the offset parameter of the Pattern CHOP used for the ty position, I can move the videos up and down.
To simulate this, there is a slider with the value first passing into a math to rerange the values to fit my max offset range. then it goes into a limit where the value is quantized so you always land on a video. This finally passes through a lag to animate the whole thing nicely and then the value is exported to the Offset parameter of the Pattern CHOP.
I didn’t quite understand the second part of your question:
Thanks Markus, it really help me to understand instancing, I change the number of videos, and could do it thanks to your explanation. About your doubt, what i mean is that the translation must be done by steps, not like a ‘top to bottom’ scroll. Im trying this with a count CHOP, so the value its changing by determinated steps, and the geo instancing movement its also done by steps . Now im figuring out how to put a folder of assets (moviefilein) playing over the instancing of the rectangle SOP. Those rectangles muts be playing a folder of GIFs, matching the number of rectangle, with the number of gif. I know how to instancing color, but not so sure how to instance differents textures in every rectangle
hopefully you have already had some success with the stepping of the movement? The network from before should work, just the slider needs to be replaced with 2 buttons and a math the controls the increment value input of the Count CHOP - one button should be +1, the other -1 - as both buttons can’t be hit at ones, you can add both values together to control the increment.
On the topic of playing textures on the instances - there is the option of texture instancing - would this be an option for you? Check out the Operator Snippets for an example (under the Geometry COMP)
Hey markus, hope u are doing well. I put some texture in the geo instancing by using the glsl multi TOP. Now im having some trouble by setting an appropiate tmove of a scroll with 8 elements. You hand me the reference of one that got 7 elements, i did another of 4, but im kinda stuck in the scroll with 8 elements (red base1) could you check it out and let me know where is my mistake pls. the thanks!!!
whats not working correctly is the limit quantize. The quantize step should be the stepsize between the geometries. This depends on the number of geos and is something like: 1/((numInstances-1)*2) - so in the case of 8 instances the quantize step would have to be 1/14.
To make this work more dynamically, use an expression:
1/((op('pattern2').par.length-1)*2)
Just because I saw it - you might also like to use just a single Count CHOP by making use of the “Increment Value” input. Use a Math CHOP to multiply the value of the button_down by -1 and add it to the button_up value before inputting it to the count.