
    i<                     :   S SK r S SKJrJr  S SKJrJrJr  S SKJ	r
  S r " S S\5      r " S S	\5      r " S
 S\5      r " S S\5      r " S S\5      r " S S5      rS r " S S5      r " S S\\5      r " S S\\5      r " S S\\5      r\\\\\\\\4rg)    N)FileHandlerOperator)EnumPropertyFloatPropertyIntProperty)pgettext_rptc                     / n[        U S5      (       a  UR                  S5        [        U S5      (       a  UR                  S5        U$ )Nvolumeblend_alpha)hasattrappend)stripanimated_propertiess     ^/home/wildlama/Downloads/blender-5.1.2-linux-x64/5.1/scripts/startup/bl_operators/sequencer.py_animated_properties_getr      sD    uh""8,um$$""=1    c                   >    \ rS rSrSrSrSrSS1r\S 5       r	S r
S	rg
)SequencerCrossfadeSounds   z=Do cross-fading volume animation of two selected sound stripszsequencer.crossfade_soundszCrossfade SoundsREGISTERUNDOc                 r    UR                   nU(       d  gUR                  nU=(       a    UR                  S:H  $ )NFSOUNDsequencer_sceneactive_striptypeclscontextr   r   s       r   pollSequencerCrossfadeSounds.poll#   s2    !11$$0%**/0r   c                    UR                   nS nS nUR                  R                   H8  nUR                  (       d  M  UR                  S:X  d  M(  Uc  UnM/  Uc  UnM6  S n  O   Uc  U R                  S1S5        S1$ UR                  UR                  :  a  XCpCUR                  UR                  :  ay  UR                  SUR                  S9  SUl	        UR                  SUR                  S9  UR                  SUR                  S9  SUl	        UR                  SUR                  S9  S1$ U R                  S1S	5        S1$ )
Nr   ERRORzSelect 2 sound strips	CANCELLEDr
   )framer   FINISHEDz!The selected strips don't overlap)
r   sequence_editorstripsselectr   reportframe_final_startframe_final_endkeyframe_insertr
   )selfr    scenestrip1strip2r   s         r   execute SequencerCrossfadeSounds.execute+   s=   ''**11E|||

g 5>"F^"F!F 2 >KK	#:;= ##f&>&>>#F!!F$<$<<""863K3K"LFM""863I3I"J""863I3I"JFM""863K3K"L<WIBC}r    N__name__
__module____qualname____firstlineno____doc__	bl_idnamebl_label
bl_optionsclassmethodr!   r3   __static_attributes__r5   r   r   r   r      s0    G,I!Hf%J1 1r   r   c            	       \    \ rS rSr% SrSrSrSS1r\" SSS	SS	SS
9\	S'   \
S 5       rS rSrg)SequencerSplitMulticamJ   z&Split multicam strip and select camerazsequencer.split_multicamzSplit Multicamr   r   Camera       )nameminmaxsoft_minsoft_maxdefaultcamerac                 r    UR                   nU(       d  gUR                  nU=(       a    UR                  S:H  $ )NFMULTICAMr   r   s       r   r!   SequencerSplitMulticam.pollX   s2    !11$$3%**
23r   c                 6   UR                   nU R                  nUR                  nUR                  U:X  d  X4R                  :  a  S1$ UR
                  nUR                  USS9nU(       a  SUl        SUl        XbR                  l        X1R                  l        S1$ )Nr'   SOFT)r&   split_methodFT)	r   rM   r   multicam_sourcechannelframe_currentsplitr*   r(   )r/   r    r0   rM   r   cfraright_strips          r   r3   SequencerSplitMulticam.execute`   s    ''$$  F*f.E<""kk6kB EL!%K1<!!./5,|r   r5   N)r7   r8   r9   r:   r;   r<   r=   r>   r   __annotations__r?   r!   r3   r@   r5   r   r   rB   rB   J   sO    0*IHf%J2R	  4 4r   rB   c                   >    \ rS rSrSrSrSrSS1r\S 5       r	S r
S	rg
)"SequencerDeinterlaceSelectedMoviesu   z&Deinterlace all selected movie sourcesz%sequencer.deinterlace_selected_movieszDeinterlace Moviesr   r   c                 D    UR                   nU=(       a    UR                  $ N)r   r(   )r   r    r0   s      r   r!   'SequencerDeinterlaceSelectedMovies.poll|   s    ''/%//0r   c                     UR                   nUR                  R                   H/  nUR                  (       d  M  UR                  S:X  d  M(  SUl        M1     S1$ )NMOVIETr'   )r   r(   r)   r*   r   use_deinterlace)r/   r    r0   r   s       r   r3   *SequencerDeinterlaceSelectedMovies.execute   sI    ''**11E|||

