Home › Forums › Programming › Q: toggle button and animation loop check
- This topic has 4 replies, 2 voices, and was last updated 4 years, 7 months ago by robwu01.
-
AuthorPosts
-
2020-05-02 at 8:26 pm #27109robwu01Participant
Hi all,
Just started looking into Verge3D in combination with Blender.
As as exercise to get familiar with the setup of Verge3D, I’m converting an old project from Unity over to Blender + Verge.
The conversion to Blender was easy, and I have the CAD file now in Verge as well.OK, so here’s my two questions, any tips where to look are appreciated.
First one:
I would like to have the ability to toggle a button to e.g. hide/unhide a object combo. So hide object A on a button click and show object B, and on re-click the opposite. I already saw you can hide objects on startup.
The same for material combo’s. Click the button once, and there’s another material. Click again and revert back to the old one.
Have looked at the puzzles, but not sure what to pick atm… Some sort of array?Second one (sorry if this is better a second post..):
I have -say- 3 animations on the object, and I would like to have the following functionality…
I click on the first menu button and start animation A, now I click on the second menu button for animation 2.
Before animation 2 is played, I would like to have a check to see if another animation (in this case A) has run, reverse animation A first to the start state, and -then- start animation 2.
And the same for the third menu button and animation 3.So every button should check if any of the other animations has run, and first run the inverse animation, before starting the animation corresponding with the button click.
Hope someone can point me in the right direction, examples or documentation.
I love the ability to move directly from Blender to Verge, it’s so intuitive to do.cheers!
rob
hollandBelow sea level: 52.213545 Lat, 4.422061 Long
2020-05-04 at 7:54 am #27145Yuri KovelenovStaffI would like to have the ability to toggle a button to e.g. hide/unhide a object combo. So hide object A on a button click and show object B, and on re-click the opposite. I already saw you can hide objects on startup.
The same for material combo’s. Click the button once, and there’s another material. Click again and revert back to the old one.
Have looked at the puzzles, but not sure what to pick atm… Some sort of array?exactly this use case is covered in our tutorial
3 animations on the object, and I would like to have the following functionality
you can detect if animation is finished, and play animation in reverse with puzzles
https://www.soft8soft.com/docs/manual/en/puzzles/Animation.html2020-05-04 at 8:46 am #27146robwu01ParticipantThanks!
Will have a look and see if I can get it to work ;)I posted another question on the fullscreen button yesterday, but the post is gone on the forum. But I get an error message if I look at my posts.
Is there something I did wrong? I tried to edit it due to some grammar errors, and after that it was gone…Below sea level: 52.213545 Lat, 4.422061 Long
2020-05-05 at 4:55 am #27173Yuri KovelenovStaff2020-05-05 at 11:22 am #27212robwu01ParticipantThanks for both answers :)
I solved my toggle buttons with the help of the animation series, and added some code so I can also ‘reset’ materials in-between other buttons.
I love the blender-verge combo, I can see it already saving so much time not having to redo a lot of things in Unity. Not to mention the ease of programming things.
cheers!
robBelow sea level: 52.213545 Lat, 4.422061 Long
-
AuthorPosts
- You must be logged in to reply to this topic.