Skip to content

Attribute not updated when animated with .animate  #2324

Closed
@hydrobeam

Description

@hydrobeam

Description of bug / unexpected behavior

Mobject attributes are not updated when animated with .animate, but are successfully changed when done outside of animations

Expected behavior

The attribute should be updated.

How to reproduce the issue

class TS(Scene):
    def construct(self):
        c1 = Circle(fill_color=BLUE, fill_opacity=1)

        c1.set_stroke(PURPLE)
        # stroke is changed here, then becomes white 
        c1.set_stroke(WHITE)

        self.add(c1)
        self.play(c1.animate.set_stroke(color=RED)) # visually becomes red, but attribute does not match

        if c1.stroke_color == RED: # stroke_color  attr is `WHITE` not `RED`, so nothing is animated.
            a = Rectangle().to_edge(UP)
            self.play(DrawBorderThenFill(a))
        
        breakpoint()

Additional comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue:bugSomething isn't working... For use in issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions