
    ;i>6                        S SK r S SKJrJr  S SKJrJrJrJrJ	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 S\\5      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 S\\5      r " S  S!\\5      r " S" S#\\5      rS$ rS% rS& r\
\\\\\\\\\\\\\4rS' rS( rg))    N)OperatorPropertyGroup)StringPropertyIntPropertyEnumPropertyBoolPropertyCollectionPropertyc                   0    \ rS rSr% Sr\" SS1S9\S'   Srg)SelectionEntry    z	Bone NameLIBRARY_OVERRIDABLEnameoverrider   N)__name__
__module____qualname____firstlineno__	__slots__r   __annotations____static_attributes__r       h/home/wildlama/Downloads/blender-5.1.2-linux-x64/5.1/scripts/startup/bl_operators/bone_selection_sets.pyr   r      s    I
k5J4K
LLr   r   c                   ^    \ rS rSr% Sr\" SS1S9\S'   \" \SS1S9\S	'   \	" S
S1S9\S'   Sr
g)SelectionSet!   r   zSet Namer   r   r   USE_INSERTION)typer   bone_idsziInclude this selection set when copying to the clipboard. If none are specified, all sets will be copied.is_selectedN)r   r   r   r   r   r   r   r	   r   r   r   r   r   r   r   r   !   sJ    I
j4I3J
KK '9  :'( r   r   c                   (    \ rS rSrSr\S 5       rSrg)_PoseModeOnlyMixin2   zBOperator only available for objects of type armature in pose mode.c                     UR                   =(       a/    UR                   R                  S:H  =(       a    UR                  S:H  $ )NARMATUREPOSE)objectr   mode)clscontexts     r   poll_PoseModeOnlyMixin.poll4   s8     NN #NN:-#LLF"	
r   r   N)r   r   r   r   __doc__classmethodr,   r   r   r   r   r#   r#   2   s    L
 
r   r#   c                   6   ^  \ rS rSrSr\U 4S j5       rSrU =r$ )_NeedSelSetMixin=   zEOperator only available if the armature has a selected selection set.c                    > [         TU ]  U5      (       d  gUR                  nSUR                  s=:*  =(       a    [	        UR
                  5      :  $ s  $ )NFr   )superr,   r(   active_selection_setlenselection_setsr*   r+   arm	__class__s      r   r,   _NeedSelSetMixin.poll?   sH    w|G$$nnC,,FFs33E3E/FFFFFr   r   )	r   r   r   r   r.   r/   r,   r   __classcell__r:   s   @r   r1   r1   =   s    OG Gr   r1   c                   .    \ rS rSrSrSrSrSS1rS rSr	g	)
 POSE_OT_selection_set_delete_allG   zpose.selection_set_delete_allzDelete All Setsz,Remove all Selection Sets from this ArmatureUNDOREGISTERc                 T    UR                   nUR                  R                  5         S1$ NFINISHED)r(   r7   clear)selfr+   r9   s      r   execute(POSE_OT_selection_set_delete_all.executeM   s%    nn  "|r   r   N
r   r   r   r   	bl_idnamebl_labelbl_description
bl_optionsrH   r   r   r   r   r?   r?   G   s     /I HCN*%Jr   r?   c                   .    \ rS rSrSrSrSrSS1rS rSr	g	)
"POSE_OT_selection_set_remove_bonesS   zpose.selection_set_remove_bonesz#Remove Selected Bones from All Setsz1Remove the selected bones from all Selection SetsrA   rB   c                 $   UR                   nUR                   Hr  nUR                   H_  nUR                  UR                  ;   d  M  UR                  R                  UR                  5      nUR                  R                  U5        Ma     Mt     S1$ rD   )r(   selected_pose_bonesr7   r   r    findremove)rG   r+   r9   boneselsetidxs         r   rH   *POSE_OT_selection_set_remove_bones.executeY   sq    nn //D,,99/ //..tyy9COO**3/ - 0 |r   r   NrJ   r   r   r   rP   rP   S   s     1I4HHN*%J
r   rP   c                   n   ^  \ rS rSr% SrSrSrSS1r\" SSS	S
/SS1S9\	S'   \
U 4S j5       rS rSrU =r$ )POSE_OT_selection_set_movef   zpose.selection_set_movezMove Selection Set in Listz6Move the active Selection Set up/down the list of setsrA   rB   zMove Directionz@Direction to move the active Selection Set: UP (default) or DOWN)UPUp )DOWNDownr_      r]   HIDDEN)r   descriptionitemsdefaultoptions	directionc                 v   > [         TU ]  U5      (       d  gUR                  n[        UR                  5      S:  $ )NFrc   )r4   r,   r(   r6   r7   r8   s      r   r,   POSE_OT_selection_set_move.pollw   s4    w|G$$nn3%%&**r   c                     UR                   nUR                  nX0R                  S:X  a  SOS-   nUS:  d  U[        UR                  5      :  a  S1$ UR                  R                  X45        XBl        S1$ )Nr]   r`   rc   r   rE   )r(   r5   ri   r6   r7   move)rG   r+   r9   
active_idxnew_idxs        r   rH   "POSE_OT_selection_set_move.execute~   sn    nn--
nn&<!DQ;'S););%<<<
4#* |r   r   )r   r   r   r   rK   rL   rM   rN   r   r   r/   r,   rH   r   r<   r=   s   @r   r[   r[   f   sb    )I+HMN*%JV #
 
	 	 + + r   r[   c                   .    \ rS rSrSrSrSrSS1rS rSr	g	)
