
    Ki                       S SK Jr  S SKrS SKJrJrJr  S SKJrJ	r	J
r
JrJrJr  S SKJr  S SKJrJrJrJr  1 SkrSS	1rS
S1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\\RF                  R
                  5      r$ " S S\ \RF                  R
                  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/ S0\5      r/ " S1 S25      r0 " S3 S4\0\5      r1 " S5 S6\5      r2 " S7 S8\0\5      r3 " S9 S:\0\5      r4 " S; S<\0\5      r5 " S= S>\0\5      r6 " S? S@\5      r7 " SA SB\5      r8 " SC SD\5      r9\\9\!\"\$\%\(\)\*\+\,\-\.\1\2\3\4\5\6\/\8\74r:g)E    )annotationsN)FileHandlerOperatorPropertyGroup)BoolPropertyCollectionPropertyEnumPropertyFloatVectorPropertyStringPropertyIntPropertyVector)pgettext_tippgettext_datapgettext_rpt
pgettext_n>   ShaderNodeMathFunctionNodeBitMathShaderNodeVectorMathFunctionNodeBooleanMathFunctionNodeIntegerMathGeometryNodeMenuSwitchGeometryNodeIndexSwitchNodeCombineBundleNodeSeparateBundlec                  ^^	^
^ U R                   nTR                   nU R                  nS m
S nU4S jnS m	S m0 S[        _ST
_SU_S	U_S
[        _ST
_SU_SU_S[        _S[        _SU_SU_ST	_SU	4S j_SU	U
4S j_SU4S j_ST_U4S jU4S jU4S jS.EnX#:X  a  U$ UR	                  X#45      nUb  U" U5      $ g )Nc                    U S:  $ Nr    values    Y/home/wildlama/Downloads/blender-5.1.2-linux-x64/5.1/scripts/startup/bl_operators/node.pyto_boolcast_value.<locals>.to_bool:   s    qy    c                    [        X U S45      $ )Ng      ?r   r    s    r"   single_value_to_color)cast_value.<locals>.single_value_to_color=   s    uUC011r%   c                H   > [        U /[        TR                  5      -  5      $ N)r   lendefault_value)r!   targets    r"   single_value_to_vector*cast_value.<locals>.single_value_to_vector@   s     uhV%9%9!::;;r%   c                6    SU S   -  SU S   -  -   SU S   -  -   $ )Ngz6?r   g,C?   g]m{?   r   )colors    r"   color_to_float"cast_value.<locals>.color_to_floatC   s-    q!fuQx&78FU1X<MNNr%   c                0    [        U 5      [        U 5      -  $ r*   )sumr+   )vectors    r"   vector_to_float#cast_value.<locals>.vector_to_floatF   s    6{S[((r%   )VALUEINT)r;   BOOLEAN)r;   RGBA)r;   VECTOR)r<   r;   )r<   r=   )r<   r>   )r<   r?   )r=   r;   )r=   r<   )r=   r>   )r=   r?   )r>   r;   )r>   r<   c                &   > [        T" U 5      5      $ r*   int)r3   r4   s    r"   <lambda>cast_value.<locals>.<lambda>W   s    s>%+@'Ar%   )r>   r=   c                    > T" T" U 5      5      $ r*   r   )r3   r4   r#   s    r"   rC   rD   X   s    7>%3H+Ir%   )r>   r?   c                4   > U S [        TR                  5       $ r*   )r+   r,   )r3   r-   s    r"   rC   rD   Y   s    %0JV5I5I1J*Kr%   )r?   r;   c                &   > [        T" U 5      5      $ r*   rA   r8   r9   s    r"   rC   rD   [   s    #of.E*Fr%   c                &   > [        T" U 5      5      $ r*   )boolrH   s    r"   rC   rD   ]   s    d?63J.Kr%   c                ~   > [        U 5      R                  S/[        TR                  5      [        U 5      -
  -  5      $ )Ng        )listextendr+   r,   )r8   r-   s    r"   rC   rD   ^   s2    4<+>+>uFL`L`HadghndoHo?p+qr%   ))r?   r<   )r?   r=   )r?   r>   )typer,   rB   floatget)sourcer-   source_typetarget_typer!   r'   r.   func_map	cast_funcr4   r#   r9   s    `       @@@r"   
cast_valuerV   4   sU   ++K++K  E2<O)#g 	0 	3	
 	% 	G 	. 	1 	e 	C 	2 	5 	> 	A 	I  	K!" 	_#$ GKq+H0 !k78Ir%   c                  $    \ rS rSr% SrS\S'   Srg)NodeSettingk   r   zuStringProperty(name='Value', description='Python expression to be evaluated as the initial node setting', default='')r!   N)__name__
__module____qualname____firstlineno__	__slots____annotations____static_attributes__r   r%   r"   rX   rX   k   s    I r%   rX   c                  L    \ rS rSr% S\S'   \S 5       r\S 5       rS r	S r
Srg	)
NodeOperatorv   zCollectionProperty(name='Settings', description='Settings to be applied on the newly created node', type=NodeSetting, options={'SKIP_SAVE'})settingsc                t   SSK Jn  US   nXCR                  5       ;   aY  UR                   HI  nUR                  S:X  d  M  [        UR                  5      nUR                  (       d  M=  UR                  s  $    [        R                  R                  R                  U5      nUb  [        UR                  5      $ g)Nr   node_tree_group_typerN   	node_tree )nodeitems_builtinsrg   valuesrd   nameevalr!   descriptionbpytypesNodebl_rna_get_subclasstip_)cls_context
propertiesrg   nodetypesetting
node_groupbl_rnas           r"   rn   NodeOperator.description~   s    ;f%2244%..<<;.!%gmm!4J!---)555	 /
 33H=**++r%   c                h    U R                   nUR                  nUR                   H
  nSUl        M     g NF)
space_data	edit_treenodesselect)contextspacetreens       r"   deselect_nodesNodeOperator.deselect_nodes   s+    ""AAH r%   c                    UR                   nUR                  n UR                  R                  US9nSUl        XTR                  l        UR                  Ul
        U$ ! [         a&  nU R                  S1[        U5      5         S nAg S nAff = f)NrN   ERRORT)r~   r   r   newRuntimeErrorreportstrr   activecursor_locationlocation)selfr   	node_typer   r   nodeexs          r"   create_nodeNodeOperator.create_node   s}    ""	::>>y>1D
  

