【问题标题】:Change icon on mel script on shelf using mel or python使用 mel 或 python 更改架子上 mel 脚本上的图标
【发布时间】:2015-06-04 23:25:35
【问题描述】:

我在 MEL 中使用了 addNewShelfTab 和 scriptToShelf 命令为我的迷你 mel 脚本创建了一个图标。我希望能够通过使用 MEL 或 Python 来更改此按钮的默认图标,就像您可以在书架编辑器中一样。我该怎么做?

【问题讨论】:

    标签: python mel maya-api


    【解决方案1】:

    shelfButton mel command help

    shelfButton -edit -image1 "icon.png" $name;
    

    【讨论】:

      【解决方案2】:

      以下 python 脚本对我有用:

      import maya.mel as mel
      import pymel.core as pm
      
      mel.eval('addNewShelfTab($shelfName)');
      pm.shelfButton( annotation='Annotation', image1=$image, command='<command>' );
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-04-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-10-06
        • 1970-01-01
        相关资源
        最近更新 更多