POSE_OT_selection_set_add   zpose.selection_set_addzCreate Selection Setz Create a new empty Selection SetrA   rB   c                     UR                   nUR                  nUR                  5       n[        SUR	                  5       5      Ul        [        U5      S-
  Ul        S1$ )Nr   rc   rE   )r(   r7   add_uniqifykeysr   r6   r5   )rG   r+   r9   sel_setsnew_sel_sets        r   rH   !POSE_OT_selection_set_add.execute   sQ    nn%%lln#NHMMOD $'x=1#4 |r   r   NrJ   r   r   r   rr   rr      s     (I%H7N*%J	r   rr   c                   .    \ rS rSrSrSrSrSS1rS rSr	g	)
POSE_OT_selection_set_remove   zpose.selection_set_removezDelete Selection Setz)Remove a Selection Set from this ArmaturerA   rB   c                     UR                   nUR                  R                  UR                  5        [	        UR                  5      nUR                  US-
  :  a#  US:  a  [	        UR                  5      S-
  Ul        S1$ )Nrc   r   rE   )r(   r7   rU   r5   r6   )rG   r+   r9   numsetss       r   rH   $POSE_OT_selection_set_remove.execute   so    nn!!#":":; c(()$$!41'*3+=+='>'BC$|r   r   NrJ   r   r   r   r|   r|      s     +I%H@N*%J
r   r|   c                   4    \ rS rSrSrSrSrSS1rS rS r	S	r
g
)POSE_OT_selection_set_assign   zpose.selection_set_assignzAdd Bones to Selection Setz#Add selected bones to Selection SetrA   rB   c                    UR                   nUR                  [        UR                  5      :  d+  [        R
                  R                  R                  SSS9  S1$ [        R
                  R                  R                  S5        S1$ )NINVOKE_DEFAULTPOSE_MT_selection_set_create)r   EXEC_DEFAULTrE   )
r(   r5   r6   r7   bpyopswm	call_menuposeselection_set_assign)rG   r+   _eventr9   s       r   invoke#POSE_OT_selection_set_assign.invoke   sk    nn((3s/A/A+BBGGJJ  !18V W | GGLL--n=|r   c                    UR                   nUR                  UR                     nUR                   HJ  nUR                  UR
                  ;  d  M  UR
                  R                  5       nUR                  Ul        ML     S1$ rD   )r(   r7   r5   rS   r   r    ru   )rG   r+   r9   act_sel_setrV   bone_ids         r   rH   $POSE_OT_selection_set_assign.execute   sn    nn(()A)AB //Dyy 4 44%..224#yy 0
 |r   r   N)r   r   r   r   rK   rL   rM   rN   r   rH   r   r   r   r   r   r      s%    +I+H:N*%J
r   r   c                   .    \ rS rSrSrSrSrSS1rS rSr	g	)
POSE_OT_selection_set_unassign   zpose.selection_set_unassignzRemove Bones from Selection Setz(Remove selected bones from Selection SetrA   rB   c                 0   UR                   nUR                  UR                     nUR                   H_  nUR                  UR
                  ;   d  M  UR
                  R                  UR                  5      nUR
                  R                  U5        Ma     S1$ rD   )r(   r7   r5   rS   r   r    rT   rU   )rG   r+   r9   r   rV   rX   s         r   rH   &POSE_OT_selection_set_unassign.execute   s}    nn(()A)AB //DyyK000!**//		:$$++C0 0
 |r   r   NrJ   r   r   r   r   r      s     -I0H?N*%J
r   r   c                   J    \ rS rSr% SrSrSrSS1r\" SSS	S
1S9\	S'   S r
Srg)POSE_OT_selection_set_select   zpose.selection_set_selectzSelect Selection Setz(Select the bones from this Selection SetrA   rB   zSelection Set Indexr`   z?Which Selection Set to select; -1 uses the active Selection Setrd   )r   rg   re   rh   selection_set_indexc                     UR                   nU R                  S:X  a  UR                  nOU R                  nUR                  U   nUR                   H&  nUR
                  UR                  ;   d  M  SUl        M(     S1$ )Nr`   TrE   )r(   r   r5   r7   visible_pose_bonesr   r    select)rG   r+   r9   rX   sel_setrV   s         r   rH   $POSE_OT_selection_set_select.execute   sr    nn##r)**C**C$$S)..DyyG,,," / |r   r   N)r   r   r   r   rK   rL   rM   rN   r   r   rH   r   r   r   r   r   r      s;    +I%H?N*%J$"U
	 r   r   c                   .    \ rS rSrSrSrSrSS1rS rSr	g	)
POSE_OT_selection_set_deselect   zpose.selection_set_deselectzDeselect Selection Setz1Remove Selection Set bones from current selectionrA   rB   c                     UR                   nUR                  UR                     nUR                   H&  nUR                  UR
                  ;   d  M  SUl        M(     S1$ )NFrE   )r(   r7   r5   rS   r   r    r   )rG   r+   r9   r   rV   s        r   rH   &POSE_OT_selection_set_deselect.execute  sT    nn(()A)AB//DyyK000# 0 |r   r   NrJ   r   r   r   r   r      s     -I'HHN*%Jr   r   c                   .    \ rS rSrSrSrSrSS1rS rSr	g	)