--  	KK	3r7+	s   A 
B'BBc                   U R                    H^  n[        UR                  5      nUnUR                  nSU;   a%  UR	                  SS5      u  peUR                  U5      n [        XEU5        M`     U$ ! [         aT  nU R                  S1[        S5      R                  UR                  5      5        [        [        U5      5         S nAM  S nAff = f)N.r1   ERROR_INVALID_INPUTzNode has no attribute {:s})rd   rm   r!   rl   rsplitpath_resolvesetattrAttributeErrorr   rpt_formatprintr   )r   r   rx   r!   	node_datanode_attr_namenode_data_pathr   s           r"   apply_node_settings NodeOperator.apply_node_settings   s    }}G'EI$\\N n$1?1F1FsA1N. --n=		59 %&  " *+56==gllKM c"g	s   A11
C;A	C

Cr   N)rZ   r[   r\   r]   r_   classmethodrn   staticmethodr   r   r   r`   r   r%   r"   rb   rb   v   s>       "  r%   rb   c                  F    \ rS rSr% S\S'   \S 5       r\S 5       rS r	Sr
g)	NodeAddOperator   zrBoolProperty(name='Use Transform', description='Start transform operator after inserting the node', default=False)use_transformc                   U R                   nUR                  nU R                  R                  S:X  a  U R                  n[        UR                  S-  5      n[        UR                  S-  5      n[        [        XQR                  5      UR                  U-
  5      n[        [        XaR                  5      UR                  U-
  5      nUR                  Xx5        g UR                  Ul        g )NWINDOW
   )r~   r   regionrN   arearB   widthheightminmaxmouse_region_xmouse_region_ycursor_location_from_regionview_centerr   )	r   eventr   r   r   horizontal_padvertical_pad	inspace_x	inspace_ys	            r"   store_mouse_cursor"NodeAddOperator.store_mouse_cursor   s    "" >>(*<<D b1Nt{{R/0LC0D0DEtzzTbGbcIC.B.BCT[[S_E_`I--iC$($4$4E!r%   c                    UR                   nU=(       a?    UR                  S:H  =(       a)    UR                  =(       a    UR                  R                  $ NNODE_EDITORr~   rN   r   is_editablert   r   r   s      r"   pollNodeAddOperator.poll   sE    ""  <uzz]2 <OO< % ; ;	
r%   c                    U R                  X5        U R                  U5      nU R                  (       a/  SU;   a)  [        R                  R
                  R                  S5        U$ )NFINISHEDINVOKE_DEFAULT)r   executer   ro   opsr   !translate_attach_remove_on_cancel)r   r   r   results       r"   invokeNodeAddOperator.invoke   sJ    /g&:#7GGLL::;KLr%   r   N)rZ   r[   r\   r]   r_   r   r   r   r   r   r`   r   r%   r"   r   r      s9      5 5" 
 
r%   r   c                  n    \ rS rSrSrSrSr\S 5       rS r	S r
S rS	 r\S
 5       r\S 5       rS rSrg)NodeSwapOperator   )r3   hidelabelmuteparentshow_optionsshow_previewshow_texture	use_alpha	use_clampuse_custom_color	operationdomain	data_typeimageinterpolation)frame_currentframe_durationframe_offsetframe_starttileuse_auto_refresh
use_cyclic)
collectionr   materialobjectc                   UR                   b  UR                   R                  S:w  a  gUR                  R                  c  gUR                  R                  R                  b  g[        UR                  5      S::  a  U R                  S5        gg)Nr   Fr   zNo nodes selected.T)r   rN   r~   r   libraryr+   selected_nodespoll_message_setrt   r   s     r"   r   NodeSwapOperator.poll  sx    LL gll&7&7=&H''/''//;w%%&!+  !56r%   c           	         U R                    HN  nX0R                  ;   a  M  [        X5      (       d  M&  [        X#5      (       d  M8   [        X#[	        X5      5        MP     g ! [
        [        4 a     Mf  f = fr*   )properties_to_passrd   hasattrr   getattr	TypeError
