Dorian Fevrier's blog - Mot-clé - interfaceJe m’appelle FEVRIER Dorian, je suis infographiste 3D passionné par mon métier, l’informatique en général, l’internet, la programmation et l’évolution de tout ce petit monde. Vous trouverez sur ce blog des tutoriaux, mes coups de cœurs, avis, etc.2024-01-02T23:48:05+01:00FEVRIER Dorianurn:md5:695d9c73474c33ce3dab043823509c4bDotclearCréer une interface rapidement pour Maya 2011 via loadUIurn:md5:cff106445dce70d154e727c3359ed66f2011-03-23T00:44:00+01:002013-07-26T18:11:18+02:00NarannScript et codefrguiinterfacemayamelpyqtpythonqtscript<p><img src="https://www.fevrierdorian.com/blog/public/logos/QtPython_logo001.png" alt="QtPython_logo001.png" style="float:left; margin: 0 1em 1em 0;" title="QtPython_logo001.png, juil. 2009" height="150" width="150" />Aujourd'hui je vous propose un petit tuto sur une nouvelle méthode, depuis dans Maya 2011, pour faire des interfaces avec Qt Designer (via la commande loadUI).</p>
<p>Je vous montrerai le principe, et on attaquera avec un exemple concret. Nous verrons donc les avantages et inconvénients de cette technique.</p>
<p>Vous allez voir que la vérité autour de cette nouvelle <em>feature</em> n'est pas aussi jolie qu'elle le laisse croire.</p>
<p>J'espère que vous apprécierez! :sourit:</p> <ul>
<li><a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#la_base">La base</a>
<ul>
<li><a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#precision_qt">Précisions importantes concernant Qt</a>
<ul>
<li><a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#framework_qt">Le framework Qt</a></li>
<li><a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#qt_dans_maya">Le "Qt dans Maya"</a></li>
<li><a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#pyqt">PyQt</a></li>
</ul></li>
<li><a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#conclusion">Conclusion</a></li>
</ul></li>
<li><a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#la_pratique">La pratique</a>
<ul>
<li><a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#qt_designer">Qt Designer</a></li>
<li><a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#le_script">Le script</a>
<ul>
<li><a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#charger_interface_dans_maya">Charger son interface dans maya</a></li>
<li><a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#la_hierarchie">La hierarchie</a></li>
<li><a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#executer_du_code_python">Exécuter du code python</a></li>
<li><a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#note_concernant_noms_widgets">Note concernant les noms des widgets</a></li>
</ul></li>
<li><a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#cas_divers">Cas divers</a>
<ul>
<li><a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#interagir_avec_interface">Interagir avec l'interface</a></li>
<li><a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#integrer_widget_mel">Intégrer un widget MEL dans un .ui</a></li>
<li><a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#un_mot_sur_les_layouts">Un mot sur les layouts</a></li>
</ul></li>
</ul></li>
</ul>
<h3>La base <a name="la_base"></a></h3>
<p>Si Maya a tiré son épingle du jeu dans le milieu des années 90, c'est en grande partie grâce à l'ouverture qu'il offrait. Le <a href="http://fr.wikipedia.org/wiki/Mel_%28langage%29">MEL</a> était un avantage indéniable sur la concurrence.</p>
<p>Mais c'est surtout la possibilité de scripter des interfaces assez évoluées, sans avoir de compétences en programmation, qui l'a rendu indispensable aux graphistes un peu techniques.</p>
<p>Cela dit, si coder une interface en script en 95 était une révolution, on peut dire qu'en 2011 c'est un peu dépassé, même pour un "vrai" développeur.</p>
<p>En effet, les frameworks d'interface (sortes de grosses librairies de code) ont énormément évolués, gagnant en flexibilité, et avec toujours le même objectif: "Code less, create more".</p>
<p>C'est dans ce contexte qu'est "née" (notez que j'utilise les guillemets) la commande <a href="http://download.autodesk.com/us/maya/2011help/CommandsPython/loadUI.html">loadUI</a>.</p>
<h4>Précisions importantes concernant Qt <a name="precision_qt"></a></h4>
<p>Comme vous le savez sûrement, depuis Maya 2011, le framework utilisé pour l'interface (et sûrement, à l'avenir beaucoup d'autres choses) est Qt (prononcez à l'anglaise: "Quioute").</p>
<p>Je ne vais pas m'étaler sur ce framework mais je vous encourage à lire <a href="http://www.siteduzero.com/tutoriel-3-11240-introduction-a-qt.html">cette très bonne présentation</a> du "Site du zéro" (Et je vous encourage à y rester et fouiller un peu :sourit: ).</p>
<p>En revanche je vais passer plus de temps sur un point qui me semble important car j'ai entendu énormément de graphistes se planter en parlant de "Qt dans Maya", et pour cause, c'est assez subtil. Vous allez voir. :sourit:</p>
<p>Il faut distinguer deux choses (voir trois):</p>
<ul>
<li>Le framework Qt.</li>
<li>Le "Qt dans Maya".</li>
<li>PyQt (pour ceux qui travaillent dans des studios qui l'utilisent).</li>
</ul>
<h5>Le framework Qt <a name="framework_qt"></a></h5>
<p>Ça, c'est la librairie multiplateforme C++ dont je parle plus haut, le framework, le vrai.</p>
<p><img src="https://www.fevrierdorian.com/blog/public/logos/Qt_logo002.png" alt="Qt_logo002.png" style="display:block; margin:0 auto;" title="Qt_logo002.png, juil. 2009" height="217" width="217" /></p>
<p>C'est "ce" Qt qu'utilise les <del>branquignoles</del> développeurs de chez Autodesk quand ils compilent Maya (là, je viens de pourrir ma carrière à l’international avec ma blague minable/facile/pas drôle :baffed: ). Le viewport 2.0 est sûrement le fruit de l'utilisation de ce framework, comme pleins de petites features qui sont apparues avec Maya 2011.</p>
<p>Celle là, vous n'y avez pas accès "simplement"! Vous ne pouvez pas scripter des threads, ouvrir un contexte OpenGL, afficher des SVG, accéder à une base de données SQL, gérer des certificats SSL, créer vos propres widget, etc...</p>
<p>L'API de Maya permet de passer par une classe (<a href="http://download.autodesk.com/us/maya/2011help/API/class_m_qt_util.html">MQtUtil</a>) pour accéder de manière plus poussé aux "controls" (interface). Mais de ce que j'en lis, il n'y a rien de bien folichon. Pas d'accès direct à Qt. :nervous:</p>
<h5>Le "Qt dans Maya" <a name="qt_dans_maya"></a></h5>
<p>Je ne compte plus le nombre de fois ou j'ai pu entendre: "On peut faire du Qt dans Maya 2011!" (à chantonner sur un ton guilleret et jovial parce que c'est <em>new</em> et que ça <em>a l'air bien</em> :marioCours: ).</p>
<p><img src="https://www.fevrierdorian.com/blog/public/logos/maya_logo_bigcrop_w590_1_.jpg" alt="maya_logo_bigcrop_w590_1_.jpg" style="display:block; margin:0 auto;" title="maya_logo_bigcrop_w590_1_.jpg, janv. 2009" height="286" width="590" /></p>
<p>La vérité, c'est qu'on peut faire du Qt (PyQt pour être exact) <a href="https://www.fevrierdorian.com/blog/post/2009/07/01/Utiliser-PyQt4-dans-Maya">depuis Maya 2008</a>. Depuis qu'on peut faire du Python dans Maya en fait... J'y reviendrai.</p>
<p>- "Mais pourtant si! Regarde, le mec sur internet, il utilise Qt Designer pour faire son interface, il clique et là... Oaaaaah! Il la charge dans Maya!"</p>
<p>Et nous y voila!</p>
<p>Si la définition de "faire du Qt" veut dire utiliser Qt Designer pour faire son interface et la charger, alors oui, on peut faire du Qt dans Maya.</p>
<p>Mais comme vous l'avez lu plus haut dans ce billet, Qt c'est beaucoup plus que ça (en fait ce n'est même pas ça).</p>
<p>- "Mais alors il fait quoi de ce fichier Qt Designer?"</p>
<p>Il le converti en MEL (ou en Python de Maya).</p>
<p>- "Wait! Wft! o_O"</p>
<p>Et oui, ce n'est pas super sexy mais c'est pourtant la vérité. Et pour vous le prouver, voici une citation <a href="http://download.autodesk.com/us/maya/2011help/files/WS73099cc142f48755527cc80126d167ffa2-7170.htm">de la doc</a>:</p>
<blockquote><p>The loadUI command creates the widgets specified in the file by executing their corresponding Maya commands.</p></blockquote>
<p>Ok, sauf que si le widget en question n'a pas d'équivalent en MEL, il fait quoi? Et bien il ne le créé pas!</p>
<blockquote><p>If the loadUI command encounters a Qt widget for which there is no equivalent Maya control, the Qt widget is still created, but you cannot access it from MEL or Python scripts.</p></blockquote>
<center><i>Mange!</i></center>
<p>Et ça va même plus loin! :injures:</p>
<p>Démonstration:</p>
<p><img src="https://www.fevrierdorian.com/blog/public/billets/2011_16_03_interface_Maya2011_loadUI/interface_Maya2011_loadUI_001.png" alt="interface_Maya2011_loadUI_001.png" style="display:block; margin:0 auto;" title="interface_Maya2011_loadUI_001.png, mar. 2011" height="173" width="589" /></p>
<center><i>Dans Qt Designer.</i></center>
<p>Notez l'utilisation d'un <em>QStakedWidget</em> (les deux petites flèches noires en haut à droite)</p>
<p><img src="https://www.fevrierdorian.com/blog/public/billets/2011_16_03_interface_Maya2011_loadUI/interface_Maya2011_loadUI_002.png" alt="interface_Maya2011_loadUI_002.png" style="display:block; margin:0 auto;" title="interface_Maya2011_loadUI_002.png, mar. 2011" height="186" width="593" /></p>
<center><i>Dans Maya.</i></center>
<p>Les deux flèches ont disparu!</p>
<p>Bon, on s'en fout de ce widget (De toute façon personne ne l'utilise :baffed: ) mais l'idée est surtout de montrer qu'un QWidget qui n'existe pas dans Maya (pas d'équivalences MEL) est soit créé mais il est impossible d'y accéder, soit n'est pas être créé du tout!</p>
<p>Le log est aussi assez explicite:</p>
<pre>
# Creating a QStackedWidget named "stackedWidget". #
# Creating a QWidget named "page_3". #
# Creating a QGroupBox named "groupBox". #
# Creating a QmayaCheckBox named "checkBox_2". #
# Creating a QmayaCheckBox named "checkBox_3". #
# Creating a QWidget named "page_4". #
# Creating a QPushButton named "pushButton". #
# Creating a QmayaCheckBox named "checkBox". #
# There is no Maya command for objects of type QVBoxLayout. #
# There is no Maya command for objects of type QVBoxLayout. #
# There is no Maya command for objects of type QStackedLayout. #
# There is no Maya command for objects of type QVBoxLayout. #
# There is no Maya command for objects of type QVBoxLayout. #
</pre>
<center>Tiens donc! Des <i>QmayaCheckBox</i>... :siffle: </center>
<p>Bref, vous l'aurez compris, "Qt dans Maya" ça veut bien dire ce que ça veut dire: C'est Qt encastré dans Maya. Et c'est Maya qui décide comment on l'utilise. Autrement dit, c'est du MEL...</p>
<h5>PyQt <a name="pyqt"></a></h5>
<p>Et voici le dernier le la liste. Qui c'est quoi qu'est-ce?</p>
<p><img src="https://www.fevrierdorian.com/blog/public/logos/RiverBanklogo.png" alt="RiverBanklogo.png" style="display:block; margin:0 auto;" title="RiverBanklogo.png, juil. 2009" height="100" width="100" /></p>
<p><a href="http://www.riverbankcomputing.co.uk/software/pyqt">PyQt</a> est le binding Python de Qt (enfin un des bindings, vu que Nokia a décidé, <a href="http://linuxfr.org/news/pyside-python-et-qt-par-nokia">pour des raisons de licence</a>, de faire le sien, qui de toute façon, a peine fini, <a href="http://www.developpez.net/forums/d1124055/autres-langages/python-zope/gui/pyside-pyqt/projet-pyside-danger/" hreflang="fr">n'a plus d'avenir</a>).</p>
<p>Pour résumer, ça permet de faire du <em>vrai</em> Qt avec la syntaxe Python. Et comme on peut intégrer, dans Maya, n'importe quelle lib Python du moment qu'elle utilise la même version, on peut faire du PyQt dans Maya.</p>
<p>C'est particulièrement puissant pour les TDs (pas de connaissances en C++ requises). Toute les classes de la lib d'origine sont disponibles.</p>
<p>Et quand un graphiste arrive dans un studio qui utilise PyQt, il y a 90% de chance qu'il fasse un amalgame entre PyQt et le "Qt de Maya".</p>
<center>:reflechi:</center>
<h4>Conclusion <a name="conclusion"></a></h4>
<p><strong>Le fait que Maya utilise Qt ne veut pas dire qu'on peut faire du Qt dans Maya!</strong></p>
<p>C'est Maya qui "fait du Qt" et vous qui utilisez Maya.</p>
<h3>La pratique <a name="la_pratique"></a></h3>
<p>Bon assez de blabla, passons à la pratique! :gniarkgniark:</p>
<h4>Qt Designer <a name="qt_designer"></a></h4>
<p>Pour faire une zolie n'interface, il faut utiliser Qt Designer. Malgré son apparente simplicité, il nécessite un certains temps d'adaptation avant de pouvoir sortir des UI convenables.</p>
<p>Vous devez être à l'aise avec les notions de "layout" notamment.</p>
<p>Une fois de plus, je vous invite à lire <a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#http://www.siteduzero.com/tutoriel-3-11360-modeliser-ses-fenetres-avec-qt-designer.html">le tuto</a> du "site du zéro" qui fait une très bonne présentation.</p>
<p>N'hésitez pas à vous chercher un peu sur le net, il y a beaucoup de tuto/sujets sur Qt Designer (Hop! <a href="http://www.programmez.com/tutoriels.php?titre=Dessiner-un-widget-avec-Qt-Designer-4&tutoriel=53">Encore un</a>!)</p>
<p>Voici une vidéo très bien faite (anglais):</p>
<iframe title="YouTube video player" width="640" height="390" src="http://www.youtube.com/embed/LYF0spYkXUs?hd=1" frameborder="0" allowfullscreen></iframe>
<p>Glissez quelques widgets dans votre interface, faites Ctrl+R pour faire quelques tests puis sauvegardez votre fichier ".ui".</p>
<p><img src="https://www.fevrierdorian.com/blog/public/billets/2011_16_03_interface_Maya2011_loadUI/interface_Maya2011_loadUI_003.png" alt="interface_Maya2011_loadUI_003.png" style="display:block; margin:0 auto;" title="interface_Maya2011_loadUI_003.png, mar. 2011" height="411" width="545" /></p>
<h4>Le script <a name="le_script"></a></h4>
<p>C'est maintenant qu'on attaque Maya! :gniarkgniark:</p>
<h5>Charger son interface dans maya <a name="charger_interface_dans_maya"></a></h5>
<p>Pour lancer notre fenêtre faite avec Qt Designer, il faut lancer la nouvelle commande de Maya 2011: <a href="http://download.autodesk.com/us/maya/2011help/CommandsPython/loadUI.html">loadUI</a>.</p>
<p>Pour cela, rien de plus simple:</p>
<pre class="python python"><span style="color: #ff7700;font-weight:bold;">import</span> maya.<span style="color: #dc143c;">cmds</span> <span style="color: #ff7700;font-weight:bold;">as</span> <span style="color: #dc143c;">cmds</span>
mainWin = <span style="color: #dc143c;">cmds</span>.<span style="color: black;">loadUI</span><span style="color: black;">(</span> uiFile=<span style="color: #483d8b;">"monFichier.ui"</span> <span style="color: black;">)</span>
<span style="color: #dc143c;">cmds</span>.<span style="color: black;">showWindow</span><span style="color: black;">(</span> mainWin <span style="color: black;">)</span></pre>
<p>Et voici notre fenêtre:</p>
<p><img src="https://www.fevrierdorian.com/blog/public/billets/2011_16_03_interface_Maya2011_loadUI/interface_Maya2011_loadUI_004.png" alt="interface_Maya2011_loadUI_004.png" style="display:block; margin:0 auto;" title="interface_Maya2011_loadUI_004.png, mar. 2011" height="309" width="342" /></p>
<p>Maintenant que vous savez comment charger votre interface dans Maya, voyons comment demander à un bouton d'exécuter une commande.</p>
<p>Mais juste avant on va structurer un peu nos fichiers. :nannan:</p>
<h5>La hierarchie <a name="la_hierarchie"></a></h5>
<p>Pour organiser notre code, on va faire simple. Dans votre:</p>
<pre class="bash bash">C:\Users\userName\Documents\maya\scripts</pre>
<p>Placez les deux fichiers suivants:</p>
<ul>
<li>myScript.ui contient le fichier Qt Designer.</li>
<li>myScript.py contient les éléments qui appellent l'interface ainsi que les scripts appelés par l'interface elle même.</li>
</ul>
<p>Dans myScript.py, il est fortement conseillé de séparé la classe de l'ui + lib:</p>
<pre class="python python"><span style="color: #ff7700;font-weight:bold;">import</span> maya.<span style="color: #dc143c;">cmds</span> <span style="color: #ff7700;font-weight:bold;">as</span> <span style="color: #dc143c;">cmds</span>
uiFilePath = <span style="color: #483d8b;">"C:/Users/userName/Documents/maya/scripts/myScript.ui"</span> <span style="color: #808080; font-style: italic;"># le fichier ui</span>
<span style="color: #ff7700;font-weight:bold;">class</span> ui<span style="color: black;">(</span><span style="color: black;">)</span> :
<span style="color: #483d8b;">"""Classe principale de l'interface"""</span>
<span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">(</span> <span style="color: #008000;">self</span> <span style="color: black;">)</span> :
<span style="color: #483d8b;">"""Initialise l'interface"""</span>
<span style="color: #008000;">self</span>.<span style="color: black;">lib</span> = lib<span style="color: black;">(</span><span style="color: black;">)</span>
<span style="color: #008000;">self</span>.<span style="color: black;">mainWin</span> = <span style="color: #dc143c;">cmds</span>.<span style="color: black;">loadUI</span><span style="color: black;">(</span> uiFile=uiFilePath <span style="color: black;">)</span>
<span style="color: #dc143c;">cmds</span>.<span style="color: black;">showWindow</span><span style="color: black;">(</span> <span style="color: #008000;">self</span>.<span style="color: black;">mainWin</span> <span style="color: black;">)</span>
<span style="color: #ff7700;font-weight:bold;">def</span> toto<span style="color: black;">(</span> <span style="color: #008000;">self</span>, <span style="color: #66cc66;">*</span>arg <span style="color: black;">)</span> :
<span style="color: #483d8b;">"""Fonction d'exemple qui utilise la lib"""</span>
<span style="color: #008000;">self</span>.<span style="color: black;">lib</span>.<span style="color: black;">doSomething</span><span style="color: black;">(</span><span style="color: black;">)</span>
<span style="color: #ff7700;font-weight:bold;">class</span> lib<span style="color: black;">(</span><span style="color: black;">)</span> :
<span style="color: #483d8b;">"""Classe principale de le lib"""</span>
<span style="color: #ff7700;font-weight:bold;">def</span> doSomething<span style="color: black;">(</span> <span style="color: #008000;">self</span> <span style="color: black;">)</span> :
<span style="color: #483d8b;">"""Fonction simple qui print quelque chose"""</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">"toto"</span></pre>
<p>Le tout s'exécute dans Maya:</p>
<pre class="python python"><span style="color: #ff7700;font-weight:bold;">import</span> myScript
<span style="color: #008000;">reload</span><span style="color: black;">(</span>myScript<span style="color: black;">)</span>
myScript.<span style="color: black;">ui</span><span style="color: black;">(</span><span style="color: black;">)</span></pre>
<p>Cette méthode permet de bien séparer le comportement de l'interface de celui de Maya:</p>
<ul>
<li>L'UI communique avec la lib.</li>
<li>La lib communique avec Maya.</li>
</ul>
<p>La lib ne doit jamais agir sur l'interface. C'est l'interface qui se modifie suivant ce que lui dit la lib. (<a href="http://www.chucknorrisfacts.fr/index.php?p=detail_fact&fact=66">Ça me rappelle</a> un Chuck Norris fact tiens :seSentCon: )</p>
<h5>Exécuter du code python <a name="executer_du_code_python"></a></h5>
<p>Vous pouvez définir des appels à des fonctions MEL ou Python directement depuis Qt Designer:</p>
<p>Comme <a href="http://download.autodesk.com/us/maya/2011help/files/WS73099cc142f48755527cc80126d167ffa2-7170.htm">indiqué dans la doc</a>, il faut ajouter un attribut dynamique.</p>
<p>Sélectionnez un boutton et faites:</p>
<p><img src="https://www.fevrierdorian.com/blog/public/billets/2011_16_03_interface_Maya2011_loadUI/interface_Maya2011_loadUI_005.png" alt="interface_Maya2011_loadUI_005.png" style="display:block; margin:0 auto;" title="interface_Maya2011_loadUI_005.png, mar. 2011" height="174" width="536" /></p>
<p><img src="https://www.fevrierdorian.com/blog/public/billets/2011_16_03_interface_Maya2011_loadUI/interface_Maya2011_loadUI_006.png" alt="interface_Maya2011_loadUI_006.png" style="display:block; margin:0 auto;" title="interface_Maya2011_loadUI_006.png, mar. 2011" height="185" width="382" /></p>
<center><i>Notez l'utilisation du "+" pour préciser que l'argument qu'on va lui donner sera un argument Python.</i></center>
<p>Si dans le cas du MEL (qui n'est pas un langage objet) le fait d'entrer le nom complet de la commande à exécuter ne pose pas de soucis (c'est même comme ça qu'il faut faire), en Python, le fait de ne pas pouvoir passer un <em>objet</em> (au sens <em>programmation</em>) à son interface est assez problématique.</p>
<p>En effet, si vous passez <em>self.toto</em> vous aurez une jolie erreur lors du lancement:</p>
<p><img src="https://www.fevrierdorian.com/blog/public/billets/2011_16_03_interface_Maya2011_loadUI/interface_Maya2011_loadUI_007.png" alt="interface_Maya2011_loadUI_007.png" style="display:block; margin:0 auto;" title="interface_Maya2011_loadUI_007.png, mar. 2011" height="82" width="281" /></p>
<pre class="python python"><span style="color: #808080; font-style: italic;"># Error: name 'self' is not defined</span>
<span style="color: #808080; font-style: italic;"># Traceback (most recent call last):</span>
<span style="color: #808080; font-style: italic;"># File "<maya console>", line 1, in <module></span>
<span style="color: #808080; font-style: italic;"># NameError: name 'self' is not defined #</span></pre>
<p>Le soucis c'est que l'interface n'a pas d'accès à la classe. Donc impossible d'utiliser <em>self.toto</em> facilement.</p>
<p>Vous pouvez toujours ne pas utiliser les <em>objets</em> avec Python. Vous pourrez donc ne donner que le nom de la fonction à lancer. Mais c'est très dommage de ne pas utiliser la puissance des classes. :redface:</p>
<p>Mais alors, comment lancer une commande tel que <em>self.toto</em> avec cette méthode?</p>
<p>Et bien on <em>édite</em> le bouton (ou le widget à modifier) dans le code. On "repasse" dessus une fois qu'il est créé.</p>
<p>En effet, <em>loadUI</em> conserve les noms des widgets donné dans le <em>.ui</em>. Vous pouvez donc les appeler et les modifier dans votre code une fois le loadUI fait:</p>
<p><img src="https://www.fevrierdorian.com/blog/public/billets/2011_16_03_interface_Maya2011_loadUI/interface_Maya2011_loadUI_008.png" alt="interface_Maya2011_loadUI_008.png" style="display:block; margin:0 auto;" title="interface_Maya2011_loadUI_008.png, mar. 2011" height="162" width="304" /></p>
<blockquote><p>Note: N'oubliez pas de supprimer l'attribut dynamique que nous avons créé plus haut (+command). En effet, il est impossible de redéclarer un attribut si il est déjà setté dans le fichier .ui.</p></blockquote>
<pre class="python python"><span style="color: #008000;">self</span>.<span style="color: black;">mainWin</span> = <span style="color: #dc143c;">cmds</span>.<span style="color: black;">loadUI</span><span style="color: black;">(</span> uiFile=uiFilePath <span style="color: black;">)</span>
<span style="color: #808080; font-style: italic;"># add callbacks</span>
<span style="color: #dc143c;">cmds</span>.<span style="color: black;">button</span><span style="color: black;">(</span> <span style="color: #483d8b;">"totoPushButton"</span>, edit=<span style="color: #008000;">True</span>, command=<span style="color: #008000;">self</span>.<span style="color: black;">toto</span> <span style="color: black;">)</span> <span style="color: #808080; font-style: italic;"># on modifie le button "totoPushButton" cree dans Qt Designer</span>
<span style="color: #dc143c;">cmds</span>.<span style="color: black;">showWindow</span><span style="color: black;">(</span> <span style="color: #008000;">self</span>.<span style="color: black;">mainWin</span> <span style="color: black;">)</span></pre>
<p>Et oui... C'est assez assez <del>con</del> subtil vous en conviendrez mais il semble qu'on ait pas le choix... :nousfesonslemal:</p>
<p>Cliquez sur le bouton, vous devriez voir "toto" s'écrire dans le script editor.</p>
<h5>Note concernant les noms des widgets <a name="note_concernant_noms_widgets"></a></h5>
<p>Il est important de connaitre les limites concernant l'utilisation des noms des widgets des fichiers .ui dans Maya.</p>
<p>En effet, si Maya s'apprète à créer un widget qui a le nom qu'un widget déja présent dans votre session, Maya le renommera (souvent en ajoutant un chiffre derrière).</p>
<p>Il faut donc être rigoureux sur la gestion de ses widgets dans Maya. La meilleure solution consistant à supprimer la fenetre principale avant d'en recharger une nouvelle.</p>
<p>L'idée étant qu'aucun nom ne rentre en collision avec un autre. :reflechi:</p>
<p>Je n'ai pas essayé de construire des fenêtres "à la volée" (l'interface génère ses propres fenètres) via loadUI mais aux vues du fonctionnement, on ne peut utiliser qu'une seule instance.</p>
<h4>Cas divers <a name="cas_divers"></a></h4>
<p><a href="https://www.fevrierdorian.com/blog/public/billets/2011_16_03_interface_Maya2011_loadUI/caddies_vert_crop_small.jpg" title="caddies_vert_crop_small.jpg"><img src="https://www.fevrierdorian.com/blog/public/billets/2011_16_03_interface_Maya2011_loadUI/.caddies_vert_crop_small_m.jpg" alt="caddies_vert_crop_small.jpg" style="display:block; margin:0 auto;" title="caddies_vert_crop_small.jpg, mar. 2011" height="420" width="560" /></a></p>
<center><small><i><a href="http://www.flickr.com/photos/piaser/4515886094/">Photo</a> par <a href="http://www.flickr.com/photos/piaser/">gwenflickr</a> sous licence Créative <a href="http://creativecommons.org/licenses/by-nc-sa/2.0/deed.fr">by-nc-sa</a>. Merci à lui! :sourit:</i></small></center>
<p>Ici, je vous propose des solutions rapides à la plupart des cas particuliers qu'on rencontre.</p>
<h5>Interagir avec l'interface <a name="interagir_avec_interface"></a></h5>
<p>Comme les noms restent valides, on peut aussi s'en servir pour modifier un widget.</p>
<pre class="python python"><span style="color: #808080; font-style: italic;"># change l'etat d'une checkBox</span>
<span style="color: #dc143c;">cmds</span>.<span style="color: black;">checkBox</span><span style="color: black;">(</span> <span style="color: #483d8b;">"myCheckBox"</span>, edit=<span style="color: #008000;">True</span>, value=<span style="color: #ff4500;">0</span> <span style="color: black;">)</span></pre>
<pre class="python python"><span style="color: #808080; font-style: italic;"># ajoute un element a la liste</span>
<span style="color: #dc143c;">cmds</span>.<span style="color: black;">textScrollList</span><span style="color: black;">(</span> <span style="color: #483d8b;">"myTextScrollList"</span>, edit=<span style="color: #008000;">True</span>, append=<span style="color: #483d8b;">"un element"</span> <span style="color: black;">)</span></pre>
<h5>Intégrer un widget MEL dans un .ui <a name="integrer_widget_mel"></a></h5>
<p>Si un widget qui existe dans Maya n'est pas dispo dans Qt Designer (et il y en a un paquet), le plus simple est de faire une interface avec des layouts "vides" et de les intégrer une fois le loadUI fait via le flag <em>parent</em>:</p>
<pre class="python python"><span style="color: #dc143c;">cmds</span>.<span style="color: black;">intFieldGrp</span><span style="color: black;">(</span> parent=<span style="color: #483d8b;">"myParentLayout"</span> <span style="color: black;">)</span></pre>
<h5>Un mot sur les layouts <a name="un_mot_sur_les_layouts"></a></h5>
<p>Sachez que les différents types de layouts de Qt Designer ne sont pas gérés. Ou plutôt si:</p>
<blockquote><p>Any layouts in the file are created as generic layouts and are only accessible within Maya using the layout command, not the commands for specific types of layouts such as formLayout, columnLayout, and so forth.</p></blockquote>
<p>En gros, quel que soit le type de layout créé (vertical, horizontal, etc...) il n'y a qu'un seul équivalent MEL: <a href="http://download.autodesk.com/us/maya/2011help/CommandsPython/layout.html">La commande layout</a>.</p>
<p>Vous n'avez donc aucun contrôle dessus depuis le MEL, la commande layout ne permettant de faire quasiment rien.</p>
<h3>Conclusion</h3>
<p>Bon, maintenant il est temps de dire ce que je pense de ce système. :gniarkgniark:</p>
<p>Sur le fond je trouve que se faire des UI en se passant du script est une très bonne idée. Je l'ai fais en utilisant PyQt au boulot et c'est vraiment sympa et "pas prise de tête" de bosser comme ça (<a href="http://www.programmez.com/tutoriels.php?titre=Dessiner-un-widget-avec-Qt-Designer-4&tutoriel=53">MELANIE proposait déja</a> cette approche à l'époque mais n'était pas une réelle alternative).</p>
<p>Cela dit, Qt Designer ne permet pas d'<a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#integrer_widget_mel">intégrer directement</a> des widgets Maya ce qui est, à la longue, assez chiant quand on créer ses fenetres (ce que vous voyez dans Qt Designer n'est pas ce que vous avez dans Maya). On est obligé de le faire "à la volé" une fois le loadUI fait.</p>
<p>De plus l'inverse est aussi vrai: Il est impossible d'utiliser des widgets de Qt Designer qui n'ont pas d'équivalents dans Maya. Et un widget aussi simple que spinBox n'est pas utilisable dans Maya.</p>
<p><img src="https://www.fevrierdorian.com/blog/public/billets/2011_16_03_interface_Maya2011_loadUI/interface_Maya2011_loadUI_011.png" alt="interface_Maya2011_loadUI_011.png" style="display:block; margin:0 auto;" title="interface_Maya2011_loadUI_011.png, mar. 2011" height="303" width="292" /></p>
<center><i>Il est joli le widget? Ouai! Ben vous ne pouvez rien faire avec...</i></center>
<p>On peut imaginer des choses completement absurdes avec Qt Designer: La spinBox envoit un signal <em>valueChanged</em> avec sa valeur à un widget caché dont on n'est pas capable de récupérer la valeur en MEL... Mais ça serait tellement minable que je n'en parle même pas. :pasClasse:</p>
<p>Voici la liste des widgets Qt Designer et leur équivalents Maya (honteusement pompée sur <a href="http://www.creativecrash.com/maya/tutorials/scripting/mel/c/using-qt-designer-for-mel-interfaces">le très bon tuto</a> de <a href="http://www.creativecrash.com/users/css_maya">css_maya</a>).</p>
<pre class="bash bash"><span style="color: #000000;">1</span>-push Button <span style="color: #7a0874; font-weight: bold;">(</span>under Buttons group<span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #660033;">-------------------Maya</span> <span style="color: #7a0874; font-weight: bold;">command</span> to access------------<span style="color: #000000; font-weight: bold;">></span> button
<span style="color: #000000;">2</span>-radio button <span style="color: #7a0874; font-weight: bold;">(</span>under Buttons group<span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #660033;">------------------Maya</span> <span style="color: #7a0874; font-weight: bold;">command</span> to access------------<span style="color: #000000; font-weight: bold;">></span> radioButton
<span style="color: #000000;">3</span>-check box<span style="color: #7a0874; font-weight: bold;">(</span>under Buttons group<span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #660033;">---------------------</span> Maya <span style="color: #7a0874; font-weight: bold;">command</span> to access------------<span style="color: #000000; font-weight: bold;">></span> checkBox
<span style="color: #000000;">4</span>-combo box <span style="color: #7a0874; font-weight: bold;">(</span>under containers group<span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #660033;">------------------Maya</span> <span style="color: #7a0874; font-weight: bold;">command</span> to access------------<span style="color: #000000; font-weight: bold;">></span> optionMenu
<span style="color: #000000;">5</span>-line edit <span style="color: #7a0874; font-weight: bold;">(</span>under input widgets group<span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #660033;">---------------Maya</span> <span style="color: #7a0874; font-weight: bold;">command</span> to access------------<span style="color: #000000; font-weight: bold;">></span> textField
<span style="color: #000000;">6</span>-spin box <span style="color: #7a0874; font-weight: bold;">(</span>under input widgets group<span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #660033;">----------------Maya</span> <span style="color: #7a0874; font-weight: bold;">command</span> to access------------<span style="color: #000000; font-weight: bold;">></span> NONE
<span style="color: #000000;">7</span>-double spine box <span style="color: #7a0874; font-weight: bold;">(</span>under input widgets group<span style="color: #7a0874; font-weight: bold;">)</span>---------Maya <span style="color: #7a0874; font-weight: bold;">command</span> to access------------<span style="color: #000000; font-weight: bold;">></span> NONE
<span style="color: #000000;">8</span>-dial <span style="color: #7a0874; font-weight: bold;">(</span>under input widgets group<span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #660033;">--------------------Maya</span> <span style="color: #7a0874; font-weight: bold;">command</span> to access------------<span style="color: #000000; font-weight: bold;">></span> NONE
<span style="color: #000000;">9</span>-list view <span style="color: #7a0874; font-weight: bold;">(</span>under item views model based<span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #660033;">------------Maya</span> <span style="color: #7a0874; font-weight: bold;">command</span> to access------------<span style="color: #000000; font-weight: bold;">></span> textScrollList
<span style="color: #000000;">10</span>-horizontal slider <span style="color: #7a0874; font-weight: bold;">(</span>under input widgets<span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #660033;">------------Maya</span> <span style="color: #7a0874; font-weight: bold;">command</span> to access------------<span style="color: #000000; font-weight: bold;">></span> intSlider
<span style="color: #000000;">11</span>-label <span style="color: #7a0874; font-weight: bold;">(</span>under display widgets group<span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #660033;">----------------Maya</span> <span style="color: #7a0874; font-weight: bold;">command</span> to access------------<span style="color: #000000; font-weight: bold;">></span> NONE
<span style="color: #000000;">12</span>-progress bar <span style="color: #7a0874; font-weight: bold;">(</span>under display widgets group<span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #660033;">---------Maya</span> <span style="color: #7a0874; font-weight: bold;">command</span> to access------------<span style="color: #000000; font-weight: bold;">></span> progressBar
<span style="color: #000000;">13</span>-vertical slider <span style="color: #7a0874; font-weight: bold;">(</span>under input widgets<span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #660033;">--------------Maya</span> <span style="color: #7a0874; font-weight: bold;">command</span> to access------------<span style="color: #000000; font-weight: bold;">></span> intSlider
<span style="color: #000000;">14</span>-horizontal line <span style="color: #7a0874; font-weight: bold;">(</span>under input widgets<span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #660033;">--------------Maya</span> <span style="color: #7a0874; font-weight: bold;">command</span> to access------------<span style="color: #000000; font-weight: bold;">></span> NONE
<span style="color: #000000;">15</span>-vertical line <span style="color: #7a0874; font-weight: bold;">(</span>under input widgets<span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #660033;">----------------Maya</span> <span style="color: #7a0874; font-weight: bold;">command</span> to access------------<span style="color: #000000; font-weight: bold;">></span> NONE
<span style="color: #000000;">16</span>-group box <span style="color: #7a0874; font-weight: bold;">(</span>under containers group<span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #660033;">-----------------Maya</span> <span style="color: #7a0874; font-weight: bold;">command</span> to access------------<span style="color: #000000; font-weight: bold;">></span> NONE
<span style="color: #000000;">17</span>-tab widget <span style="color: #7a0874; font-weight: bold;">(</span>under container group<span style="color: #7a0874; font-weight: bold;">)</span> <span style="color: #660033;">-----------------Maya</span> <span style="color: #7a0874; font-weight: bold;">command</span> to access------------<span style="color: #000000; font-weight: bold;">></span> tabLayout
<span style="color: #000000;">18</span>-main window <span style="color: #660033;">----------------------------------------Maya</span> <span style="color: #7a0874; font-weight: bold;">command</span> to access------------<span style="color: #000000; font-weight: bold;">></span> window</pre>
<p>Au final, ça fait peu de widgets Maya supportés (une dizaine) comparé à ce qu'il propose en standard.</p>
<p>Malgrès le fait que cette intégration à du être couteuse en temps, aux vues des solutions possibles, je ne suis pas sûr que la situation évolue énormément. Il est cependant fort probable qu'Autodesk ajoute les widgets standards de Qt dans Maya mais l'inverse me semble compromis.</p>
<p>Maya 2012 arrivant et ne voyant pas de modifications sur ce point, je soupçonne que loadUI était plus une <a href="https://www.fevrierdorian.com/blog/post/2011/03/23/Creer-une-interface-rapidement-pour-Maya-2011-via-loadUI#qt_dans_maya">fonction marketing</a> qui pourrira au fil du temps jusqu'à ce qu'ils s'y remettent à fond, dans 5 ans... :lanceUnePierre:</p>
<p>Si le principe est sympa pour faire des bouttons et des checkBoxs, les limitations et bricolages que ça impose pour le reste des widgets me font prendre un peu de recule vis-à-vis de cette "solution miracle".</p>
<p>Je vais continuer à essayer de tirer le maximum de cette méthode et voir jusqu'ou ça peut aller mais si je me retrouve à ajouter, dans mon script, tout ce qui manque à l'interface, il n'est pas exclu que je retourne sur une approche 100% Maya Commands.</p>
<p>En esperant que ce billet vous aura aidé à y voir plus clair.</p>
<p>Si je suis resté un peu flou par endroit, n'hésitez pas à me le signaler! ;)</p>
<p>A bientôt!</p>
<p>Dorian</p>
<center>:marioCours:</center>
La bidouille des attributs cachéurn:md5:81bb81e35af745193e2b64d79381c0f32009-03-14T15:13:00+01:002013-07-26T22:41:30+02:00NarannInfographie 3D - Boulotbidouillefrinterfacemanipulationmayamayatomrmental rayoverriderendutricks<p><img src="https://www.fevrierdorian.com/blog/public/attributsCache/attributsCacheRendu010_tn.png" alt="attributsCacheRendu010_tn.png" style="float:left; margin: 0 1em 1em 0;" title="attributsCacheRendu010_tn.png, mar. 2009" height="150" width="150" />Lors ce qu'on cherche à modifier des paramètres, "overrider" des attributs, Il arrive qu'on se retrouve bloquer par les choix d'interfaçage de Maya. C'est surtout en rendu qu'on s'en rend le plus compte. Aujourd'hui, je vous propose non pas un "tricks-of-the-dead" mais une manipulation qu'il m'arrive de faire (de plus en plus souvent malheureusement) lorsque je debug une scène ou cherche à comprendre ou est caché tel ou tel paramètre de rendu mental ray (encore une fois, l'intérêt de cette "moulinette" est surtout destiné aux render-men qui veulent comprendre comment la passerelle mayatomr fonctionne).</p> <h5>Pourquoi faire ça?</h5>
<p>C'est vrai quoi, il est très bien Maya... Bon... C'est le genre de billet où je suis obligé de m'énerver un peu car vous allez voir qu'on découvre des choses assez "rigolotes" (enfin, ça l'est beaucoup moins quand on travail sur une prod et que des plans doivent sortirent. :nervous: ). Cela dis, il faut avouer que c'est typiquement le genre de manipulation qui n'est possible "que" sous un logiciel comme Maya... Un autre logiciel ne permettrait pas d'accéder aussi facilement à ce genre d'attribut (mais un autre logiciel aurait une interface "fini" lui... :siffle: ).</p>
<h5>Let's start!</h5>
<p>Nous allons commencer par sélectionner le node qui nous intéresse. Je vous propose celui que je trouve le plus mystérieux, à savoir: miDefaultOptions. :hehe:</p>
<p>Tapez:</p>
<pre class="mel mel">select miDefaultOptions</pre>
<p>Dans la ligne de commande Maya.</p>
<p><img src="https://www.fevrierdorian.com/blog/public/attributsCache/attributsCacheRendu001.png" alt="attributsCacheRendu001.png" style="display:block; margin:0 auto;" title="attributsCacheRendu001.png, mar. 2009" height="52" width="213" /></p>
<p>Ouvrez l'Attribute Editor.</p>
<p><img src="https://www.fevrierdorian.com/blog/public/attributsCache/attributsCacheRendu002.png" alt="attributsCacheRendu002.png" style="display:block; margin:0 auto;" title="attributsCacheRendu002.png, mar. 2009" height="817" width="441" /></p>
<p>Des paramètres... Chouette! :bravo:</p>
<p>Mais sachez tout de même que cette "interfaçage" est une représentation scripté des attributs du node... En effet, chaque node de maya dispose de son script d'Attribute Editor, les AETemplate (Ils sont dans C:\Program Files\Autodesk\Maya2009\scripts\AETemplates pour les curieux) qui régissent ce qui est affiché (ou pas), et de quel façon. Ce que vous voyez n'est donc pas l'intégralité des paramètres du node.</p>
<p>Pour avoir accès à "la total", suivez le guide:</p>
<p><img src="https://www.fevrierdorian.com/blog/public/attributsCache/attributsCacheRendu003.png" alt="attributsCacheRendu003.png" style="display:block; margin:0 auto;" title="attributsCacheRendu003.png, mar. 2009" height="206" width="298" /></p>
<p><img src="https://www.fevrierdorian.com/blog/public/attributsCache/attributsCacheRendu004.png" alt="attributsCacheRendu004.png" style="display:block; margin:0 auto;" title="attributsCacheRendu004.png, mar. 2009" height="400" width="500" /></p>
<p><img src="https://www.fevrierdorian.com/blog/public/attributsCache/attributsCacheRendu005.png" alt="attributsCacheRendu005.png" style="display:block; margin:0 auto;" title="attributsCacheRendu005.png, mar. 2009" height="400" width="500" /></p>
<p><img src="https://www.fevrierdorian.com/blog/public/attributsCache/attributsCacheRendu006.gif" alt="attributsCacheRendu006.gif" style="display:block; margin:0 auto;" title="attributsCacheRendu006.gif, mar. 2009" height="425" width="266" /></p>
<p>Et voila! Vous pouvez maintenant modifier tout les paramètres du node (Une image en "HD" des paramètres est disponible <a href="https://www.fevrierdorian.com/blog/public/attributsCache/attributsCacheRendu007.png">ici</a>! Ça peut être pratique. :hehe: ).</p>
<p>Un autre node bien pratique pour le "debugging" de rendu: "mentalrayGlobals":</p>
<p><img src="https://www.fevrierdorian.com/blog/public/attributsCache/attributsCacheRendu009.png" alt="attributsCacheRendu009.png" style="display:block; margin:0 auto;" title="attributsCacheRendu009.png, mar. 2009" height="59" width="213" /></p>
<p><img src="https://www.fevrierdorian.com/blog/public/attributsCache/attributsCacheRendu010.png" alt="attributsCacheRendu010.png" style="display:block; margin:0 auto;" title="attributsCacheRendu010.png, mar. 2009" height="194" width="337" /></p>
<p><img src="https://www.fevrierdorian.com/blog/public/attributsCache/attributsCacheRendu008.png" alt="attributsCacheRendu008.png" style="display:block; margin:0 auto;" title="attributsCacheRendu008.png, mar. 2009" height="1684" width="249" /></p>
<p>Voila voila...</p>
<p>Encore une fois, il ne s'agit pas du tip qui tue mais il permet de s'affranchir de certaines limites de l'interface imposé par Autodesk. Je ne peut m'empêcher de faire la comparaison avec XSI qui lui, "bloque" l'interface mais est ducoup beaucoup plus rigoureux vis-à-vis de ce genre de problèmes. Je vous propose une petite liste non exhaustive:</p>
<ul>
<li>Le changement "foireux" du Filter Size quand on change de Filter sous Maya 8.5 dû à une tentative (visiblement raté) de mettre en relation la taille du Filter avec la taille des pixels (En considérant par exemple, qu'un filtre Gaussien s'étale sur trois pixel, <a href="http://en.wikipedia.org/wiki/Gaussian_function" hreflang="en">ce qui n'est pas tout à fait exact</a>... C'est sensé être plus compréhensible pour le graphiste et on ne peut pas dire que ça parte d'un mauvais intention... Sauf que ça bug...).</li>
<li>Le fait que "Interpolate Refraction" (mia_x) n'active pas le paramètre "Grid Density" et qu'on soit obligé d'activer "Interpolate ReFLECtion" pour pouvoir modifier la valeur de "Grid Density" est un autre exemple (il faut donc, une fois "Grid Density" réglé, redécocher "Interpolate Reflection", Super! :baffed: ). Et nous somme sous Maya 2009...</li>
</ul>
<p>Autodesk, du fait de la possibilité de passer par des méthodes annexes pour faire les même choses (ici, modifier les attributs), semble s'autoriser une certaine nonchalance sur la qualité de ses AETemplates. C'est pour cette raison qu'il m'arrive d'utiliser cette manipulation pour arriver à mes fins sans m'énerver avec l'interface.</p>
<p>Je partage tout ça en espérant que ça puisse vous servir. N'hésitez pas à laisser un commentaire si vous avez rencontré un problème semblable, je l'ajouterai à la liste.</p>
<p>Bonne suite!</p>
<p>Dorian :marioCours:</p>