Forum

Blend4Web-powered online shop

10 December 2014 20:43
How can a selected animation be made to loop? as it is, SELECT AND PLAY only achieves one loop, but it is not cyclic. As an example, making a light sequence flash using VALUE animations, and when a button is pressed, a different animated loop happens, replacing the first, and back again when the button is again clicked (or another button is fine also).
10 December 2014 21:00
Ответ на сообщение пользователя trepaning
How can a selected animation be made to loop? as it is, SELECT AND PLAY only achieves one loop, but it is not cyclic. As an example, making a light sequence flash using VALUE animations, and when a button is pressed, a different animated loop happens, replacing the first, and back again when the button is again clicked (or another button is fine also).
Consider to use 2 animated Value nodes at once - one of them might be looped for infinite flashing, while another might be controlled by NLA Script, for lowering the flash intensity to 0 and increasing back to 1 upon mouse clicks.
The Founder | Twitter | Facebook | Linkedin
10 December 2014 21:18
this file

http://www.pestnoproblem.ca/x3d/hr211-homeSentinel-b4w-lights-packed.blend

makes this page

http://www.pestnoproblem.ca/x3d/homeSentinel-b4w.html

When the PET FRIENDLY button is clicked, I would like the switch to move up to ON and i would like the Ultrasonic LED to stop flashing. When I click the button again, it reverts to flashing in a loop again and the button moves back to OFF position.

I could set two LEDs, one flashing and one not, and just swap them, but is there a way to actually turn off and on the flashing loop?
10 December 2014 21:22
Okay I'll ask our guys to take a look
The Founder | Twitter | Facebook | Linkedin
10 December 2014 22:17
I recommend using TIME ->Math(Sine or Cosine) instead of animated value for non-stop things like this flashing loop. So you can set flashing loop which won't be affected by timeline and mix it with zero by animated factor: so you can animate value that will chenge between "flashing" and "off" conditions

Try material like this: I think it must work correctly

10 December 2014 22:42
I will try this, soon. It is important that the timing remain so that when the RED led is on, the GREEN led is off, even after switching between ON and OFF mode.

So, top GREEN is always on
Middle GREEN flashes OFF-ON-OFF for frame 1-10
Bottom RED flashes OFF-ON-OFF for frames 11-45

when button clicked
top GREEN is ON
Middle GREEN flashes OFF-ON-OFF for frame 1-10
Bottom RED is OFF for frames 11-45

Switching back sets Bottom RED back to OFF-ON-OFF for frames 11-45
11 December 2014 10:16
Okay let us know about your progress
The Founder | Twitter | Facebook | Linkedin
11 December 2014 20:23
The material does not work as required, but as mentioned, i can swap out the blinking light with a non-blinking one. There is always a way.

Here is another Blend file with a couple issues I cannot overcome, perhaps my limited Blender skills, perhaps a bug between Blender and B4W.

http://www.pestnoproblem.ca/x3d/hr111-moleTrap-test4out.blend

Two parts do not follow the animation as it is in Blender when exported to B4W, and I am unable to figure out why that is. They pivot around some point in B4W that they do not in Blender.
11 December 2014 22:39
Our guys are now preparing for this weekend CG conference, so this may be answered a bit later
The Founder | Twitter | Facebook | Linkedin
12 December 2014 03:33

Ответ на сообщение пользователя trepaning
<snip>
makes this page
http://www.pestnoproblem.ca/x3d/homeSentinel-b4w.html</snip>

Got it to work with proper timing of lights and the button moving when Pet Friendly button switched ON OFF.

http://www.pestnoproblem.ca/x3d/homeSentinel-b4w.html

Still wondering about the Mole trap pivot issue…
 
Please register or log in to leave a reply.