ValueError)r   old_nodenew_nodeattrs       r"   transfer_node_properties)NodeSwapOperator.transfer_node_properties#  sa    ++D%x&&78+B+BHGH,CD , ":. s   A  A43A4c                   U R                    H  nUR                  5       n[        X5      (       a  [        X5      nO-UR                  R                  U5      nUb  UR                  nOM\   [        X#5      (       a  [        X#U5        M{  UR                  R                  U5      nUb  XVl        M  M     g ! [        [        4 a     M  f = fr*   )
id_prop_namestitler   r   inputsrP   r,   r   r   r   )r   r   r   	prop_namesocket_namepropsockets          r"   transfer_datablock_properties.NodeSwapOperator.transfer_datablock_properties.  s    ++I#//+Kx++x3!,,[9%!//D8//H6%__00=F)/3, *# ,& z* s   *B3$B33CCc           	         Sn[        X5      (       a  [        X#5      (       d  g [        X5      n[        X#5      nU R                   H  n [        XV[        XF5      5        M     g ! [        [
        [        4 a     M6  f = f)N
image_user)r   r   image_user_settingsr   r   KeyErrorr   )r   r   r   image_user_attrold_image_usernew_image_userr   s          r"   transfer_image_user_settings-NodeSwapOperator.transfer_image_user_settingsF  sr    &22wx7Y7Y ; ;,,Dgn.KL - #Hi8 s   
A$$A=<A=c                (   UR                   [        ;   aR  UR                   [        ;   a>  [        UR                  UR                  5       H  u  p4[	        X4S9nUc  M  XTl        M     g UR                   H  n UR                  UR                     n[	        XgS9nSR                  [        R                  R                  UR                  5      5      nXR                  ;   n	Ub  U	(       d  XWl        M~  M  M     g ! [        [        [        4 a     M  f = f)N)rQ   r-   zinputs["{:s}"].default_value)	bl_idname
math_nodeszipr  rV   r,   rl   r   ro   utilsescape_identifierrd   r   r  r   )
r   r   r   source_inputtarget_input	new_valueinput
new_socketsettings_namealready_defineds
             r"   transfer_input_values&NodeSwapOperator.transfer_input_valuesU  s    *,83E3E3S.1(//8??.S*&lP	(1:. /T "!)!<J *% KI$D$K$KCIILgLghmhrhrLs$tM'4'EO!-3<0 8G- ) ')< s   7A8C88DDc                   UR                   [        ;   =(       a    UR                   [        ;   nU(       Ga,  U(       a  [        UR                  5       Hu  u  pVUR                  S S   H]  n UR                  U   nUR
                  (       d  UR                  (       d  M7  U R                  R                  UR                  U5        M_     Mw     g UR                   H  n[        UR                  S S9n	U	 Hg  n UR                  UR                     nUR
                  (       d  UR                  (       d  MA  U R                  R                  UR                  U5        Mi     M     g U(       a  [        UR                  5       Ht  u  pZU
R                  S S   H\  n UR                  U   nUR
                  (       d  UR                  (       d  M7  U R                  R                  XR                  5      nM^     Mv     g UR                   H  n
U
R                  S S   H  n UR                  U
R                     nUR
                  (       d  UR                  (       d  MA  UR                  R                  nU R                  R                  XR                  5      nU(       a  UR!                  U5        M  M     M     g ! [         a     GM\  f = f! [         a     GM  f = f! [         a     GMT  f = f! [         a     M  f = f)Nc                    U R                   $ r*   )multi_input_sort_id)links    r"   rC   1NodeSwapOperator.transfer_links.<locals>.<lambda>  s
    AYAYr%   )key)r  r  	enumerater  linksr   enabledr   from_socket
IndexErrorsortedrl   r  outputs	to_socketis_multi_inputswap_multi_input_sort_id)r   r   r   is_inputboth_math_nodesir  r$  r  r(  outputnew_linkr/  s                r"   transfer_linksNodeSwapOperator.transfer_linksm  s<   #--;c(BTBTXbBb )(// :HA %A!)1);J)j6H6H ( JJNN4+;+;ZH !/ !; &__E"5;;4YZE %!)1)DJ)j6H6H ( JJNN4+;+;ZH !& - !*8+;+;!<IA &Q!)1)9)9!)<J)j6H6H ('+zz~~j..'QH !0 "= '..F &Q!)1)9)9&++)FJ)j6H6H (-1^^-J-JN'+zz~~j..'QH- ( A A$ G  . !0 /A  * ! !  ( ! !  * ! !&  ( ! !sa   *1J4&J46;K3&K1K	%K;K*AK*4
KK
KK
K'&K'*
K87K8c                x    U R                   nUS:X  a  U R                  R                  $ US:X  a  U R                  $ g )Nr   r   )r  enum_definition
enum_itemsindex_switch_items)r   switch_types     r"   get_switch_items!NodeSwapOperator.get_switch_items  s>    nn22''22233***r%   c                   U R                  U5      nU R                  U5      nUR                  5         UR                  S:X  a  [        US S  5       H@  u  pV[	        US5      (       a  [        U5      Ul        UR                  [        U5      5        MB     UR                  S   R                  =nS:w  a  [        U5      UR                  S   l	        g g UR                  S:X  a  [        US S  5       H6  u  pV[	        US5      (       a  [        U5      Ul        UR                  5         M8     UR                  S   R                  =nS:w  a  [        U5      UR                  S   l	        g g g )Nr   rl   r   ri   r   )r=  clearr  r'  r   r   rl   r   r  r,   rB   )r   r   r   old_switch_itemsnew_switch_itemsr3  old_itemold_switch_values           r"   transfer_switch_data%NodeSwapOperator.transfer_switch_data  sM   00:00: !99()9!)<= 8V,,$'FHM $$SV,  > %-OOA$6$D$DD K367G3H"0 L #<<()9!)<= 8V,,$'FHM $$&  > %-OOA$6$D$DD K367G3H"0 L =r%   r   N)rZ   r[   r\   r]   r   r  r   r   r   r   r  r  r  r   r6  r=  rE  r`   r   r%   r"   r   r      sp    &M   	00 >! >!@  Ir%   r   c                  D    \ rS rSr% SrSrSrSS1rS\S'   S	\S
'   S r	Sr
g)NODE_OT_add_nodei  zAdd a node to the active treeznode.add_nodezAdd NodeREGISTERUNDO9StringProperty(name='Node Type', description='Node type')rN   StringProperty(name='Output Name', description='If provided, all outputs that are named differently will be hidden', options={'SKIP_SAVE'})visible_outputc                d   U R                   R                  S5      (       a  U R                  U5        U R                  XR                  5      =n(       aX  U R                  U5        U R                  (       a6  UR                   H&  nUR                  U R                  :w  d  M  SUl	        M(     S1$ S1$ )NrN   Tr   	CANCELLED)
rv   is_property_setr   r   rN   r   rM  r-  rl   r   )r   r   r   r  s       r"   r   NODE_OT_add_node.execute  s    ??**622('';;t;((.&&"&,,!;;$*=*==*.FK #/ <= r%   r   N)rZ   r[   r\   r]   __doc__r  bl_label
bl_optionsr_   r   r`   r   r%   r"   rH  rH    s2    'IHf%J 
 !r%   rH  c                  j    \ rS rSr% SrSrSrSS1rS\S'   S	\S
'   \	S 5       r
\	S 5       rS rS rSrg)NODE_OT_swap_nodei  z2Replace the selected nodes with the specified typeznode.swap_nodez	Swap NoderI  rJ  rK  rN   rL  rM  c                    [        US5      (       a  XR                  4$ U R                   H+  n[        US5      (       d  M  UR                  U:X  d  M(  X!4s  $    g Npaired_outputr   rY  r   r   r   
input_nodes      r"   get_zone_pairNODE_OT_swap_node.get_zone_pair	  Y     4))++++ **Jz?33++t3%++ %
 r%   c                <    U R                   S;   a  U R                  $ g )N>   r   r   )r  bundle_itemsr   s    r"   get_node_sockets"NODE_OT_swap_node.get_node_sockets  s    >>HH$$$r%   c                8   U R                  U5      nU R                  U5      nU Ha  n UR                  UR                  UR                  5      n[	        US5      (       a&  [	        US5      (       a  UR
                  Ul        M_  Ma  Mc     g ! [         a     Ms  f = f)Nstructure_type)rc  r   socket_typerl   r   rf  r   )r   r   r   	old_items	new_itemsrC  new_items          r"   transfer_node_sockets'NODE_OT_swap_node.transfer_node_sockets  s    ))(3	))(3	!H$==)=)=x}}M8%56678M];^;^.6.E.EH+ <_6	 "   s   AB
BBc                   UR                   R                  n[        5       nUR                  S S   GHy  nXC;   a  M  UR                  U R
                  :X  a$  [        US5      (       d  U R                  U5        MI  U R                  XR
                  5      nU R                  U5        U R                  (       a6  UR                   H&  nUR                  U R                  :w  d  M  SUl        M(     UR                  Ul        SUl        U R                  X$5      nUb  Uu  pUR                  (       a2  U	R                  (       a!  UR                  U	R                  -   S-  Ul        U R!                  XE5        U R#                  X5        U R%                  X(USS9  U R%                  X)USS9  U H  n
UR'                  U
5        M     GM  U R!                  XE5        U R)                  XE5        U R+                  XE5        UR                  [,        ;   a%  UR                  [,        ;   a  U R/                  XE5        UR                  [0        ;   a%  UR                  [0        ;   a  U R3                  XE5        U R#                  XE5        U R%                  X$USS9  U R%                  X$USS9  UR'                  U5        GM|     U H  n
UR4                  R7                  U
5        M      S1$ )Nrh   Tr2   r1  Fr   )r~   r   setr   r  rN   r   r   r   rM  r-  rl   r   location_absoluter   r]  r   r  r6  addr  r  switch_nodesrE  has_child_socketsrk  r   remove)r   r   r   nodes_to_deleter   r   r  	zone_pairr\  output_noder   s              r"   r   NODE_OT_swap_node.execute+  sp   !!++%..q1H*""dii/'(K:X:X((2'';H$$X.""&..F{{d&9&99&* / *2)C)CH&"HO**4:I$*3'
$$););2<2N2NQ\QnQn2nrs1sH.--hA**:@##Dh#N##Dx%#P%D#''- & --hA228F11(E&&,6X=O=OS_=_--hA&&*;;(BTBTXiBi..xB**8>##DHt#L##DHu#M##H-g 2j $DJJd# $ |r%   r   N)rZ   r[   r\   r]   rR  r  rS  rT  r_   r   r]  rc  rk  r   r`   r   r%   r"   rV  rV    s_    < IHf%J 
     
<r%   rV  c                  N    \ rS rSrSrSrSrSS1r\S 5       r	S r
\S	 5       rS
rg)NODE_OT_add_empty_groupij  znode.add_empty_groupzAdd Empty Groupz$Add a group node with an empty grouprI  rJ  c                    g r*   r   rt   ru   rv   s      r"   rn   #NODE_OT_add_empty_group.descriptionr      r%   c                   SSK Jn  UR                  R                  nU R	                  UR
                  5      nU R                  U5        U R                  XUR
                     5      nU R                  U5        XEl	        S1$ )Nr   rf   r   )
rj   rg   r~   r   create_empty_groupr  r   r   r   rh   r   r   rg   r   groupr   s         r"   r   NODE_OT_add_empty_group.executev  sl    ;!!++''7G$dnn)MN  &|r%   c                \   [         R                  R                  R                  [	        S5      U S9nUR
                  R                  S5      nSUl        SUR                  -
  UR                  l	        UR
                  R                  S5      nSUl
        SUl        SUR                  l	        U$ 	N	NodeGroup)rl   rN   NodeGroupInputFi8NodeGroupOutputT   )ro   datanode_groupsr   data_r   r   r   r   xis_active_outputidnamer  r\  rw  s       r"   r  *NODE_OT_add_empty_group.create_empty_group  s    $$((eK.@v(N[[__%56
!
 $z'7'7 7
kkoo&78'+$"!$r%   r   NrZ   r[   r\   r]   r  rS  bl_descriptionrT  r   rn   r   r   r  r`   r   r%   r"   rz  rz  j  sH    &I H;Nf%J   
 
r%   rz  c                  N    \ rS rSrSrSrSrSS1r\S 5       r	S r
\S	 5       rS
rg)NODE_OT_swap_empty_groupi  znode.swap_empty_groupzSwap Empty Groupz'Replace active node with an empty grouprI  rJ  c                    g r*   r   r|  s      r"   rn   $NODE_OT_swap_empty_group.description  r~  r%   c                   SSK Jn  UR                  R                  nU R	                  UR
                  5      n[        R                  R                  R                  SX#R
                     S9  UR                   H	  nXEl        M     S1$ )Nr   rf   r   r   r   )rj   rg   r~   r   r  r  ro   r   r   	swap_noder   rh   r  s         r"   r    NODE_OT_swap_empty_group.execute  sm    ;!!++''7/6J>>6Z[**D"N + |r%   c                J   [         R                  R                  R                  SU S9nUR                  R                  S5      nSUl        SUR                  -
  UR                  l        UR                  R                  S5      nSUl	        SUl        SUR                  l        U$ r  )