g 5(,% 2 |r   r5   Nr6   r5   r   r   r]   r]   u   s0    07I#Hf%J1 1r   r]   c                   >    \ rS rSrSrSrSrSS1r\S 5       r	S r
S	rg
)SequencerFadesClear   z+Removes fade animation from selected stripszsequencer.fades_clearzClear Fadesr   r   c                 J    UR                   nU(       d  gUR                  nUS L$ NFr   r   r   s       r   r!   SequencerFadesClear.poll   s)    !11$$D  r   c                 J   SSK Jn  UR                  nUR                  nUc  S1$ UR	                  UR
                  UR                  5      nUc  S1$ UR                  nU Vs0 s H2  nUR                  R                  S5      (       d  M%  UR                  U_M4     nnUR                   Hq  n	[        U	5       HN  n
U	R                  5       S-   U
-   nUR                  U5      nU(       a  UR                  U5        [        XS5        MP     U	R!                  S5        Ms     S1$ s  snf )	Nr   )
anim_utilsr%   zsequence_editor.strips.      ?	COMPOSITEr'   )
bpy_extrasrn   r   animation_dataaction_get_channelbag_for_slotactionaction_slotfcurves	data_path
startswithselected_stripsr   path_from_idgetremovesetattrinvalidate_cache)r/   r    rn   r0   rs   
channelbagrw   curve
fcurve_mapr   animated_propertyrx   s               r   r3   SequencerFadesClear.execute   s#   )''--!= >>~?T?TVdVpVpq
= $$ !
 ))*BC #EOOU"  	 

 ,,E%=e%D!!..0369JJ	"y1NN5)#6 &E "";/ - |
