
    ai,                     Z    S SK Jr  S SKJr  S rS rS rS SKJrJ	r	   " S S\5      r
\
4rg	)
    )Operator)Vectorc                 <   U S   S   U S   S   U S   S   U S   S   U S   S   U S   S   4u  pp4pV[        S5       HD  nX   S   nX:  a  UnX:  a  UnX   S   nX:  a  UnX:  a  UnX   S   nX:  a  UnX:  d  MB  UnMF     [        XU45      [        X$U45      4$ )N   r         )ranger   )	bb_worldleftrightfrontbackdownupivals	            a/home/wildlama/Downloads/blender-5.1.2-linux-x64/5.1/scripts/startup/bl_operators/object_align.py$worldspace_bounds_from_object_boundsr   	   s     	AAAAAA*&Dd 1X k!n:D;E k!n;E:D k!n:D8B1 4 D$%vuD.A'BCC    c                 
   UR                   R                  5       nUR                  U 5      nUR                  5       nUR                  nX%(       a  US   R
                  O
[        S5      -  nUS   US   US   US   US   US   4u  pxppU HL  nX-R
                  -  nUS   nXg:  a  UnXh:  a  UnUS   nXi:  a  Un	Xj:  a  Un
US   nXk:  a  UnXl:  d  MJ  UnMN     UR                  5         [        XyU45      [        XU45      4$ )N        r   r   r   r   r   )matrix_worldcopyevaluated_getto_meshverticescor   to_mesh_clear)	depsgraphobjr   ob_evalmevertsr   r   r   r   r   r   r   vvcos                  r   "worldspace_bounds_from_object_datar(   3   s4   ##((*L 	*G		BKKE
%%),,VO5L
MC 	AAAAAA*&Dd TT! !f:D;E !f;E:D !f:D8B3 6 4#$fe4-@&AAAr   c           
      
   U R                  5       nU R                  nUR                  R                  n	U R                  R                  5         / SQn
/ SQnSn/ nU R                   HX  nUR                  R                  5       nUR                   Vs/ s H  nU[        U5      -  PM     nnUR                  UU45        MZ     U(       d  gU GHX  u  nnU(       a  UR                  S:X  a  [        X~5      nO[        U5      nUS   nUS   nXR                  :X  aT  US   US   -   S-  nUS   US   -   S-  nUS   US   -   S-  nUS   US   -
  S-  nUS   US   -
  S-  nUS   US   -
  S-  nU(       a4  SnUS   U
S'   US   U
S'   US   U
S'   US   US'   US   US'   US   US'   M  US   U
S   :  a  US   U
S'   US   U
S   :  a  US   U
S'   US   U
S   :  a  US   U
S'   US   US   :  a  US   US'   US   US   :  a  US   US'   US   US   :  d  GMP  US   US'   GM[     U
S   US   -   S-  nU
S   US   -   S-  nU
S   US   -   S-  nU GH  u  nnUR                  R                  5       nUR                   Vs/ s H  nU[        US S  5      -  PM     nnU(       a  UR                  S:X  a  [        X~5      nO[        U5      nUS   nUS   nUS   US   -   S-  nUS   US   -   S-  nUS   US   -   S-  n US   n!US   n"US   n#US   n$US   n%US   n&UR                  n'U(       a  US	:X  a$  US
:X  a  U'S   U$-
  W-
  n(O/US:X  a  U'S   U!-
  W-   n(OUS
:X  a	  U'S   U$-
  n(OUS:X  a  U'S   U!-
  n(US:X  a  U'S   U-
  n(US
:X  a  W(n)O&US:X  a	  W(U	S   -   n)OUS:X  a  W(U-   n)OUS	:X  a  W(W-   n)W)UR                  S'   U(       a  US	:X  a$  US
:X  a  U'S   U%-
  W-
  n*O/US:X  a  U'S   U"-
  W-   n*OUS
:X  a	  U'S   U%-
  n*OUS:X  a  U'S   U"-
  n*US:X  a  U'S   U-
  n*US
:X  a  W*n+O&US:X  a	  W*U	S   -   n+OUS:X  a  W*U-   n+OUS	:X  a  W*W-   n+W+UR                  S'   U(       d  GM  US	:X  a$  US
:X  a  U'S   U&-
  W-
  n,O/US:X  a  U'S   U#-
  W-   n,OUS
:X  a	  U'S   U&-
  n,OUS:X  a  U'S   U#-
  n,US:X  a  U'S   U -
  n,US
:X  a  W,n-O&US:X  a	  W,U	S   -   n-OUS:X  a  W,U-   n-OUS	:X  a  W,W-   n-W-UR                  S'   GM     gs  snf s  snf )Nr   TFMESHr   r   g       @r   OPT_4OPT_1OPT_3OPT_2)evaluated_depsgraph_getscenecursorlocation
view_layerupdateselected_objectsr   r   	bound_boxr   appendtyper(   r   active_object).contextalign_xalign_yalign_z
align_moderelative_to
bb_qualityr!   r0   r1   Left_Front_Up_SELRight_Back_Down_SEL
flag_firstobjectsr"   r   r&   r
   GBBLeft_Front_UpRight_Back_Downcenter_active_xcenter_active_ycenter_active_zsize_active_xsize_active_ysize_active_zcenter_sel_xcenter_sel_ycenter_sel_zcenter_xcenter_ycenter_z
positive_x
positive_y
positive_z
negative_x
negative_y
negative_zobj_locobj_xloc_xobj_yloc_yobj_zloc_zs.                                                 r   align_objectsra   h   s   //1IMME\\""F ')JG'''',,.69mmDmL6!9,mDX' (
  X#((f,4YDC6x@CAa& ''',Q//!2DDKO,Q//!2DDKO,Q//!2DDKO,Q/-2BBcIM,Q/-2BBcIM*1-0BBcIM J#0#3a #0#3a #0#3a %4Q%7"%4Q%7"%4Q%7" Q"3A"66'4Q'7!!$Q"3A"66'4Q'7!!$Q"3A"66'4Q'7!!$ q!$7$::)8);#A&q!$7$::)8);#A&q!$7$::)8);#A&m !p &a(+>q+AASHL%a(+>q+AASHL%a(+>q+AASHL !X'',,.9<GAL6!A$</G#((f,4YDC6x@CAa&!!$q'99S@!!$q'99S@!!$q'99S@$Q'
$Q'
"1%
"1%
"1%
$Q'
,, g%(#AJ3mCE7*#AJ3mCE (#AJ3E7*#AJ3EW$
X- g%'q	)','/#CLLO g%(#AJ3mCE7*#AJ3mCE (#AJ3E7*#AJ3EW$
X- g%'q	)','/#CLLO7g%(#AJ3mCE7*#AJ3mCE (#AJ3E7*#AJ3EW$
X- g%'q	)','/#CLLOI !L U EL Hs   TT)BoolPropertyEnumPropertyc                       \ rS rSr% SrSrSrSS1r\" SSS	S
9\	S'   \
" SSSSS9\	S'   \
" SSSSS9\	S'   \
" SSSS1S9\	S'   \S 5       rS rSrg )!AlignObjectsiO  zAlign objectszobject.alignzAlign ObjectsREGISTERUNDOzHigh Qualityz}Enables high quality but slow calculation of the bounding box for perfect results on complex shape meshes with rotation/scaleT)namedescriptiondefaultr@   z
Align Modez#Side of object to use for alignment))r,   zNegative Sides )r.   Centersrk   )r-   zPositive Sidesrk   r.   )rh   ri   itemsrj   r>   zRelative TozReference location to align to))r,   zScene OriginzIUse the scene origin as the position for the selected objects to align to)r.   z	3D CursorzFUse the 3D cursor as the position for the selected objects to align to)r-   	SelectionzMUse the selected objects as the position for the selected objects to align to)r+   ActivezJUse the active object as the position for the selected objects to align tor+   r?   AlignzAlign to axis))Xrq   rk   )Yrr   rk   )Zrs   rk   	ENUM_FLAG)rh   ri   rm   options
align_axisc                      UR                   S:H  $ )NOBJECT)mode)clsr:   s     r   pollAlignObjects.poll~  s    ||x''r   c           	          U R                   n[        USU;   SU;   SU;   U R                  U R                  U R                  5      nU(       d  U R                  S1S5        S1$ S1$ )Nrq   rr   rs   WARNINGz"No objects with bound-box selected	CANCELLEDFINISHED)rv   ra   r>   r?   r@   report)selfr:   rv   rets       r   executeAlignObjects.execute  sm    __
:::OOOO
 KK%IJ= <r    N)__name__
__module____qualname____firstlineno____doc__	bl_idnamebl_label
bl_optionsrb   __annotations__rc   classmethodr{   r   __static_attributes__r   r   r   re   re   O  s    IHf%J/   9

 	 	 4
 
 
 #

 	 	 ( ( r   re   N)	bpy.typesr   	mathutilsr   r   r(   ra   	bpy.propsrb   rc   re   classesr   r   r   <module>r      sB   
  'DT2Bj^BC 8 C N r   