ro   r  r  r   r   r   r   r   r  r  r  s       r"   r  +NODE_OT_swap_empty_group.create_empty_group  s    $$((k(G[[__%56
!
 $z'7'7 7
kkoo&78'+$"!$r%   r   Nr  r   r%   r"   r  r    sH    'I!H>Nf%J  
 
 
r%   r  c                  n    \ rS rSr% S\S'   \" S5      \" S5      \" S5      \" S5      S.r\S	 5       rS
r	g)ZoneOperatori  zvFloatVectorProperty(name='Offset', description='Offset of nodes from the cursor when added', size=2, default=(150, 0))offsetz2Simulate the execution of nodes across a time spanz2Execute nodes with a dynamic number of repetitionszTPerform operations separately for each geometry element (e.g. vertices, edges, etc.)zUWrap nodes inside a closure that can be executed at a different part of the node-tree)GeometryNodeSimulationInputGeometryNodeRepeatInput'GeometryNodeForeachGeometryElementInputNodeClosureInputc                    [        USS 5      nUc  U R                  n[        U R                  R	                  US 5      5      $ )Ninput_node_type)r   r  rs   _zone_tooltipsrP   )rt   ru   rv   r  s       r"   rn   ZoneOperator.description  sB    !*.?F "!11OC&&**?DABBr%   r   N)
rZ   r[   r\   r]   r_   n_r  r   rn   r`   r   r%   r"   r  r    sU      CD CD ef fgN C Cr%   r  c                      \ rS rSrSrS rSrg)NodeAddZoneOperatori  Tc                   UR                   nUR                  nU R                  U5        U R                  XR                  5      nU R                  XR
                  5      nU R                  U5        U R                  U5        Ub  Uc  S1$ UR                  U5        U=R                  [        U R                  5      -  sl        U=R                  [        U R                  5      -  sl        UR                  S:X  ad  U R                  (       aS  [        S UR                   5       5      n[        S UR                   5       5      nUR                   R#                  Xv5        S1$ )NrO  GEOMETRYc              3  H   #    U  H  oR                   S :X  d  M  Uv   M     g7fr  Nr   .0ss     r"   	<genexpr>.NodeAddZoneOperator.execute.<locals>.<genexpr>  s     U*<Q*@Tqq*<   "	"c              3  H   #    U  H  oR                   S :X  d  M  Uv   M     g7fr  r   r  s     r"   r  r    s     S(:1ff
>RQQ(:r  r   )r~   r   r   r   r  output_node_typer   pair_with_outputr   r   r  rN   add_default_geometry_linknextr-  r  r(  r   )r   r   r   r   r\  rw  r*  r.  s           r"   r   NodeAddZoneOperator.execute  s   ""G$%%g/C/CD
&&w0E0EF  ,  -!4=  	##K0vdkk22t{{ 3399
"t'E'E U**<*<UUKS(:(:SSIJJNN92|r%   r   N)rZ   r[   r\   r]   r  r   r`   r   r%   r"   r  r    s     $r%   r  c                  D    \ rS rSr% SrSrSS1rS\S'   S\S	'   S
\S'   Srg)NODE_OT_add_zonei  znode.add_zonezAdd ZonerI  rJ  bStringProperty(name='Input Node', description='Specifies the input node used by the created zone')r  dStringProperty(name='Output Node', description='Specifies the output node used by the created zone')r  BoolProperty(name='Add Geometry Link', description='When enabled, create a link between geometry sockets in this zone', default=False)r  r   N)	rZ   r[   r\   r]   r  rS  rT  r_   r`   r   r%   r"   r  r    s4    IHf%J 
 
  r%   r  c                  p    \ rS rSr% SrSrSS1rS\S'   S\S	'   S
\S'   \S 5       r	\S 5       r
S rS rSrg)NODE_OT_swap_zonei  znode.swap_zonez	Swap ZonerI  rJ  r  r  r  r  r  r  c                    [        US5      (       a  XR                  4$ U R                   H+  n[        US5      (       d  M  UR                  U:X  d  M(  X!4s  $    g rX  rZ  r[  s      r"   r]  NODE_OT_swap_zone.get_zone_pair"  r_  r%   c                d   [        U S5      (       a  U R                  nOU nU R                  R                  S5      (       a  UR                  $ U R                  R                  S5      (       a  UR
                  $ U R                  S:X  a  UR                  $ U R                  S:X  a  UR                  $ g )NrY  GeometryNodeSimulationGeometryNodeRepeatr  NodeClosureOutput)r   rY  r  
startswithstate_itemsrepeat_itemsinput_itemsoutput_items)r   rw  s     r"   get_child_items!NODE_OT_swap_zone.get_child_items0  s    4)),,KK>>$$%=>>***>>$$%9::+++>>//***>>00+++r%   c                    U R                  U5      nU R                  U5      nUb  Uc  g U H<  nUR                  U;  d  M   UR                  UR                  UR                  5        M>     g ! [         a     MN  f = fr*   )r  rl   r   rg  r   )r   r   r   old_childrennew_childrenitems         r"   transfer_zone_sockets'NODE_OT_swap_zone.transfer_zone_socketsA  sy    ++H5++H5 l&: Dyy, $$T%5%5tyyA ! $ s   &A--
A;:A;c                *   UR                   R                  n[        5       nUR                  S S   GH  nXC;   a  M  U R	                  X$5      nUR
                  U R                  U R                  1;   a=  Ub'  Uu  pgU R                  U5        U R                  U5        OU R                  U5        M  U R                  XR                  5      nU R                  XR                  5      n	U R                  U5        U R                  U	5        Ub  U	c  S1s  $ UR                  U	5        UGbl  Uu  pgUR                  Ul        UR                  U	l        UR
                  S;   aO  U R                  U	5      n
U
R                  5         U H'  nUR                  (       d  M  U R                  X5        M)     OBUR
                  R!                  S5      (       a"  U R                  Xh5        U R                  Xy5        U R#                  Xh5        U R#                  Xy5        U R%                  Xh5        U R%                  Xy5        U R'                  X&USS9  U R'                  X&USS9  U R'                  X'U	SS9  U R'                  X'U	SS9  U H  nUR)                  U5        M     GMc  UR                  [+        U R,                  5      -
  Ul        UR                  [+        U R,                  5      -   U	l        U R#                  XH5        U R#                  XI5        U R%                  XH5        U R'                  X$USS9  U R'                  X$U	SS9  UR)                  U5        UR.                  S:X  d  GM*  U R0                  (       d  GM>  [3        S UR4                   5       5      n[3        S	 U	R6                   5       5      nUR8                  (       a  GM  UR8                  (       a  GM  UR:                  R=                  X5        GM     U H  nUR>                  RA                  U5        M      S
1$ )NrO  >   r  r  NodeClosureTrn  Fr  c              3  H   #    U  H  oR                   S :X  d  M  Uv   M     g7fr  r   r  s     r"   r  ,NODE_OT_swap_zone.execute.<locals>.<genexpr>  s     &]2DQR\H\qq2Dr  c              3  H   #    U  H  oR                   S :X  d  M  Uv   M     g7fr  r   r  s     r"   r  r    s     $[0B1ffPZFZQQ0Br  r   )!r~   r   ro  r   r]  r  r  r  r   r   r  rp  r  r@  r   r  r  r   r  r6  rq  r   r  rN   r  r  r-  r  	is_linkedr(  r   r   rt  )r   r   r   ru  r   rv  old_input_nodeold_output_noder\  rw  new_zone_childrenr   r*  r.  s                 r"   r   NODE_OT_swap_zone.executeO  s   !!++%..q1H***4:I""t';';T=R=R&SS(6?3N,,^<,,_=,,X6))'3G3GHJ**74I4IJK$$Z0$$[1![%8#}$ ''4$2;//=/O/O
,0?0Q0Q-''+ee(,(<(<[(I%%++- );;; 66tI !*  ))44]CC..~J..L--nI--oK**>F**?H##D*t#T##D*u#U##D;QU#V##D;QV#W%D#''- & 190J0JVTXT_T_M`0`
,191K1KfUYU`U`Na1a---hC--hD**8@##DJ#N##DK%#P##H-99
*t/M/M/M #'&]*2D2D&]"]K $$[0B0B$[ [I'111Y5H5H5H

y>c 2f $DJJd# $ |r%   r   N)rZ   r[   r\   r]   r  rS  rT  r_   r   r]  r  r  r   r`   r   r%   r"   r  r    sg     IHf%J 
 
       Zr%   r  c                  0    \ rS rSrSrSrSrSS1rSrSr	S	r
g
)NODE_OT_add_simulation_zonei  z=Add simulation zone input and output nodes to the active treeznode.add_simulation_zonezAdd Simulation ZonerI  rJ  r  GeometryNodeSimulationOutputr   NrZ   r[   r\   r]   rR  r  rS  rT  r  r  r`   r   r%   r"   r  r    s$    G*I$Hf%J3O5r%   r  c                  0    \ rS rSrSrSrSrSS1rSrSr	S	r
g
)NODE_OT_add_repeat_zonei  zGAdd a repeat zone that allows executing nodes a dynamic number of timesznode.add_repeat_zonezAdd Repeat ZonerI  rJ  r  GeometryNodeRepeatOutputr   Nr  r   r%   r"   r  r    s$    Q&I Hf%J/O1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
S
rg))NODE_OT_add_foreach_geometry_element_zonei  z`Add a For Each Geometry Element zone that allows executing nodes e.g. for each vertex separatelyz&node.add_foreach_geometry_element_zonez"Add For Each Geometry Element ZonerI  rJ  r  (GeometryNodeForeachGeometryElementOutputFr   NrZ   r[   r\   r]   rR  r  rS  rT  r  r  r  r`   r   r%   r"   r  r    s*    j8I3Hf%J?OA %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
S
rg)NODE_OT_add_closure_zonei  zAdd a Closure zoneznode.add_closure_zonezAdd Closure ZonerI  rJ  r  r  Fr   Nr  r   r%   r"   r  r    s*    'I!Hf%J(O* %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
)#NODE_OT_collapse_hide_unused_togglei  z.Toggle collapsed nodes and hide unused socketsz node.collapse_hide_unused_togglez Collapse and Hide Unused SocketsrI  rJ  c                    UR                   nU=(       a?    UR                  S:H  =(       a)    UR                  =(       a    UR                  R                  $ r   r   r   s      r"   r   (NODE_OT_collapse_hide_unused_toggle.poll  sC    "" B5::6 B@U__%@%@	Cr%   c                   UR                   nUR                  nUR                   H_  nUR                  (       d  M  UR                  (       + nXTl        UR
                   H	  nXVl        M     UR                   H	  nXVl        M     Ma     S1$ Nr   )r~   r   r   r   r   r  r-  )r   r   r   r   r   r   r  s          r"   r   +NODE_OT_collapse_hide_unused_toggle.execute  sm    ""JJD{{{ II 	"kkF"&K *"llF"&K +  |r%   r   N)rZ   r[   r\   r]   rR  r  rS  rT  r   r   r   r`   r   r%   r"   r  r    s2    82I1Hf%JC Cr%   r  c                  J    \ rS rSr% SrSrSrSS1rS\S'   \	S	 5       r
S
 rSrg)NODE_OT_tree_path_parenti  zGo to parent node treeznode.tree_path_parentzParent Node TreerI  rJ  zWIntProperty(name='Parent Index', description='Parent index in context path', default=0)parent_tree_indexc                    UR                   nU=(       a.    UR                  S:H  =(       a    [        UR                  5      S:  $ )Nr   r1   )r~   rN   r+   pathr   s      r"   r   NODE_OT_tree_path_parent.poll  s3    ""O5::6OC

Oa<OPr%   c                    UR                   n[        UR                  5      S-
  U R                  -
  n[	        U5       H  nUR                  R                  5         M     S1$ )Nr1   r   )r~   r+   r  r  rangepop)r   r   r   parent_number_to_pop_s        r"   r    NODE_OT_tree_path_parent.execute  sS    """5::2T5K5KK+,AJJNN - |r%   r   NrZ   r[   r\   r]   rR  r  rS  rT  r_   r   r   r   r`   r   r%   r"   r  r    s>     'I!Hf%J  Q Q
r%   r  c                  $    \ rS rSr\S 5       rSrg)NodeInterfaceOperatori  c                    UR                   nU(       a!  UR                  S:w  d  UR                  (       d  gUR                  R                  (       a  gg)Nr   FT)r~   rN   r   is_embedded_datar   s      r"   r   NodeInterfaceOperator.poll  s7    ""

m35????++r%   r   N)rZ   r[   r\   r]   r   r   r`   r   r%   r"   r  r    s     r%   r  c                  J    \ rS rSr% SrSrSrSS1rS\S'   \	S	 5       r
S
 rSrg)NODE_OT_interface_item_newi  zAdd a new item to the interfaceznode.interface_item_newzNew ItemrI  rJ  zEnumProperty(name='Item Type', description='Type of the item to create', items=(('INPUT', 'Input', ''), ('OUTPUT', 'Output', ''), ('PANEL', 'Panel', '')), default='INPUT')	item_typec                Z   Sn[        U S5      (       a  U R                  U5      (       a  U$ [        R                  R                  /nU(       a^  UR                  5       n[        USS5      nU R                  U5      (       a  U$ UR                  UR                  5       5        U(       a  M]  g g )NNodeSocketFloatvalid_socket_typer  ri   )	r   r
  ro   rp   
NodeSocketr  r   rM   __subclasses__)r   rg  types_to_checktr  s        r"   find_valid_socket_type1NODE_OT_interface_item_new.find_valid_socket_type.  s    ' t011T5K5KK5X5X))../""$AQR0F%%f--!!!"2"2"45 nr%   c                   UR                   nUR                  nUR                  nUR                  nU(       a  UR                  OSnU R
                  S:X  a!  UR                  SU R                  U5      SS9nOVU R
                  S:X  a!  UR                  SU R                  U5      SS9nO%U R
                  S:X  a  UR                  S5      nOS1$ U(       ae  UR
                  S:X  a6  UR
                  S:w  a&  UR                  Xu[        UR                  5      5        OUR                  XuR                  US	-   5        Xtl        S
1$ )NINPUTSocketrg  in_outOUTPUTPANELPanelrO  r1   r   )r~   r   	interfacer   positionr  r  r  	new_panelmove_to_parentr+   interface_itemsr   )r   r   snoder   r  active_item
active_posr  s           r"   r   "NODE_OT_interface_item_new.execute?  s   ""NN	  &&-8[))b
>>W$''d>Y>YZ^>_ho'pD^^x'''d>Y>YZ^>_hp'qD^^w&&&w/D= $$/DNNg4M((C@[@[<\]((/A/A:PQ>R|r%   r   N)rZ   r[   r\   r]   rR  r  rS  rT  r_   r   r  r   r`   r   r%   r"   r  r    s<    ))IHf%J	 	 6 6 r%   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)'NODE_OT_interface_item_new_panel_togglei\  z.Add a checkbox to the currently selected panelz$node.interface_item_new_panel_togglezNew Panel TogglerI  rJ  c                    [        U R                  5      S:  aH  U R                  S   n[        U5      [        R                  R
                  L a  UR                  (       a  U$ g r   )r+   r  rN   ro   rp   NodeTreeInterfaceSocketBoolis_panel_toggle)panel
first_items     r"   get_panel_toggle8NODE_OT_interface_item_new_panel_toggle.get_panel_toggleb  sM    u$$%)..q1JJ399#H#HHZMgMg!!r%   c                    UR                   nUR                  nUR                  nUR                  nUR                  S:w  a  U R                  S5        gU R                  U5      b  U R                  S5        gg! [         a     gf = f)Nr  zActive item is not a panelFPanel already has a toggleT)r~   r   r  r   r  r   r*  r   )rt   r   r  r   r  r   s         r"   r   ,NODE_OT_interface_item_new_panel_toggle.pollk  s    	&&E??DI#**K$$/$$%AB##K0<$$%AB 		s   AA9 #A9 9
BBc                    UR                   nUR                  nUR                  nUR                  nUR	                  UR
                  SSS9nSUl        UR                  XeS5        S1$ )NNodeSocketBoolr  r  Tr   r   )r~   r   r  r   r  rl   r'  r  )r   r   r  r   r  active_panelr  s          r"   r   /NODE_OT_interface_item_new_panel_toggle.execute  si    ""NN	 ''##L$5$5CS\c#d#  Q7|r%   r   N)rZ   r[   r\   r]   rR  r  rS  rT  r   r*  r   r   r   r`   r   r%   r"   r$  r$  \  sD    86I!Hf%J   (
r%   r$  c                  L   ^  \ rS rSrSrSrSrSS1r\U 4S j5       r	S r
S	rU =r$ )
 NODE_OT_interface_item_duplicatei  z.Add a copy of the active item to the interfaceznode.interface_item_duplicatezDuplicate ItemrI  rJ  c                   > [         TU ]  U5      (       d  gUR                  nUR                  nUR                  nUR
                  S L$ r}   )superr   r~   r   r  r   )rt   r   r  r   r  	__class__s        r"   r   %NODE_OT_interface_item_duplicate.poll  sC    w|G$$""NN	t++r%   c                    UR                   nUR                  nUR                  nUR                  nU(       a  UR	                  U5      nXdl        S1$ r  )r~   r   r  r   copy)r   r   r  r   r  r  	item_copys          r"   r   (NODE_OT_interface_item_duplicate.execute  sI    ""NN	!t,I(|r%   r   rZ   r[   r\   r]   rR  r  rS  rT  r   r   r   r`   __classcell__r7  s   @r"   r4  r4    s6    8/IHf%J, ,
 
r%   r4  c                  .    \ rS rSrSrSrSrSS1rS rSr	g	)
NODE_OT_interface_item_removei  z(Remove selected items from the interfaceznode.interface_item_removezRemove Selected ItemsrI  rJ  c                \   UR                   nUR                  nUR                  nUR                  nUR                   Vs/ s H  ofR
                  (       d  Xe:X  d  M  UPM     nn[        U5      S:X  a  S1$ [        U5       H  nUR                  S:X  ak  UR                  n[        U5      S:  aP  US   n	[        U	[        R                  R                  5      (       a"  U	R                  (       a  UR                  U	5        UR                  U5        M     [!        UR"                  [        UR                  5      S-
  5      Ul        UR                  n
[        U
[        R                  R                  5      (       a,  U
R                  (       a  U
R$                  R&                  Ul        S1$ s  snf )Nr   rO  r  r1   r   )r~   r   r  r   
items_treer   r+   reversedr  r  
isinstancero   rp   NodeTreeInterfaceSocketr'  rt  r   active_indexr   index)r   r   r  r   r  r   r  selected_itemschildrenfirst_child
new_actives              r"   r   %NODE_OT_interface_item_remove.execute  sR   ""NN	&&+4+?+?f+?4;;RVRe$+?f~!#= ^,D~~(//x=1$"*1+K!+syy/P/PQQVaVqVq!((5T" - "%Y%;%;SAUAU=VYZ=Z![	 %%
j#))"C"CDDIcIc%/%6%6%<%<I"|' gs   F)F)r   N)
rZ   r[   r\   r]   rR  r  rS  rT  r   r`   r   r%   r"   rA  rA    s    2,I&Hf%Jr%   rA  c                  L   ^  \ rS rSrSrSrSrSS1r\U 4S j5       r	S r
S	rU =r$ )
(NODE_OT_interface_item_make_panel_togglei  z<Make the active boolean socket a toggle for its parent panelz%node.interface_item_make_panel_togglezMake Panel TogglerI  rJ  c                  > [         TU ]  U5      (       d  gUR                  nUR                  nUR                  nUR
                  nU(       d  g[        U5      [        R                  R                  Ld  UR                  S:w  a  U R                  S5        gUR                  nUR                  c  U R                  S5        g[        UR                  5      S:  a2  UR                  S   nUR                  (       a  U R                  S5        gg)NFr  z(Only boolean input sockets are supportedzSocket must be in a panelr   r-  T)r6  r   r~   r   r  r   rN   ro   rp   r&  r  r   r   r+   r  r'  )	rt   r   r  r   r  r   parent_panelr)  r7  s	           r"   r   -NODE_OT_interface_item_make_panel_toggle.poll  s    w|G$$""NN	&&CII$I$II[M_M_cjMj  !KL"))&  !<=|++,q0%55a8J))$$%ABr%   c                F   UR                   nUR                  nUR                  nUR                  nUR                  nU(       d  S1$ [        U5      [        R                  R                  La  S1$ SUl	        UR                  Ul
        UR                  XVS5        Xdl        S1$ )NrO  Tr   r   )r~   r   r  r   r   rN   ro   rp   r&  r'  rl   r  )r   r   r  r   r  r   rQ  s          r"   r   0NODE_OT_interface_item_make_panel_toggle.execute  s    ""NN	&&"))= CII$I$II= &*#',, 	  A>'|r%   r   r=  r?  s   @r"   rO  rO    s6    F7I"Hf%J 4 r%   rO  c                  L   ^  \ rS rSrSrSrSrSS1r\U 4S j5       r	S r
S	rU =r$ )
*NODE_OT_interface_item_unlink_panel_togglei  z*Make the panel toggle a stand-alone socketz'node.interface_item_unlink_panel_togglezUnlink Panel TogglerI  rJ  c                (  > [         TU ]  U5      (       d  gUR                  nUR                  nUR                  nUR
                  nU(       a  UR                  S:w  a  g[        UR                  5      S:X  a  gUR                  S   nUR                  $ )NFr  r   )
r6  r   r~   r   r  r   r  r+   r  r'  )rt   r   r  r   r  r   r)  r7  s          r"   r   /NODE_OT_interface_item_unlink_panel_toggle.poll  s    w|G$$""NN	&&k33w>{**+q0 003
)))r%   c                   UR                   nUR                  nUR                  nUR                  nU(       a  UR                  S:w  a  S1$ [        UR                  5      S:X  a  S1$ UR                  S   n[        U5      [        R                  R                  Ld  UR                  (       d  S1$ SUl        UR                  Ul        Xdl        S1$ )Nr  rO  r   Fr   )r~   r   r  r   r  r+   r  rN   ro   rp   r&  r'  rl   )r   r   r  r   r  r   r)  s          r"   r   2NODE_OT_interface_item_unlink_panel_toggle.execute  s    ""NN	&&k33w>= {**+q0=  003

399#H#HHPZPjPj= %*
"%**
 &|r%   r   r=  r?  s   @r"   rV  rV    s6    49I$Hf%J* *  r%   rV  c                  P    \ rS rSr% SrSrSrSS1rS\S'   S	 r	\
S
 5       rS rSrg)NODE_OT_viewer_shortcut_seti5  zGCreate a viewer shortcut for the selected node by pressing ctrl+1,2,..9znode.viewer_shortcut_setFast PreviewrI  rJ  IntProperty(name='Viewer Index', description='Index corresponding to the shortcut, e.g. number key 1 corresponds to index 1 etc..')viewer_indexc                    UR                    H8  nUR                   H%  nUR                  nUR                  S:X  d  M!  Us  s  $    M:     g )NVIEWER)r-  r(  to_noderN   )r   r   outr$  nvs        r"   get_connected_viewer0NODE_OT_viewer_shortcut_set.get_connected_viewer?  s=    <<C		\\77h&I "  
 r%   c                    A UR                   nUS L=(       a:    UR                  S:H  =(       a$    UR                  S L=(       a    UR                  S;   $ Nr   >   GeometryNodeTreeCompositorNodeTreer~   rN   rh   	tree_typer   s      r"   r    NODE_OT_viewer_shortcut_set.pollG  V    ""$ JJJ-'JOO4'J OOII		
r%   c                   UR                   n[        U5      S:X  a  U R                  S1S5        S1$ US   nUR                  S:X  a  UnOQU R	                  U5      nU(       d9  [
        R                  R                  R                  5         U R	                  U5      nU(       d  U R                  S1S5        S1$ [
        R                  R                  US9   [
        R                  R                  R                  5         S S S 5        U R                  Ul        U R                  S1[        S	5      R                  U R                  UR                   5      5        S
1$ ! , (       d  f       Nb= f)Nr   r   z"Select a node to assign a shortcutrO  ra  zVUnable to set shortcut, selected node is not a viewer node or does not support viewingrb  INFOzAssigned shortcut {:d} to {:s}r   )r   r+   r   rN   re  ro   r   r   link_viewerr   temp_overrideactivate_viewerr_  ui_shortcutr   r   rl   )r   r   r   fav_nodeviewer_nodes        r"   r   #NODE_OT_viewer_shortcut_set.executeR  s)    //~!#KK	#GH= !!$ ==H$"K33H=K
 ((*"77AKK	h  = [[&&K&8GGLL((* 9 #'"3"3VHd#CDKKDL]L]_j_o_opq| 98s   )E
E(r   N)rZ   r[   r\   r]   rR  r  rS  rT  r_   re  r   r   r   r`   r   r%   r"   r\  r\  5  sC    Q*IHf%Jk k 
 
$r%   r\  c                  J    \ rS rSr% SrSrSrSS1rS\S'   \	S	 5       r
S
 rSrg)NODE_OT_viewer_shortcut_getiy  z1Toggle a specific viewer node using 1,2,..,9 keysznode.viewer_shortcut_getr]  rI  rJ  r^  r_  c                    A UR                   nUS L=(       a:    UR                  S:H  =(       a$    UR                  S L=(       a    UR                  S;   $ rh  rk  r   s      r"   r    NODE_OT_viewer_shortcut_get.poll  rn  r%   c                   UR                   R                  R                  nS nU H3  nUR                  S:X  d  M  UR                  U R
                  :X  d  M1  UnM5     U(       d8  U R                  S1[        S5      R                  U R
                  5      5        S1$ [        R                  R                  US9   [        R                  R                  R                  5         S S S 5        S1$ ! , (       d  f       S1$ = f)Nra  rp  z2Shortcut {:d} is not assigned to a Viewer node yetrO  rb  r   )r~   r   r   rN   rt  r_  r   r   r   ro   r   rr  r   r   toggle_viewer)r   r   r   rv  r   s        r"   r   #NODE_OT_viewer_shortcut_get.execute  s    "",,22 Avv!ammt7H7H&H  KK$'["\"c"cdhdudu"vw= [[&&K&8GGLL&&( 9 | 98 |s   8)C,,
C<r   Nr  r   r%   r"   ry  ry  y  s>    ;*IHf%Jk k 
 
r%   ry  c                      \ rS rSrS rSrSrSR                  / \R                  R                  Q\R                  R                  Q75      r\S 5       rSrg)NODE_FH_image_nodei  z
Image nodeznode.add_image;c                    UR                   S L=(       aN    UR                   R                  S:H  =(       a.    UR                  S L=(       a    UR                  R                  S:H  $ )Nr   r   )r   rN   r   r   s     r"   	poll_dropNODE_FH_image_node.poll_drop  sV     \\% .\\-/.^^4'. ^^  H,		
r%   r   N)rZ   r[   r\   r]   r  rS  bl_import_operatorjoinro   r  extensions_imageextensions_moviebl_file_extensionsr   r  r`   r   r%   r"   r  r    sR    $IH)"ZCHH$=$="Z@Y@Y"Z[
 
r%   r  );
__future__r   ro   	bpy.typesr   r   r   	bpy.propsr   r   r	   r
   r   r   	mathutilsr   bpy.app.translationsr   rs   r   r  r   r   r   r  r  rr  rs  rV   rX   rb   r   r   rH  rV  rp   rz  r  r  r  r  r  r  r  r  r  r  r  r  r  r$  r4  rA  rO  rV  r\  ry  r  classesr   r%   r"   <module>r     sS  
 # 
 
  
   4n- D DP,l ,^gI| gIV! !@o(( od!osyy/A/A !H#/1C1C #LC CD, B*H ,\&6 \~6"5x 6218 2&0CX &&2H &( >x 8 =!6 =@.h .b'<h :$98 B7/Dh 7t-1F -`A( AH%( %P
 
" -'+$!,.1r%   