$POSE_OT_selection_set_add_and_assigni  z!pose.selection_set_add_and_assignz%Create and Add Bones to Selection Setz<Create a new Selection Set with the currently selected bonesrA   rB   c                     [         R                  R                  R                  S5        [         R                  R                  R	                  S5        S1$ )Nr   rE   )r   r   r   selection_set_addr   rG   r+   s     r   rH   ,POSE_OT_selection_set_add_and_assign.execute  s6    &&~6)).9|r   r   NrJ   r   r   r   r   r     s     3I6HSN*%Jr   r   c                   .    \ rS rSrSrSrSrSS1rS rSr	g	)
POSE_OT_selection_set_copyi  zpose.selection_set_copyzCopy Selection Set(s)z3Copy the selected Selection Set(s) to the clipboardrA   rB   c                 b    [        U5      UR                  l        U R                  S1S5        S1$ )NINFOz$Copied Selection Set(s) to clipboardrE   )_to_jsonwindow_manager	clipboardreportr   s     r   rH   "POSE_OT_selection_set_copy.execute"  s.    +3G+<(VHDE|r   r   NrJ   r   r   r   r   r     s     )I&HJN*%Jr   r   c                   .    \ rS rSrSrSrSrSS1rS rSr	g	)
POSE_OT_selection_set_pastei(  zpose.selection_set_pastezPaste Selection Set(s)z+Add new Selection Set(s) from the clipboardrA   rB   c                    SS K n [        XR                  R                  5        [	        UR
                  R                  5      S-
  UR
                  l        S1$ ! UR                  [        4 a    U R                  S1S5         S1$ f = f)Nr   rc   ERRORz.The clipboard does not contain a Selection SetrE   )json
_from_jsonr   r   r6   r(   r7   r5   JSONDecodeErrorKeyErrorr   )rG   r+   r   s      r   rH   #POSE_OT_selection_set_paste.execute.  s    	Yw 6 6 @ @A
 36gnn6S6S2TWX2XGNN/| $$h/ 	UKK	#ST
 |	Us   A )BBr   NrJ   r   r   r   r   r   (  s     *I'HBN*%Jr   r   c                    ^ ^ T U;  a  T $ [        T 5      S-   mU U4S jU 5       n[        S U 5       5      nSnU H  nXE:  a    O	US-   nM     SR                  T U5      $ )Nrc   c              3   d   >#    U  H%  nUR                  TS -   5      (       d  M  UTS v   M'     g7f).N)
startswith).0nr   offsets     r   	<genexpr>_uniqify.<locals>.<genexpr>\  s/      'q<<s
# 	&'
Ks   00c              3   f   #    U  H'  nUR                  5       (       d  M  [        U5      v   M)     g 7fN)isdigitint)r   suffixs     r   r   r   `  s(      "(>> 	F&s   11z{:s}.{:03d})r6   sortedformat)r   other_namesothersnumbers	min_indexnumr   s   `     @r   rv   rv   <  s    6 ; Y]F'F  "( G I?!G	  i00r   c                 P   SS K nU R                  nUR                  n0 n[        U R                  R                  5       HP  u  pVXS:X  d  UR
                  (       d  M  UR                   Vs/ s H  owR                  PM     nnXUR                  '   MR     UR                  U5      $ s  snf Nr   )	r   r(   r5   	enumerater7   r!   r    r   dumps)	r+   r   r9   rn   json_objrX   r   r   boness	            r   r   r   n  s     
..C))JH!'.."?"?@ 3 3 3181A1AB1Ag\\1AEB%*W\\" A
 ::h Cs   )B#c                 :   SS K nUR                  U5      nU R                  R                  nUR	                  5        H\  u  pVUR                  5       n[        XTR                  5       5      Ul        U H#  nUR                  R                  5       n	Xl        M%     M^     g r   )
r   loadsr(   r7   rf   ru   rv   rw   r   r    )
r+   as_jsonr   r   arm_sel_setsr   r   ry   	bone_namer   s
             r   r   r     s~    
 zz'"H>>00L~~'"&&(#D*;*;*=>I!**..0G$L  (r   c                      [        [        SSSS1S9[        R                  R                  l        [        SSSS1S	9[        R                  R                  l        g )
NzSelection Setsz*List of groups of bones for easy selectionr   r   )r   r   re   r   zActive Selection Setz+Index of the currently active selection setr   )r   re   rg   r   )r	   r   r   typesObjectr7   r   r5   r   r   r   registerr     sR    &8@'9	'CII# -8#A'(	-CII)r   c                  l    [         R                  R                  ?[         R                  R                  ?g r   )r   r   r   r7   r5   r   r   r   
unregisterr     s"    		'		-r   ) r   	bpy.typesr   r   	bpy.propsr   r   r   r   r	   r   r   r#   r1   r?   rP   r[   rr   r|   r   r   r   r   r   r   r   rv   r   r   classesr   r   r   r   r   <module>r      sN  
   M] M= "
 
G) G	'98 	);X &$!18 $N 2H $#3X &#5x :%5x &#3X :%5x "	+=x 		!18 	"4h (/1d ,%* $&  " "($.r   