s   !$D 	D r5   Nr6   r5   r   r   rg   rg      s0    5'IHf%J! !r   rg   c                       \ rS rSr% SrSrSrSS1r\" SSS	S
S9\	S'   \
" SSSSS9\	S'   \S 5       rS rS rSS jrS rS rS rS rSrg)SequencerFadesAdd   zBAdds or updates a fade animation for either visual or audio stripszsequencer.fades_addz	Add Fadesr   r   zFade DurationzDuration of the fade in secondsrp   g{Gz?)rG   descriptionrL   rH   duration_seconds))IN_OUTzFade In and OutzFade selected strips in and out)INzFade InzFade in selected strips)OUTzFade OutzFade out selected strips)CURSOR_FROMzFrom Current Framez:Fade from the time cursor to the end of overlapping strips)	CURSOR_TOzTo Current FramezHFade from the start of strips under the time cursor to the current framez	Fade TypezXFade in, out, both in and out, to, or from the current frame. Default is both in and outr   )itemsrG   r   rL   r   c                 J    UR                   nU(       d  gUR                  nUS L$ rj   rk   r   s       r   r!   SequencerFadesAdd.poll   s)    !11$$D  r   c                    SSK Jn  UR                  nUR                  (       d  UR	                  5         UR                  R
                  (       dF  [        R                  R                  R                  UR                  S-   5      nXCR                  l        UR                  nU(       d  U R                  S1S5        S1$ U R                  S;   a`  U Vs/ s H6  nUR                  UR                  s=:  a  UR                   :  d  M0  O  M4  UPM8     nnU(       d  U R                  S1S5        S1$ [#        US	 S
9R$                  nU R                  S:X  a  U" US-  5      OUn/ nU H  nU R'                  X5      n	[#        X5      n	U R)                  Xi5      (       d  M7  [+        U5       HI  n
U R-                  XU
5      nU R/                  XkX5      nU R1                  X5        U R3                  X5        MK     UR5                  U5        UR7                  S5        M     [9        U5      S:X  a  SOSnU R                  S1[;        S5      R=                  [9        U5      U5      5        S1$ s  snf )Nr   )floorActionr$   zNo strips selectedr%   >   r   r   z)Current frame not within strip framerangec                     U R                   $ r`   )frame_final_duration)r   s    r   <lambda>+SequencerFadesAdd.execute.<locals>.<lambda>   s
    U5O5Or   )keyr   g       @rq   rE   r   r)   INFOz!Added fade animation to {:d} {:s}r'   )mathr   r   rs   animation_data_createru   bpydataactionsnewrG   rz   r+   r   r,   rV   r-   rH   r   calculate_fade_durationis_long_enoughr   fade_find_or_create_fcurvecalculate_fadesfade_animation_clearfade_animation_creater   r   lenrpt_format)r/   r    r   r0   ru   r)   r   max_durationfaded_stripsdurationr   fade_fcurvefadesstrip_strings                 r   r3   SequencerFadesAdd.execute   s&    ''##'')##**XX%%))%**x*?@F*0  '((KK	#78= 9944#)#)%**U-@-@X5CXCXX X 6   WI'RS#}$6'OPee48II4Iu\C/0|E33GCH82H&&u77%=e%D!"==gN_`,,UAR]))+=**;>	 &E
 &"";/  #&l"3q"8whVHd#FGNNsS_O`bnop|9s   /I$I$	I$c                    UR                   nUR                  nSnU R                  S:X  a  [        XBR                  -
  5      nO>U R                  S:X  a  [        UR
                  U-
  5      nO[        X0R                  5      n[        SU5      $ )N        r   r   rE   )	r   rV   r   absr,   r-   calculate_duration_framesr   rI   )r/   r    r   r0   rV   r   s         r   r   )SequencerFadesAdd.calculate_fade_duration  sz    ''++99#=+B+BBCHYY-'500=@AH08M8MNH1hr   c                 N    U R                   S:X  a  US-  OUnUR                  U:  $ )Nr      )r   r   )r/   r   r   minimum_durations       r   r    SequencerFadesAdd.is_long_enough  s+    +/99+@8a<h))-===r   c                     / nU R                   S;   a  [        XSX45      nUR                  U5        U R                   S;   a  [        XSX45      nUR                  U5        U$ )z 
Returns a list of Fade objects
>   r   r   r   r   >   r   r   r   r   )r   Fader   )r/   r   r   r   r   r   fades          r   r   !SequencerFadesAdd.calculate_fades  s^     9955D2CNDLL9988E3DODLLr   c                     UR                   nUR                  R                  nUR                  U5      nUR	                  XF5      $ )z
Iterates over all the fcurves until it finds an fcurve with a data path
that corresponds to the strip.
Returns the matching FCurve or creates a new one if the function can't find a match.
)r   rs   ru   r{   fcurve_ensure_for_datablock)r/   r    r   r   r0   ru   searched_data_paths          r   r   ,SequencerFadesAdd.fade_find_or_create_fcurve%  sC     ''%%,,"//0AB11%LLr   c                 4   UR                   nU Hu  nU H\  n UR                  R                  UR                  S   s=:  a  UR                  R                  ::  a  O  MJ  UR                  USS9  M\  M^     UR                  5         Mw     g! [         a     M  f = f)z`
Removes existing keyframes in the fades' time range, in fast mode, without
updating the fcurve
r   T)fastN)keyframe_pointsstartxcoendr}   	Exceptionupdate)r/   r   r   r   r   keyframes         r   r   &SequencerFadesAdd.fade_animation_clear0  s    
 &55D+zz||hkk!nB

B'..xd.C C	 ,    ! s   AB	B		
BBc                    UR                   nU HH  nUR                  UR                  4 H)  nUR                  UR                  UR
                  S1S9  M+     MJ     UR                  5         US   R                  US   l        g)z
