
    
Wi@                       S SK Jr  S SKrS SKJr  S SKJrJrJrJ	r	  S SK
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 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\\\\\\\\\\\\\4rg)#    )annotationsN)Operator)IntPropertyBoolPropertyEnumPropertyStringProperty)pgettext_rptcontextsc                  V    \ rS rSr% SrSrSrS\S'   S\S'   S	\S
'   S\S'   S rS r	Sr
g)ANIM_OT_keying_set_export   z$Export Keying Set to a Python scriptzanim.keying_set_exportzExport Keying Set...z#StringProperty(subtype='FILE_PATH')filepathzEBoolProperty(name='Filter folders', default=True, options={'HIDDEN'})filter_folderzBBoolProperty(name='Filter text', default=True, options={'HIDDEN'})filter_textzDBoolProperty(name='Filter Python', default=True, options={'HIDDEN'})filter_pythonc           	     X   SSK Jn  U R                  (       d  [        S5      e[	        U R                  SSS9nU(       d  [        S5      eUR
                  nUR                  R                  nUR                  SR                  UR                  5      5        UR                  S	5        UR                  S
5        UR                  S5        UR                  SR                  UR                  UR                  5      5        UR                  SR                  UR                  5      5        UR                  S5        UR                  SR                  UR                  5      5        UR                  SR                  UR                  5      5        UR                  S5        0 nUR                   GH  nUR                   c  M  UR                   U;   a  M%  UR                   R"                  R$                  R'                  S5      (       Ga  SnSn	[(        R*                  R,                   HB  n
U
R.                  UR                   :X  d  M  SR                  U" U
R0                  5      5      nSn	  O   U	(       d`  [(        R*                  R2                   HB  nUR.                  UR                   :X  d  M  SR                  U" UR0                  5      5      nSn	  O   U	(       d>  U R5                  S1[7        S5      R                  [9        UR                   5      5      5        GO}UR                   R"                  R$                  R'                  S5      (       a  [(        R*                  R:                   H@  nUR<                  UR                   :X  d  M  SR                  U" UR0                  5      5      n  O   U R5                  S1[7        S5      R                  [9        UR                   5      5      5        OUR                   R"                  R0                  S:X  a,  SR                  U" UR                   R0                  5      5      nO\UR                   R"                  R0                  R?                  5       S-   nSR                  X" UR                   R0                  5      5      nS R                  [A        U5      5      nUW/XgR                   '   GM     UR                  S!5        URC                  5        H*  nUR                  S"R                  US   US#   5      5        M,     UR                  S5        UR                  S$5        UR                   GHB  nUR                  S%5        UR                   (       a  XgR                      S   nOS&nUR                  S'R                  XRD                  5      5        URF                  (       a  UR                  S(5        O*UR                  S)R                  URH                  5      5        URJ                  S*:X  a6  UR                  S+R                  URJ                  URL                  5      5        O:URJ                  S,:w  a*  UR                  S-R                  URJ                  5      5        UR                  S.5        GME     UR                  S5        URO                  5         S/1$ )0Nr   )escape_identifierzFilepath not setwutf8)encodingzCould not open filez# Keying Set: {:s}
zimport bpy

zscene = bpy.context.scene

z # Keying Set Level declarations
z3ks = scene.keying_sets.new(idname={!r}, name={!r})
zks.bl_description = {!r}

zks.use_insertkey_needed = {!r}
zks.use_insertkey_visual = {!r}
ShaderNodeTreezbpy.data.nodes["{:s}"]Fz$bpy.data.materials["{:s}"].node_treeTz!bpy.data.lights["{:s}"].node_treeWARNINGz>Could not find material or light using Shader Node Tree - {:s}CompositorNodeTreez.bpy.data.scenes["{:s}"].compositing_node_groupz6Could not find scene using Compositor Node Tree - {:s}Keyzbpy.data.shape_keys["{:s}"]szbpy.data.{:s}["{:s}"]zid_{:d}z# ID's that are commonly used
z{:s} = {:s}
   z# Path Definitions
zksp = ks.paths.add(Nonez
{:s}, {!r}z
, index=-1z, index={:d}NAMEDz$, group_method={!r}, group_name={!r}	KEYINGSETz, group_method={!r}z)
FINISHED)(	bpy.utilsr   r   	Exceptionopenscenekeying_setsactivewriteformat	bl_idnamebl_labelbl_descriptionuse_insertkey_neededuse_insertkey_visualpathsidbl_rna
identifier
startswithbpydata	materials	node_treenamelightsreportrpt_strscenescompositing_node_grouplowerlenvalues	data_pathuse_entire_arrayarray_indexgroup_methodgroupclose)selfcontextr   fr%   ksid_to_paths_cachekspid_bpy_pathfoundmatlightidtype_listshort_idid_pairs                  Y/home/wildlama/Downloads/blender-5.1.2-linux-x64/5.1/scripts/startup/bl_operators/anim.pyexecute!ANIM_OT_keying_set_export.execute.   s   /}}.//f5122%%	&--bll;<	 !	/0 	
34	FMMbll\^\g\ghi	,33B4E4EFG
 	
	299":Q:QRS	299":Q:QRS	 88Cvv~vv** vv}}''223CDD888--C}}.&N&U&UVghkhphpVq&r $	 . !$ ??cff4*O*V*VWhinisisWt*uK$(E!	 "1 KK"]^eefijmjpjpfqr ))445IJJ XX__E33svv=&X&_&_-ejj9';	 - KK"UV]]^abebhbh^ij ##u,=DDEVWZW]W]WbWbEcd!ffmm006683>7>>{L]^a^d^d^i^iLjk !'',=(>?H *2;(?ff%w z 	
12(//1GGGO**71:wqzBC 2	 	
&'88CGG)* vv/7:$GGL'']]CD ##%--coo>?
 7*>EEcFVFVX[XaXabc!![0-44S5E5EFG GGEN5 8 	
		|    c                B    UR                   nUR                  U 5        S1$ )NRUNNING_MODAL)window_managerfileselect_add)rH   rI   _eventwms       rU   invoke ANIM_OT_keying_set_export.invoke   s$    ##
$  rX    N)__name__
__module____qualname____firstlineno____doc__r*   r+   __annotations__rV   r_   __static_attributes__ra   rX   rU   r   r      sC    .(I%H  
 
 IV!rX   r   c                      \ rS rSr% SrSrSrSS1rS\S'   S	\S
'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S\S'   S r	S r
Srg )!NLA_OT_bake   zHBake all selected objects location/scale/rotation animation to an actionznla.bakezBake ActionREGISTERUNDOzcIntProperty(name='Start Frame', description='Start frame for baking', min=0, max=300000, default=1)frame_startzaIntProperty(name='End Frame', description='End frame for baking', min=1, max=300000, default=250)	frame_endzIntProperty(name='Frame Step', description='Number of frames to skip forward while baking each frame', min=1, max=120, default=1)stepzpBoolProperty(name='Only Selected Bones', description='Only key selected bones (Pose baking only)', default=True)only_selectedzBoolProperty(name='Visual Keying', description='Keyframe from the final transformations (with constraints applied)', default=False)visual_keyingzBoolProperty(name='Clear Local Constraints', description='Remove all constraints from keyed object/bones. To get a correct bake with this setting Visual Keying should be enabled', default=False)clear_constraintszBoolProperty(name='Clear Parents', description='Bake animation onto the object then clear parents (objects only)', default=False)clear_parentszBoolProperty(name='Overwrite Current Action', description='Bake animation into current action, instead of creating a new one (useful for baking only part of bones in an armature)', default=False)use_current_actionzjBoolProperty(name='Clean Curves', description='After baking curves, remove redundant keys', default=False)clean_curvesa  EnumProperty(name='Bake Data', translation_context=i18n_contexts.id_action, description="Which data's transformations to bake", options={'ENUM_FLAG'}, items=(('POSE', 'Pose', 'Bake bones transformations'), ('OBJECT', 'Object', 'Bake object transformations')), default={'POSE'})
bake_typesa  EnumProperty(name='Channels', description='Which channels to bake', options={'ENUM_FLAG'}, items=(('LOCATION', 'Location', 'Bake location channels'), ('ROTATION', 'Rotation', 'Bake rotation channels'), ('SCALE', 'Scale', 'Bake scale channels'), ('BBONE', 'B-Bone', 'Bake B-Bone channels'), ('PROPS', 'Custom Properties', 'Bake custom properties')), default={'LOCATION', 'ROTATION', 'SCALE', 'BBONE', 'PROPS'})channel_typesc                   SSK Jn  UR                  U R                  SU R                  ;   SU R                  ;   U R
                  U R                  U R                  U R                  SU R                  ;   SU R                  ;   SU R                  ;   SU R                  ;   S	U R                  ;   S
9nUR                  (       aM  U R                  (       a<  UR                  =(       d    / nU Vs1 s H  oUR                  iM     nn[        U5      nOxUR                  nUR                  (       a[  UR                  (       dJ  [!        USS 5      nU(       a  X;  a  UR#                  U5        U V	s/ s H  oR$                  c  M  U	PM     nn	U R&                  (       a)  U V	s/ s H  o[!        U	R(                  SS 5      4PM     sn	OU V	s/ s H  oS 4PM     sn	n
UR+                  U
[-        U R.                  U R0                  S-   U R2                  5      US9n[5        U5      (       d  U R7                  S1S5        S1$ S1$ s  snf s  sn	f s  sn	f s  sn	f )Nr   
anim_utilsPOSEOBJECTLOCATIONROTATIONSCALEBBONEPROPS)rq   do_pose	do_objectdo_visual_keyingdo_constraint_cleardo_parents_cleardo_cleando_locationdo_rotationdo_scaledo_bbonedo_custom_propspose_objectactionr   )framesbake_optionsINFOzNothing to bake	CANCELLEDr!   )
bpy_extrasr{   BakeOptionsrq   rw   rr   rs   rt   rv   rx   r   selected_pose_bonesid_datalistselected_editable_objectsr   getattrappendposeru   animation_databake_action_objectsrangern   ro   rp   anyr:   )rH   rI   r{   r   
pose_bones	pose_bone	armaturesobjectsr   objobject_action_pairsactionss               rU   rV   NLA_OT_bake.execute  s
   )!--,,doo-$//1!// $ 6 6!//&&"d&8&88"d&8&88 2 22 2 22#t'9'99 . 
 D$6$6 44:J<FGJy**JIG9oG77G##L,B,B%g}dC;#= NN;/*1J'3XX3'J && LSS7C73--x>?7S$+,GS4[G, 	 00))4>>A+=tyyI% 1 
 7||KK"34= |9 H K T,s   )H8(H=<H="IIc                6   UR                   nUR                  (       a#  UR                  U l        UR                  U l        O"UR                  U l        UR
                  U l        UR                  S:X  a  S1OS1U l        UR                  nUR                  U 5      $ )Nr|   r}   )
r%   use_preview_rangeframe_preview_startrn   frame_preview_endro   moderw   r[   invoke_props_dialog)rH   rI   r]   r%   r^   s        rU   r_   NLA_OT_bake.invokeD  s|    ""$88D"44DN$00D"__DN&-llf&<6(8*##%%d++rX   )rw   ro   rn   N)rb   rc   rd   re   rf   r*   r+   
bl_optionsrg   rV   r_   rh   ra   rX   rU   rj   rj      s    RIHf%J    
 
  
  

 
 0d,rX   rj   c                  ^    \ rS rSr% SrSrSrSS1rS\S'   \	S	 5       r
\SS
 j5       rS rSrg)ClearUselessActionsiR  zfMark actions with no F-Curves for deletion after save and reload of file preserving "action libraries"zanim.clear_useless_actionszClear Useless Actionsrl   rm   zqBoolProperty(name='Only Unused', description='Only unused (Fake User only) actions get considered', default=True)only_unusedc                H    [        [        R                  R                  5      $ N)boolr4   r5   r   )cls_contexts     rU   pollClearUselessActions.poll_  s    CHH$$%%rX   c                    U R                    HP  nUR                   H=  nUR                  S:X  d   eUR                   H  nUR                  (       d  M        g   M?     MR     g)NKEYFRAMETF)layersstripstypechannelbagsfcurves)r   layerstrip
channelbags       rU   has_fcurvesClearUselessActions.has_fcurvesc  sT    ]]EzzZ///"'"3"3J!)))# #4 & # rX   c                f   Sn[         R                  R                   Hd  nU R                  SL d%  UR                  (       d  M%  UR
                  S:X  d  M7  U R                  U5      (       a  MO  UR                  5         US-  nMf     U R                  S1[        S5      R                  U5      5        S1$ )Nr   Fr   r   z0Removed {:d} empty and/or fake-user only Actionsr!   )r4   r5   r   r   use_fake_userusersr   
user_clearr:   r;   r)   )rH   r   removedr   s       rU   rV   ClearUselessActions.executem  s    hh&&F !!U*%%%&,,!*; ''//%%'qLG ' 	VHd#UV]]^efg|rX   ra   N)r   zbpy.types.Actionreturnr   )rb   rc   rd   re   rf   r*   r+   r   rg   classmethodr   staticmethodr   rV   rh   ra   rX   rU   r   r   R  sR    3,I&Hf%J  & &  rX   r   c                  :    \ rS rSr% SrSrSrSS1rS\S'   S	 r	S
r
g)!UpdateAnimatedTransformConstrainti  zaUpdate f-curves/drivers affecting Transform constraints (use it with files from 2.70 and earlier)z*anim.update_animated_transform_constraintsz%Update Animated Transform Constraintsrl   rm   zBoolProperty(name='Convert to Radians', description='Convert f-curves/drivers affecting rotations to radians.\nWarning: Use this only once', default=True)use_convert_to_radiansc                b  ^^ SS K nSSKJm  SS Kn1 Skm1 SknTU-  nUU4S jnSU R                  0nU Vs/ s H  nSXU4PM
     n	nUR                  5       n
UR                  X5        UR                  R                  UR                  R                  5        U
R                  5       n
U
(       az  [        U
5        [        R                  R                  R                  S5      nUR!                  U
5        U R#                  S	1[%        S
5      R'                  UR(                  5      5        S1$ s  snf )Nr   )radians>   
from_max_x
from_max_y
from_max_z
from_min_x
from_min_y
from_min_z>   to_max_xto_max_yto_max_zto_min_xto_min_yto_min_zc                  > U4S jnSn [        SU-   5      nXb4n[        U [        R                  R
                  5      (       ah  USLac  S nUT
;   a  U R                  OU R                  n	U	S:X  a  US-   nUb  US   (       a  U" U5        OU	S:X  a  US-   nUb  Sn [        SU-   5      nXh4nU$ ! [         a     Nf = f! [         a     N!f = f)	Nc                h  > U Gb#  [        U S5      (       a>  U R                   H.  nT" UR                  R                  5      UR                  l        M0     U R                   H  nUR
                  S:X  aw  UR                  S:X  a2  UR                   Vs/ s H  nT" U5      PM     snUR                  S S & MU  UR                  S S  Vs/ s H  nT" U5      PM     snUR                  S S& M  UR
                  S:X  d  M  T" UR                  5      Ul        M     U R                  5         g g s  snf s  snf )N	keyframes	GENERATOR
POLYNOMIAL   FNGENERATOR)
hasattrr   coy	modifiersr   r   coefficients	amplitudeupdate)fcurvekmodcr   s       rU   handle_deg2radTUpdateAnimatedTransformConstraint.execute.<locals>.update_cb.<locals>.handle_deg2rad  s    %v{33!'!1!1A%,QTTVV_ADDF "2%//88{2"xx<7KNK[K[6\K[awqzK[6\ 0 0 3LOL\L\]_^_L`7aL`q
L`7a 0 0! 4 XX6,3CMM,BCM  0 MMO & 7]7as   D*D/.zbase.r   _rotr   r   _scale)evalr#   
isinstancer4   typesTransformConstraintmap_frommap_to)base_class_nameold_pathr   optionsr   r5   retnew_pathmap_info
from_pathsr   s             rU   	update_cb<UpdateAnimatedTransformConstraint.execute.<locals>.update_cb  s    $ DGh./ "C$		 = =>>4s?,4
,B4==z)'&0H*w7O/P&v.('(2H'D#Gh$67  *C J-  " % s#   B/ B? /
B<;B<?
CCr   r   z(UpdateAnimatedTransformConstraint Reportr   z3Complete report available on '{:s}' text data-blockr!   )_animsys_refactormathr   ior   StringIOupdate_data_pathsr%   	frame_setframe_currentgetvalueprintr4   r5   textsnewfrom_stringr:   r;   r)   r8   )rH   rI   animsys_refactorr	  to_pathsr/   r  r   p
replace_lslogtextr  r   s               @@rU   rV   )UpdateAnimatedTransformConstraint.execute  s    4 i
[X%+	Z ,T-H-HINSTe,aGDe
Tkkm**:; ; ;<lln#J88>>%%&PQDS!KK$'\"]"d"deienen"op| Us   D,ra   N)rb   rc   rd   re   rf   r*   r+   r   rg   rV   rh   ra   rX   rU   r   r     s)    k<I6Hf%J DrX   r   c                  R    \ rS rSr% SrSrSrSS1rSS/rS	\	S
'   \
S 5       rS rSrg)'ARMATURE_OT_copy_bone_color_to_selectedi  z<Copy the bone color of the active bone to all selected bonesz$armature.copy_bone_color_to_selectedzCopy Colors to Selectedrl   rm   )EDITBonez;Copy Bone colors from the active bone to all selected bones)r|   z	Pose BonezJCopy Pose Bone colors from the active pose bone to all selected pose bonesz0EnumProperty(name='Type', items=_bone_type_enum)	bone_typec                     UR                   S;   $ )N>   r|   EDIT_ARMATURE)r   r   rI   s     rU   r   ,ARMATURE_OT_copy_bone_color_to_selected.poll  s    ||888rX   c                   U R                   UR                  4= a)   S:H  a#  u  S:X  a  S:X  a    U R                  S1S5        S1$   = a.   S:H  a(  u  S:X  a!  S:X  a    UR                  nUR                  n/ nO  = a.   S:H  a(  u  S:X  a!  S:X  a    UR
                  nUR                  n/ nO   aF   S:H  a@  u  S:X  a9  S:X  a5  UR                  nUR                  nU Vs/ s H  oUR                  PM     nnO:   U R                  S1[        S5      R                  UR                  5      5        S	1$ U(       d  U R                  S1S
5        S	1$ U(       d  U R                  S1S5        S	1$ Sn[        U5       H  u  pxUR                  R                  UR                  l        S HC  n	[        UR                  R                  U	5      n
[        UR                  R                  X5        ME     U R                   S:X  d  M  U(       d  M  XG   nUR                  R                  S:w  d  M  US-  nM     U(       a+  U R                  S1[        S5      R                  U5      5        S1$ s  snf )Nr   r|   r   ERRORz(Go to pose mode to copy pose bone colorsOPERATOR_CANCELLEDr  zCannot do anything in mode {!r}r   zNo active bone to copy fromzNo selected bones to copy tor   )normalselectr'   DEFAULTr   r   zaBone colors were synced; for {:d} bones this will not be visible due to pose bone color overridesr!   )r  r   r:   active_boneselected_bonesactive_pose_boner   boner;   r)   	enumeratecolorpaletter   customsetattr)rH   rI   bone_source
bones_destpose_bones_to_checkposebonenum_pose_color_overridesindex	bone_destcustom_fieldr.  r   s               rU   rV   /ARMATURE_OT_copy_bone_color_to_selected.execute  s3   nngll+)))WI'QR,-- * *))%11$33
&(# * !  %66$88
&(# ! ! %11&-&A&A#<OP<Omm<O
P
 ! WIt,M'N'U'UV]VbVb'cd#}$KK	#@A= KK	#AB= #$  )* 5E&1&7&7&?&?IOO# > 1 1 8 8,G	..D !? ~~',?,?/6	??**i7 -1, !6 $KK ` aagag,b |O Qs   I"ra   N)rb   rc   rd   re   rf   r*   r+   r   _bone_type_enumrg   r   r   rV   rh   ra   rX   rU   r  r    sL    F6I(Hf%J 	XkO
 
 9 9:rX   r  c                    [        U SS 5      nU(       a  U$ U R                  nU(       a  UR                  S:X  a  UR                  $ g )NarmatureARMATURE)r   objectr   r5   )rI   pin_armatureobs      rU   _armature_from_contextrB  *  s<    7J5L	B	bgg#wwrX   c                  >    \ rS rSrSrSrSrSS1r\S 5       r	S r
S	rg
)ARMATURE_OT_collection_show_alli4  zShow all bone collectionszarmature.collection_show_allzShow Allrl   rm   c                    [        U5      S L$ r   )rB  r!  s     rU   r   $ARMATURE_OT_collection_show_all.poll:  s    %g.d::rX   c                R    [        U5      nUR                   H
  nSUl        M     S1$ )NTr!   )rB  collections_all
is_visiblerH   rI   armbcolls       rU   rV   'ARMATURE_OT_collection_show_all.execute>  s,    $W-((E#E )|rX   ra   Nrb   rc   rd   re   rf   r*   r+   r   r   r   rV   rh   ra   rX   rU   rD  rD  4  s0    #.IHf%J; ;rX   rD  c                  >    \ rS rSrSrSrSrSS1r\S 5       r	S r
S	rg
)!ARMATURE_OT_collection_unsolo_alliE  z0Clear the 'solo' setting on all bone collectionszarmature.collection_unsolo_allzUn-solo Allrl   rm   c                    [        U5      nU(       d  gUR                  R                  (       d  U R                  S5        gg)NFz-None of the bone collections is marked 'solo'T)rB  collectionsis_solo_activepoll_message_setr   rI   r=  s      rU   r   &ARMATURE_OT_collection_unsolo_all.pollK  s6    )'2##22  !PQrX   c                R    [        U5      nUR                   H
  nSUl        M     S1$ )NFr!   )rB  rH  is_solorJ  s       rU   rV   )ARMATURE_OT_collection_unsolo_all.executeU  s+    $W-((E!EM )|rX   ra   NrN  ra   rX   rU   rP  rP  E  s0    :0IHf%J rX   rP  c                  P    \ rS rSrSrSrSrSS1r\S 5       r	S r
S	 rS
 rS rSrg)$ARMATURE_OT_collection_remove_unusedi\  zRemove all bone collections that have neither bones nor children. This is done recursively, so bone collections that only have unused children are also removedz!armature.collection_remove_unusedzRemove Unused Bone Collectionsrl   rm   c                X    [        U5      nU(       d  g[        UR                  5      S:  $ )NFr   )rB  r@   rR  rU  s      rU   r   )ARMATURE_OT_collection_remove_unused.polld  s(    )'28''(1,,rX   c                4   UR                   S:X  a  U R                  U5      $ [        U5      nUR                   Vs1 s H   n[	        UR
                  5      S:X  d  M  UiM"     nnU(       d  U R                  S1S5        S1$ U R                  X$5        S1$ s  snf )Nr   r   r   All bone collections are in user   r!   )r   execute_edit_moderB  rH  r@   bones_recursiver:   remove_bcolls)rH   rI   r=  rL  bcolls_to_removes        rU   rV   ,ARMATURE_OT_collection_remove_unused.executek  s    <<?*))'22)'2 "11015(()Q. 1 	 0
  KK"CD= 86|0s   BBc                8   [        U5      nUR                   VVs1 s H  nUR                    H  nUiM     M     nnn/ nUR                   H  nU R                  XuU5        M     U(       d  U R	                  S1S5        S1$ U R                  X&5        S1$ s  snnf )Nr   r_  r   r!   )rB  
edit_bonesrR  visitr:   rb  )rH   rI   r=  ebonerL  bcolls_with_bonesrc  roots           rU   r`  6ARMATURE_OT_collection_remove_unused.execute_edit_mode  s    
 *'2 ",,
,** * , 	 
 ((DJJt0@A )  KK"CD= 86|
s    Bc                    X;   nUR                    H   nU R                  XRU5      nU=(       d    UnM"     U(       d  UR                  U5        U$ r   )childrenrg  r   )rH   rL  ri  rc  	has_boneschildchild_has_boness          rU   rg  *ARMATURE_OT_collection_remove_unused.visit  sL    .	^^E"jjCSTO!4_I $ ##E*rX   c                   [        UR                  5      n[        U5      n[        [        U5      5       H  nUR                  R                  U5        M      U R                  S1[        S5      R                  UU5      5        g )Nr   z%Removed {:d} of {:d} bone collections)	r@   rH  reversedr   rR  remover:   r;   r)   )rH   r=  rc  num_bcolls_before_removalnum_bcolls_to_removerL  s         rU   rb  2ARMATURE_OT_collection_remove_unused.remove_bcolls  sw    $'(@(@$A!"#34 d#345E  ''. 6 	H89@@$)+	
rX   ra   N)rb   rc   rd   re   rf   r*   r+   r   r   r   rV   r`  rg  rb  rh   ra   rX   rU   r[  r[  \  sD    l 4I/Hf%J- -(.

rX   r[  c                  B    \ rS rSrSrSrSrSrSS1r\	S 5       r
S	 rS
rg)ANIM_OT_slot_new_for_idi  a  Create a new Action Slot for an ID.

Note that _which_ ID should get this slot must be set in the 'animated_id' context pointer, using:

>>> layout.context_pointer_set("animated_id", animated_id)

When the ID already has a slot assigned, the newly-created slot will be
named after it (ensuring uniqueness with a numerical suffix) and any
animation data of the assigned slot will be duplicated for the new slot.
zanim.slot_new_for_idzNew SlotzCCreate a new action slot for this data-block, to hold its animationrl   rm   c                   [        USS 5      nU(       d  gUR                  (       a  UR                  R                  (       d  U R                  S5        gUR                  R                  R                  (       d  U R                  S5        gg)Nanimated_idFz=An action slot can only be created when an action is assignedz6Creating a new Slot is not possible on a linked ActionT)r   r   r   rT  is_editabler   rI   r{  s      rU   r   ANIM_OT_slot_new_for_id.poll  si    g}d;))1K1K1R1R  !`a))00<<  !YZrX   c                @   UR                   nUR                  nUR                  (       a  UR                  R                  5       nORUR                  SS  =(       d    UR
                  nUR                  R                  R                  UR                  U5      nXCl        S1$ )Nr   r!   )
r{  r   action_slot	duplicatelast_slot_identifierr8   r   slotsr  id_type)rH   rI   r{  adtslot	slot_names         rU   rV   ANIM_OT_slot_new_for_id.execute  s}    ))((????,,.D004H8H8HI::##''(;(;YGD|rX   ra   Nrb   rc   rd   re   rf   r*   r+   r,   r   r   r   rV   rh   ra   rX   rU   ry  ry    s9    	 'IHZNf%J
 
rX   ry  c                  B    \ rS rSrSrSrSrSrSS1r\	S 5       r
S	 rS
rg)ANIM_OT_slot_unassign_from_idi  zUn-assign the assigned Action Slot from an ID.

Note that _which_ ID should get this slot unassigned must be set in the
"animated_id" context pointer, using:

>>> layout.context_pointer_set("animated_id", animated_id)
zanim.slot_unassign_from_idUnassign SlotzJUn-assign the action slot, effectively making this data-block non-animatedrl   rm   c                    [        USS 5      nU(       d  gUR                  (       a  UR                  R                  (       d  U R                  S5        gg)Nr{  Fz+This data-block has no Action slot assignedT)r   r   r  rT  r}  s      rU   r   "ANIM_OT_slot_unassign_from_id.poll  sB    g}d;))1K1K1W1W  !NOrX   c                B    UR                   nS UR                  l        S1$ Nr!   )r{  r   r  )rH   rI   r{  s      rU   rV   %ANIM_OT_slot_unassign_from_id.execute  s#    ))15"".|rX   ra   Nr  ra   rX   rU   r  r    s9     -IHaNf%J rX   r  c                  0    \ rS rSrSr \S 5       rS rSrg)generic_slot_unassign_mixini   c                    [        XR                  S 5      nU(       d  gUR                  (       d  U R                  S5        gg)NFz<No Action slot is assigned, so there is nothing to un-assignT)r   context_property_namer  rT  )r   rI   	slot_users      rU   r    generic_slot_unassign_mixin.poll   s8    G%>%>E	$$  !_`rX   c                B    [        XR                  S 5      nS Ul        S1$ r  )r   r  r  )rH   rI   r  s      rU   rV   #generic_slot_unassign_mixin.execute  s$    G%?%?F	 $	|rX   ra   N)	rb   rc   rd   re   r  r   r   rV   rh   ra   rX   rU   r  r    s"    Q rX   r  c                  0    \ rS rSrSrSrSrSrSS1rSr	S	r
g
)$ANIM_OT_slot_unassign_from_nla_stripi  zUn-assign the assigned Action Slot from an NLA strip.

Note that _which_ NLA strip should get this slot unassigned must be set in
the "nla_strip" context pointer, using:

>>> layout.context_pointer_set("nla_strip", nla_strip)
z!anim.slot_unassign_from_nla_stripr  zQUn-assign the action slot from this NLA strip, effectively making it non-animatedrl   rm   	nla_stripra   Nrb   rc   rd   re   rf   r*   r+   r,   r   r  rh   ra   rX   rU   r  r    s(     4IHhNf%J'rX   r  c                  0    \ rS rSrSrSrSrSrSS1rSr	S	r
g
)%ANIM_OT_slot_unassign_from_constrainti!  zUn-assign the assigned Action Slot from an Action constraint.

Note that _which_ constraint should get this slot unassigned must be set in
the "constraint" context pointer, using:

>>> layout.context_pointer_set("constraint", constraint)
z"anim.slot_unassign_from_constraintr  z.Un-assign the action slot from this constraintrl   rm   
constraintra   Nr  ra   rX   rU   r  r  !  s(     5IHENf%J(rX   r  c                  N    \ rS rSrSrSrSrSS1r\S 5       r	\
S 5       rS	 rS
rg)"ANIM_OT_version_bone_hide_propertyi2  zanim.version_bone_hide_propertyzVersion Bone Hide PropertyzMoves any F-Curves for the `hide` property of selected armatures into the action of the object. This will only operate on the first layer and strip of the actionrl   rm   c                Z    [        UR                  5      S:X  a  U R                  S5        gg)Nr   zNo objects selectedFT)r@   selected_objectsrT  r!  s     rU   r   'ANIM_OT_version_bone_hide_property.poll:  s,     w''(A-  !67rX   c                    / nU R                    HX  nUR                  R                  S5      (       d  M%  UR                  R                  S5      (       d  MG  UR	                  U5        MZ     U$ )Nzbones[z].hide)r   rB   r3   endswithr   )r   r   r   s      rU   find_property_fcurves8ANIM_OT_version_bone_hide_property.find_property_fcurvesB  sX     ((F**8449I9I9R9RS[9\9\v& ) rX   c                @   SSK Jn  / nUR                   Hg  nUR                  S:w  d  UR                  (       d  M&  UR                  nUR                  UR                  5      nU(       d  MV  UR                  U5        Mi     U(       d  U R                  S1[        S5      5        S1$ Sn/ nU GHN  nUR                  n	UR                  R                  n
U(       aI  U	(       a"  U	R                  (       a  U	R                  (       d   U R                  S1[        S5      5        S	nMv  U
c   eUR                  U
R                  U
R                  5      nU(       d  M  U R                  U5      nU(       d  M  UR                  U	R                  U	R                  5      nU HM  nS
UR                  -   nUR                   R#                  U5      (       a  M4  UR                   R%                  XS9  MO     UR                  U5        GMQ     U(       d  U R                  S1[        S5      5        S1$ U R                  S1[        S5      R'                  [)        U5      5      5        [*        R                  R,                   H&  nUR.                   H  nUR1                  5         M     M(     S1$ )Nr   rz   r>  r   zNo animated armatures selectedr   Tz9Not all armature objects have an action and slot assignedFzpose.)rB   z"No armature animation was modifiedr   z(Modified the animation of {:d} armaturesr!   )r   r{   r  r   r5   )animdata_get_channelbag_for_assigned_slotr   r   r:   r;   r   r  action_get_channelbag_for_slotr  !action_ensure_channelbag_for_slotrB   r   findnew_from_fcurver)   r@   r4   screensareas
tag_redraw)rH   rI   r{   selected_armaturesarm_obr=  assigned_channelbagwarnmodified_armaturesob_adtarm_adtarmature_channelbagr   ob_channelbagr   r  screenareas                     rU   rV   *ANIM_OT_version_bone_hide_property.executeJ  s0   )..F{{j({{H","V"VW_WnWn"o&%%f- / "KKT*J%KL=  )F**Fkk00GV6==@R@RYK.i)jk &&&","K"KGNN\c\o\o"p&001DEG 'HHX^XjXjkM!"V%5%55 ((--h77%%55f5Q " %%f-A )D "KKT*N%OP= VHd#MNUUVYZlVmnohh&&F! % ' |rX   ra   N)rb   rc   rd   re   r*   r+   r,   r   r   r   r   r  rV   rh   ra   rX   rU   r  r  2  sK    1I+H"N f%J   @rX   r  )
__future__r   r4   	bpy.typesr   	bpy.propsr   r   r   r   bpy.app.translationsr	   r;   r
   i18n_contextsr   rj   r   r   r  rB  rD  rP  r[  ry  r  r  r  r  r  classesra   rX   rU   <module>r     s  
 #   f! f!RP,( P,f.( .bS SlNh Nbh " .U
8 U
p(h (VH : *(+F ( ),G )"X Xx %+#%(!()&rX   