Tagged: detect animation play
- This topic has 6 replies, 3 voices, and was last updated 2 years, 4 months ago by kdv.
-
AuthorPosts
-
2022-07-28 at 2:53 pm #54462Corrado Lo Gatto LinkaroundCustomer
Hi all,
is there an easy way to detect if there is almost one application in playing?
I have a lot of animations and I don’t want to declare and check one by one.For me, the best solution should be something like:
if
is_animation_playing > any_object = true
do
…
end ifThank you very much
2022-07-28 at 3:27 pm #54463harisCustomer2022-07-28 at 5:22 pm #54466kdvParticipantto detect if there is almost one application in playing?
If your objects have only one animation and all animations have the same name as their objects then you can use this
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2022-07-29 at 9:35 am #54492Corrado Lo Gatto LinkaroundCustomerThank you Haris, I just did. Do you have a more specific solution?
—
Thank you Kdv77kdv, I have a lot of animations with different names. The project is quite complex. I just tried you solution without success. Please, can you provide me an insight about how to detect if one ore more animation playing in the scene?
2022-07-29 at 10:31 am #54495kdvParticipantI have a lot of animations with different names
and these names differ from the names of their objects? Then you should use scripting
function isAnimActive() { for (let j = 0; j < app.actions.length; j++) { if (app.actions[j].isRunning()) { return true; } } return false; } if (isAnimActive()) { console.log('at least one animation is active'); } else { console.log('all animations are stopped'); }
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2022-07-29 at 6:07 pm #54505Corrado Lo Gatto LinkaroundCustomerKdv77kdv, your help is very precious ad I think we are very close to the solution but the script return an error and the application doesn’t start.
I tryied to manage it connecting to different blocks but nothing.
And if I past in external .js it return an error, seems that
app.actions…
instruction is not recognized.I’m using the last version, Verge 4.1 with activated licence.
Could be the version the problem?
Is the syntax different?Thank you again
2022-07-29 at 6:45 pm #54506kdvParticipantAnd if I past in external .js it return an error
You cannot use the variable
app
in external scripts. This variable is declared in visual_logic.js only…The script above will work with no problems in the main section of puzzles, but will not in the init section.
p.s. I’ve just noticed that this forum breaks the script ))) It hides
i
in the square brackets. I’ve updated the script by replacingi
withj
in the loop ))) The screenshot is showing the correct variant )))Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
-
AuthorPosts
- You must be logged in to reply to this topic.