
    lj                    t    d dl mZ d dlmZ d dlmZmZ ddlmZm	Z	 ddl
mZ dgZerd dlmZ d d	lmZ ddZdS )    )annotations)Callable)TYPE_CHECKINGAny   )configlogger)get_hash_from_play_callhandle_caching_play)OpenGLRenderer)ScenefuncCallable[..., None]returnc                     d fd
}|S )a  Decorator that returns a wrapped version of func that will compute
    the hash of the play invocation.

    The returned function will act according to the computed hash: either skip
    the animation because it's already cached, or let the invoked function
    play normally.

    Parameters
    ----------
    func
        The play like function that has to be written to the video file stream.
        Take the same parameters as `scene.play`.
    selfr   scener   argsr   kwargsr   Nonec           	     ,   | j         | _        |                                   |j        |i |}|                    |           | j        r_t          j        d| j                     | |g|R i | | j        	                    d            | j
                            d            d S t          d         s`|j        }t          || j        ||          }| j
                            |          r't          j        d| j         dd|i           d| _        nd| j        d}| j        	                    |           | j
                            |           t          j        d	d
t%          | j        d d                   i            | |g|R i | d S )NzSkipping animation disable_cachingz
Animation z+ : Using cached data (hash : %(hash_play)s)	hash_playT	uncached_05z:List of the first few animation hashes of the scene: %(h)sh   )_original_skipping_statusskip_animationsupdate_skipping_statuscompile_animationsadd_mobjects_from_animationsr	   debug	num_playsanimations_hashesappendfile_writeradd_partial_movie_filer   mobjectsr
   camerais_already_cachedinfostr)r   r   r   r   
animationsmobjects_on_scener   r   s          N/home/agentuser/manim-venv/lib/python3.11/site-packages/manim/utils/caching.pywrapperz$handle_caching_play.<locals>.wrapper$   s   #=##%%%-U-t>v>>
**:666 	L?t~??@@@Du.t...v... "))$///33D999F'( 	8 %/!	 I 11)<< ,\\\\ ),   (,$7DN777I%%i000//	:::H#d,RaR0112	
 	
 	
 	T5*4***6*****    )
r   r   r   r   r   r   r   r   r   r    )r   r1   s   ` r0   r   r      s)    (#+ #+ #+ #+ #+ #+J Nr2   N)r   r   r   r   )
__future__r   collections.abcr   typingr   r    r   r	   utils.hashingr
   __all__manim.renderer.opengl_rendererr   manim.scene.scener   r   r3   r2   r0   <module>r<      s    " " " " " " $ $ $ $ $ $ % % % % % % % %         3 3 3 3 3 3 
! (======''''''9 9 9 9 9 9r2   