Getting The Control Effect Value

If this was your code-

Obj1.setControlEffect("Idle", 0.5);

How can you check later to see if the control effect for the “Idle” animation is still set to 0.5?

I guess technically I’m asking is there a way to retrieve the control effect value of an animation?

Hmm, I guess there should be an Actor.getControlEffect() to balance Actor.setControlEffect().

But in the meantime (assuming Obj1 is an Actor), you can get this by getting to the underlying AnimControl:

print Obj1.getAnimControl("Idle").getControlEffect()


libpanda.AnimControl object has no attribute getControlEffect

That’s what I got.

Oops, I omitted a step, sorry.

control = Obj1.getAnimControl("Idle")
print control.getPart().getControlEffect(control)


All those APIs like that really should be listed out in the manual under Actor or Animating. That’s a pretty common one, and a user will most likely need it at some point (at least for debugging).

I was able to solve an issue I was having, finally, because I was able to see the control effect per animation.

Sweet. :smiley:

I noticed something…

When setting the control effect to 0.0, That particular animation with the 0.0 setting will still have some influence on the Actor’s current animations. It seems like calling .stop() on the animation is the only way to have zero effect.

I’m wondering if 0.0 should be something like 0.00000000000000000000?

I’m guessing -1 would start a backward control effect (although I haven’t been able to get animations to play backward using negative values).

Hmm, that surprises me. Are you sure that you are setting the control effect to 0.0? I’m pretty sure that setting the control effect to 0.0 should completely eliminate any visible effect of a given animation, unless there are no remaining animations at all (in which case the actor will hold its previous pose).

Can you demonstrate this failing with a simple program?

I don’t know what effect setting the control effect to -1 would have. It’s technically undefined, so I’m not sure it would have the effect you want.