Inserts keyframes in the fade_fcurve in fast mode using the Fade objects.
Updates the fcurve after having inserted all keyframes to finish the animation.
FAST)r&   valueoptionsN)r   r   r   insertr   yr   r   )r/   r   r   r   r   points         r   r   'SequencerFadesAdd.fade_animation_createA  su    
 &55D**dhh/&&UWWEGGfX&V 0  	!0!4!7!7r   r5   N)r   )r7   r8   r9   r:   r;   r<   r=   r>   r   r[   r   r?   r!   r3   r   r   r   r   r   r   r@   r5   r   r   r   r      s    L%IHf%J#5	  
 n  ! !.`
 >	M!"8r   r   c                   *    \ rS rSrSrS rS rS rSrg)r   iO  )r   r   r   	max_valuer   r   c                    SSK Jn  X0l        X@l        XPl        U R                  X5      U l        US:X  aJ  U" UR                  S45      U l        U" UR                  U R                  -   U R                  45      U l	        g US:X  aJ  U" UR                  U R                  -
  U R                  45      U l        U" UR                  S45      U l	        g g )Nr   )Vectorr   r   r   )	mathutilsr   r   r   r   calculate_max_valuer   r,   r   r   r-   )r/   r   r   tyr   r   r   s          r   __init__Fade.__init__Z  s    $	!2 11%E:!8!8# >?DJu66FWXDH5[!6!6!F WXDJu44c:;DH r   c                   ^^ SnUR                   (       d  [        XR                  S5      nOU R                  S:X  a/  UR                  U R
                  -   mU4S jUR                    5       nU R                  S:X  a8  UR                  U R
                  -
  mU4S j[        UR                   5       5       n [        W5      R                  S   nUS:  a  U$ S$ ! [         a     Nf = f)z
Returns the maximum Y coordinate the fade animation should use for a given strip
Uses either the strip's value for the animated property, or the next keyframe after the fade
r   rp   r   c              3   P   >#    U  H  oR                   S    T:  d  M  Uv   M     g7fr   Nr   ).0kfade_ends     r   	<genexpr>+Fade.calculate_max_value.<locals>.<genexpr>t  s#     [(C1ttAwRZGZQQ(C   &	&r   c              3   P   >#    U  H  oR                   S    T::  d  M  Uv   M     g7fr   r   )r   r   
fade_starts     r   r   r   w  s'     g(M1QUQUVWQX\fQfQQ(Mr   rE   )r   getattrr   r   r,   r   r-   reversednextr   StopIteration)r/   r   r   r   	keyframesr   r   s        @@r   r   Fade.calculate_max_valueh  s    
 	**'='=sCIyyD  22T]]B[(C(C[	yyE!"22T]]B
g1L1L(Mg	 O..q1	 &Oy44 ! s   5C 
C$#C$c                 d    SR                  U R                  U R                  U R                  5      $ )NzFade {!r}: {!r} to {!r})r   r   r   r   )r/   s    r   __repr__Fade.__repr__  s#    (//		4::txxPPr   )r   r   r   r   r   r   N)	r7   r8   r9   r:   	__slots__r   r   r   r@   r5   r   r   r   r   O  s    I<5.Qr   r   c                 r    [        XR                  R                  -  U R                  R                  -  5      $ r`   )roundrenderfpsfps_base)r0   r   s     r   r   r     s*    !LL$4$44u||7L7LLMMr   c                   $    \ rS rSr\S 5       rSrg)SequencerFileHandlerBasei  c                     UR                   S L=(       aN    UR                   R                  S:H  =(       a.    UR                  S L=(       a    UR                  R                  S:H  $ )NWINDOWSEQUENCE_EDITOR)regionr   areaui_type)r   r    s     r   	poll_drop"SequencerFileHandlerBase.poll_drop  sW     ^^4' 8^^  H,8\\%8 \\!!%66		
r   r5   N)r7   r8   r9   r:   r?   r  r@   r5   r   r   r   r     s    
 
r   r   c                   j    \ rS rSrS rSrSrSR                  \R                  R                  5      rSrg)SEQUENCER_FH_image_stripi  zImage stripSEQUENCER_OT_image_strip_add;r5   N)r7   r8   r9   r:   r<   r=   bl_import_operatorjoinr   pathextensions_imagebl_file_extensionsr@   r5   r   r   r  r    +    *IH7#((";";<r   r  c                   j    \ rS rSrS rSrSrSR                  \R                  R                  5      rSrg)SEQUENCER_FH_movie_stripi  zMovie stripSEQUENCER_OT_movie_strip_addr  r5   N)r7   r8   r9   r:   r<   r=   r  r	  r   r
  extensions_movier  r@   r5   r   r   r  r    r  r   r  c                   j    \ rS rSrS rSrSrSR                  \R                  R                  5      rSrg)SEQUENCER_FH_sound_stripi  zSound stripSEQUENCER_OT_sound_strip_addr  r5   N)r7   r8   r9   r:   r<   r=   r  r	  r   r
  extensions_audior  r@   r5   r   r   r  r    r  r   r  )r   	bpy.typesr   r   	bpy.propsr   r   r   bpy.app.translationsr   r   r   r   rB   r]   rg   r   r   r   r   r  r  r  classesr5   r   r   <module>r     s   
 
 
 6+x +\(X (V *'( 'TX8 X8v1Q 1QhN
 
={,D =={,D =={,D = &
r   