discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Is there a way to tell, if animation is activ runnning ?

JO
jjvb-openscad@bassklampfe.de
Wed, Apr 27, 2022 12:46 PM

I tried something like

if(is_num($t))
{
    translate([$t20,0,0])square(1);
}
else
{
    for(t=[0:0.1:1])
        translate([t
20,0,0])square(1);
}

but if animation is not started yet, $t is already 0
even worse, if animation is stopped, $t stays at the last value

(OpenSCAD version 2021.01)

I tried something like if(is_num($t)) {     translate([$t*20,0,0])square(1); } else {     for(t=[0:0.1:1])         translate([t*20,0,0])square(1); } but if animation is not started yet, $t is already 0 even worse, if animation is stopped, $t stays at the last value (OpenSCAD version 2021.01)
TP
Torsten Paul
Wed, Apr 27, 2022 1:05 PM

Yes, there's currently no way of knowing if animation is active.

There's probably more info that would be useful, e.g. see
https://github.com/openscad/openscad/issues/1573

It's not going to be $ variables, more likely something like

a = animation_state();

which could for example allow then

if (a.running) { ... }

ciao,
Torsten.

Yes, there's currently no way of knowing if animation is active. There's probably more info that would be useful, e.g. see https://github.com/openscad/openscad/issues/1573 It's not going to be $ variables, more likely something like a = animation_state(); which could for example allow then if (a.running) { ... } ciao, Torsten.