Generate 3D Subplots in R in a loop

Hi Plotly team,

I am very interested in knowing how would you code the 3D subplot example (LINK) to generate 3D subplot scenes in a loop.

I do not want to manually specify the scenes in the layout and instead generate them on the fly based on levels of factors in my data.

I’m trying to generate something like this for 20-30 variables, meaning automatically arrange 20-30 plots: