§
    ¸)ýf—/  ã                   ó  — d Z ddlZddlT ddlT ddlT ddlZd,d„Zd,d„Zd„ Zd	„ Z	d
„ Z
d„ Zee_        ee_        ee_        e	e_        e
e_        ee_        d,d„Zd„ Zd„ Zee_        ee_        ee_        d,d„Zd,d„Zd„ Zd„ Zd„ Zd,d„Zd,d„Z d„ Z!e"fd„Z#d„ Z$e"fd„Z%d„ Z&d„ Z'ee(_)        ee(_*        ee(_+        ee(_,        ee(_-        ee(_.        e e(_/        e!e(_0        e#e(_1        e$e(_2        e%e(_3        e&e(_4        e'e(_5        d„ Z6d„ Z7d„ Z8d„ Z9e6e:_;        e7e:_<        e8e:_=        e9e:_>        d,d „Z?d,d!„Z@e?eA_B        e@eA_C        d,d"„ZDd#„ ZEd,d$„ZFeDeG_H        eEeG_I        eFeG_J        d%„ ZKd&„ ZLeKeM_N        eLeM_O        d'„ ZPd(„ ZQd)„ ZRePZSeQZTeRZUeVZWd*„ ZXd+„ ZYdS )-zf
Native Python wrappers for PyMaterialX, providing a more Pythonic interface
for Elements and Values.
é    Né   )Ú*Ú c                 ób   — t          | |¦  «        sdS |r|                      ¦   «         |k    rdS dS )z¨Return True if this element is an instance of the given subclass.
       If a category string is specified, then both subclass and category
       matches are required.FT)Ú
isinstanceÚgetCategory)ÚselfÚelementClassÚcategorys      úh/home/blender/git/blender-v430/install_release/4.3/python/lib/python3.11/site-packages/MaterialX/main.pyÚ_isAr      sC   € õ �d˜LÑ)Ô)ð ØˆuØð �D×$Ò$Ñ&Ô&¨(Ò2Ð2ØˆuØˆ4ó    c                 óV   — t          | j        d|j        z   ¦  «        } || ||¦  «        S )zJAdd a child element of the given subclass, name, and optional type string.Ú	_addChild©ÚgetattrÚ	__class__Ú__name__)r	   r
   ÚnameÚ
typeStringÚmethods        r   r   r      s/   € å�T”^ [°<Ô3HÑ%HÑIÔI€FØˆ6�$˜˜jÑ)Ô)Ð)r   c                 ó<   — |dk    rdS |                       |¦  «        S )z6Return the child element, if any, with the given name.N)Ú	_getChild©r	   r   s     r   r   r   !   s"   € à�ŠˆØˆtØ�>Š>˜$ÑÔÐr   c                 óT   — t          | j        d|j        z   ¦  «        } || |¦  «        S )zCReturn the child element, if any, with the given name and subclass.Ú_getChildOfTyper   ©r	   r
   r   r   s       r   r   r   '   s.   € å�T”^Ð%6¸Ô9NÑ%NÑOÔO€FØˆ6�$˜ÑÔÐr   c                 óR   — t          | j        d|j        z   ¦  «        } || ¦  «        S )z”Return a list of all child elements that are instances of the given type.
       The returned list maintains the order in which children were added.Ú_getChildrenOfTyper   )r	   r
   r   s      r   r   r   ,   s,   € õ �T”^Ð%9¸LÔ<QÑ%QÑRÔR€FØˆ6�$‰<Œ<Ðr   c                 óX   — t          | j        d|j        z   ¦  «        } || |¦  «         dS )z<Remove the typed child element, if any, with the given name.Ú_removeChildOfTypeNr   r   s       r   r!   r!   2   s4   € å�T”^Ð%9¸LÔ<QÑ%QÑRÔR€FØ
€Fˆ4�ÑÔÐÐÐr   c                 ój   — t          | j        dt          |¦  «        z   ¦  «        } || ||¦  «         dS )z"Set the typed value of an element.Ú	_setValueN©r   r   ÚgetTypeString)r	   Úvaluer   r   s       r   r#   r#   C   s:   € å�T”^ [µ=ÀÑ3GÔ3GÑ%GÑHÔH€FØ
€Fˆ4�˜
Ñ#Ô#Ð#Ð#Ð#r   c                 óZ   — |                       ¦   «         }|r|                     ¦   «         ndS )z%Return the typed value of an element.N)Ú	_getValueÚgetData©r	   r&   s     r   r(   r(   H   s(   € à�NŠNÑÔ€EØ#Ð-ˆ5�=Š=‰?Œ?ˆ?¨Ð-r   c                 óZ   — |                       ¦   «         }|r|                     ¦   «         ndS )z*Return the default value for this element.N)Ú_getDefaultValuer)   r*   s     r   r,   r,   M   s*   € à×!Ò!Ñ#Ô#€EØ#Ð-ˆ5�=Š=‰?Œ?ˆ?¨Ð-r   c                 óh   — t          | j        dt          |¦  «        z   ¦  «        } || |||¦  «        S )ziSet the typed value of an input by its name, creating a child element
       to hold the input if needed.Ú_setInputValuer$   ©r	   r   r&   r   r   s        r   r.   r.   [   s9   € õ �T”^Ð%5½ÀeÑ8LÔ8LÑ%LÑMÔM€FØˆ6�$˜˜e ZÑ0Ô0Ð0r   c                 ó^   — |                       ||¦  «        }|r|                     ¦   «         ndS )z¸Return the typed value of an input by its name, taking both the
       calling element and its declaration into account.  If the given
       input is not found, then None is returned.N)Ú_getInputValuer)   ©r	   r   Útargetr&   s       r   r1   r1   a   s0   € ð ×Ò  fÑ-Ô-€EØ#Ð-ˆ5�=Š=‰?Œ?ˆ?¨Ð-r   c                 ód   — t          j        dt          d¬¦  «         |                      |¦  «        S )z/(Deprecated) Add a Parameter to this interface.úWThis function is deprecated; parameters have been replaced with uniform inputs in 1.38.é   ©Ú
stacklevel©ÚwarningsÚwarnÚDeprecationWarningÚaddInputr   s     r   Ú_addParameterr>   h   s>   € å„MÐkÕmð  OPð  Qñ  Qô  Qð  QØ�=Š=˜ÑÔÐr   c                 óV   — t          j        dt          d¬¦  «         t          ¦   «         S )z7(Deprecated) Return a vector of all Parameter elements.r5   r6   r7   ©r:   r;   r<   Úlist©r	   s    r   Ú_getParametersrC   m   ó5   € å„MÐkÕmð  OPð  Qñ  Qô  Qð  QÝ‰6Œ6€Mr   c                 óV   — t          j        dt          d¬¦  «         t          ¦   «         S )zl(Deprecated) Return a vector of all parameters belonging to this interface, taking inheritance into account.r5   r6   r7   r@   rB   s    r   Ú_getActiveParametersrF   r   rD   r   c                 ó>   — t          j        dt          d¬¦  «         dS )z<(Deprecated) Set the typed value of a parameter by its name.r5   r6   r7   N©r:   r;   r<   ©r	   r   r&   r   s       r   Ú_setParameterValuerJ   w   s8   € å„MÐkÕmð  OPð  Qñ  Qô  Qð  Qð  Qð  Qr   c                 ó>   — t          j        dt          d¬¦  «         dS )z?(Deprecated) Return the typed value of a parameter by its name.r5   r6   r7   NrH   )r	   r   r3   s      r   Ú_getParameterValuerL   {   s1   € å„MÐkÕmð  OPð  Qñ  Qô  Qð  QØˆ4r   c                 ó>   — t          j        dt          d¬¦  «         dS )z@(Deprecated) Return the value string of a parameter by its name.r5   r6   r7   r   rH   r   s     r   Ú_getParameterValueStringrN   €   s1   € å„MÐkÕmð  OPð  Qñ  Qô  Qð  QØˆ2r   c                 óf   — t          j        dt          d¬¦  «         |                      ||¦  «        S )z6(Deprecated) Add a BindInput to this shader reference.ú\This function is deprecated; shader references have been replaced with shader nodes in 1.38.r6   r7   r9   ©r	   r   Útypes      r   Ú_addBindInputrS   …   óD   € å„MÐpõ  sEð  TUð  Vñ  Vô  Vð  VØ�=Š=˜˜tÑ$Ô$Ð$r   c                 ób   — t          j        dt          d¬¦  «         |                      ¦   «         S )zP(Deprecated) Return a vector of all BindInput elements in this shader reference.rP   r6   r7   )r:   r;   r<   Ú	getInputsrB   s    r   Ú_getBindInputsrW   Š   s@   € å„MÐpõ  sEð  TUð  Vñ  Vô  Vð  VØ�>Š>ÑÔÐr   c                 óf   — t          j        dt          d¬¦  «         |                      ||¦  «        S )z6(Deprecated) Add a BindParam to this shader reference.rP   r6   r7   r9   rQ   s      r   Ú_addBindParamrY   �   rT   r   c                 óV   — t          j        dt          d¬¦  «         t          ¦   «         S )zP(Deprecated) Return a vector of all BindParam elements in this shader reference.rP   r6   r7   r@   rB   s    r   Ú_getBindParamsr[   ”   ó9   € å„MÐpõ  sEð  TUð  Vñ  Vô  Vð  VÝ‰6Œ6€Mr   c                 óV   — t          j        dt          d¬¦  «         t          ¦   «         S )zP(Deprecated) Return a vector of all BindToken elements in this shader reference.rP   r6   r7   r@   rB   s    r   Ú_getBindTokensr^   ™   r\   r   c                 ób   — t          j        dt          d¬¦  «         |                      ¦   «         S )z>(Deprecated) Return the first NodeDef that declares this node.z:This function is deprecated; call Node.getNodeDef instead.r6   r7   )r:   r;   r<   Ú
getNodeDefrB   s    r   Ú_getReferencedNodeDefra   ±   s,   € å„MÐNÕPbÐqrÐsÑsÔsÐsØ�?Š?ÑÔÐr   c                 óŠ   — t          j        dt          d¬¦  «         |                      ¦   «                              ||¦  «        S )z=(Deprecated) Add a shader reference to this material element.z^This function is deprecated; material elements have been replaced with material nodes in 1.38.r6   r7   )r:   r;   r<   Ú	getParentÚaddNode)r	   r   ÚnodeNames      r   Ú_addShaderRefrf   ¶   sP   € å„MÐrõ  uGð  VWð  Xñ  Xô  Xð  XØ�>Š>ÑÔ×#Ò# H¨dÑ3Ô3Ð3r   c                 óX   — t          j        dt          d¬¦  «         t          | ¦  «        S )zO(Deprecated) Return a vector of all shader references in this material element.rP   r6   r7   ©r:   r;   r<   ÚgetShaderNodesrB   s    r   Ú_getShaderRefsrj   »   ó>   € å„MÐpõ  sEð  TUð  Vñ  Vô  Vð  VÝ˜$ÑÔÐr   c                 óX   — t          j        dt          d¬¦  «         t          | ¦  «        S )zy(Deprecated) Return a vector of all shader references in this material element, taking material inheritance into account.rP   r6   r7   rh   rB   s    r   Ú_getActiveShaderRefsrm   À   rk   r   c                 óh   — t          | j        dt          |¦  «        z   ¦  «        } || |||¦  «        S )znSet the typed value of a property by its name, creating a child element
       to hold the property if needed.Ú_setPropertyValuer$   r/   s        r   ro   ro   Ï   ó9   € õ �T”^Ð%8½=ÈÑ;OÔ;OÑ%OÑPÔP€FØˆ6�$˜˜e ZÑ0Ô0Ð0r   c                 ó\   — |                       |¦  «        }|r|                     ¦   «         ndS )ztReturn the typed value of a property by its name.  If the given property
       is not found, then None is returned.N)Ú_getPropertyValuer)   r2   s       r   rr   rr   Õ   s.   € ð ×"Ò" 4Ñ(Ô(€EØ#Ð-ˆ5�=Š=‰?Œ?ˆ?¨Ð-r   c                 óh   — t          | j        dt          |¦  «        z   ¦  «        } || |||¦  «        S )zhSet the value of a geomprop by its name, creating a child element
       to hold the geomprop if needed.Ú_setGeomPropValuer$   r/   s        r   rt   rt   ã   rp   r   c                 ód   — t          j        dt          d¬¦  «         |                      |¦  «        S )z,(Deprecated) Add a geomprop to this element.z@This function is deprecated; call GeomInfo.addGeomProp() insteadr6   r7   )r:   r;   r<   ÚaddGeomPropr   s     r   Ú_addGeomAttrrw   é   s0   € å„MÐTÕVhÐwxÐyÑyÔyÐyØ×Ò˜DÑ!Ô!Ð!r   c                 óh   — t          j        dt          d¬¦  «         |                      |||¦  «        S )z5(Deprecated) Set the value of a geomattr by its name.zEThis function is deprecated; call GeomInfo.setGeomPropValue() insteadr6   r7   )r:   r;   r<   ÚsetGeomPropValuerI   s       r   Ú_setGeomAttrValuerz   î   s4   € å„MÐYÕ[mÐ|}Ð~Ñ~Ô~Ð~Ø× Ò   u¨jÑ9Ô9Ð9r   c                 ód   — t          j        dt          d¬¦  «         |                      |¦  «        S )z4(Deprecated) Add a material element to the document.zEThis function is deprecated; call Document.addMaterialNode() instead.r6   r7   )r:   r;   r<   ÚaddMaterialNoder   s     r   Ú_addMaterialr}   ü   s0   € å„MÐYÕ[mÐ|}Ð~Ñ~Ô~Ð~Ø×Ò Ñ%Ô%Ð%r   c                 ób   — t          j        dt          d¬¦  «         |                      ¦   «         S )z>(Deprecated) Return a vector of all materials in the document.zFThis function is deprecated; call Document.getMaterialNodes() instead.r6   r7   )r:   r;   r<   ÚgetMaterialNodesrB   s    r   Ú_getMaterialsr€     s.   € å„MÐZÕ\nÐ}~ÐÑÔÐØ× Ò Ñ"Ô"Ð"r   c                 óh   — t          j        dt          d¬¦  «         t           | ¦   «         ¦  «        S )zT(Deprecated) Return the MaterialX type string associated with the given Python type.zBThis function is deprecated; call MaterialX.getTypeString instead.r6   r7   )r:   r;   r<   r%   )Úts    r   Ú_typeToNamerƒ     s0   € å„MÐVÕXjÐyzÐ{Ñ{Ô{Ð{Ý˜˜™œÑÔÐr   c                 óX   — t          j        dt          d¬¦  «         t          | ¦  «        S )zO(Deprecated) Convert a Python value to its correponding MaterialX value string.zCThis function is deprecated; call MaterialX.getValueString instead.r6   r7   )r:   r;   r<   ÚgetValueString)r&   s    r   Ú_valueToStringr†     s*   € å„MÐWÕYkÐz{Ð|Ñ|Ô|Ð|Ý˜%Ñ Ô Ð r   c                 ó„   — t          j        dt          d¬¦  «         t          | t	           |¦   «         ¦  «        ¦  «        S )z`(Deprecated) Convert a MaterialX value string and Python type to the corresponding Python value.zKThis function is deprecated; call MaterialX.createValueFromStrings instead.r6   r7   )r:   r;   r<   ÚcreateValueFromStringsr%   )Ústringr‚   s     r   Ú_stringToValuerŠ     sJ   € å„MÐ_Õasð  CDð  Eñ  Eô  Eð  EÝ! &­-¸¸¹¼Ñ*<Ô*<Ñ=Ô=Ð=r   c                  ód   — t          t          j                             t          ¦  «        ¦  «        S )z.
    Return the default data search path.
    )ÚFileSearchPathÚosÚpathÚdirnameÚ__file__© r   r   ÚgetDefaultDataSearchPathr’   -  s    € õ �"œ'Ÿ/š/­(Ñ3Ô3Ñ4Ô4Ð4r   c                  ó   — dgS )z5
    Return list of default data library folders
    Ú	librariesr‘   r‘   r   r   ÚgetDefaultDataLibraryFoldersr•   3  s   € ð ˆ?Ðr   )r   )ZÚ__doc__r:   ÚPyMaterialXCoreÚPyMaterialXFormatÚdatatyper�   r   r   r   r   r   r!   ÚElementÚisAÚaddChildÚgetChildÚgetChildOfTypeÚgetChildrenOfTypeÚremoveChildOfTyper#   r(   r,   ÚValueElementÚsetValueÚgetValueÚgetDefaultValuer.   r1   r>   rC   rF   rJ   rL   rN   ÚDEFAULT_TYPE_STRINGrS   rW   rY   r[   r^   ÚInterfaceElementÚsetInputValueÚgetInputValueÚaddParameterÚgetParametersÚgetActiveParametersÚsetParameterValueÚgetParameterValueÚgetParameterValueStringÚaddBindInputÚgetBindInputsÚaddBindParamÚgetBindParamsÚgetBindTokensra   rf   rj   rm   ÚNodeÚgetReferencedNodeDefÚaddShaderRefÚgetShaderRefsÚgetActiveShaderRefsro   rr   ÚPropertySetÚsetPropertyValueÚgetPropertyValuert   rw   rz   ÚGeomInfory   ÚaddGeomAttrÚsetGeomAttrValuer}   r€   ÚDocumentÚaddMaterialÚgetMaterialsrƒ   r†   rŠ   Ú
typeToNameÚvalueToStringÚstringToValueÚreadFromXmlFileBaseÚreadFromXmlFiler’   r•   r‘   r   r   ú<module>rÇ      s  ððð ð
 €€€à Ð Ð Ð Ø  Ð  Ð  Ð  Ø Ð Ð Ð Ø 	€	€	€	ðð ð ð ð*ð *ð *ð *ð
 ð  ð  ðð ð ð
ð ð ðð ð ð
 €„Ø€Ô Ø€Ô Ø(€Ô Ø.€Ô Ø.€Ô ð$ð $ð $ð $ð
.ð .ð .ð
.ð .ð .ð
 "€Ô Ø!€Ô Ø/€Ô ð1ð 1ð 1ð 1ð.ð .ð .ð .ðð ð ð
ð ð ð
ð ð ð
Qð Qð Qð Qðð ð ð ð
ð ð ð
 &9ð %ð %ð %ð %ð
ð ð ð
 &9ð %ð %ð %ð %ð
ð ð ð
ð ð ð
 "0Ð Ô Ø!/Ð Ô Ø -Ð Ô Ø!/Ð Ô Ø';Ð Ô $Ø%7Ð Ô "Ø%7Ð Ô "Ø+CÐ Ô (Ø -Ð Ô Ø!/Ð Ô Ø -Ð Ô Ø!/Ð Ô Ø!/Ð Ô ðð ð ð
4ð 4ð 4ð
 ð  ð  ð
 ð  ð  ð
 2€Ô Ø!€Ô Ø#€Ô Ø/€Ô ð1ð 1ð 1ð 1ð.ð .ð .ð .ð  1€Ô Ø0€Ô ð1ð 1ð 1ð 1ð"ð "ð "ð
:ð :ð :ð :ð
 .€Ô Ø#€Ô Ø-€Ô ð&ð &ð &ð
#ð #ð #ð
 $€Ô Ø%€Ô ðð ð ð
!ð !ð !ð
>ð >ð >ð
 €
Ø€Ø€ð &€ð5ð 5ð 5ðð ð ð ð r   