Hi Marcus, I was looking for this, too. Have you got any result ?
While I was googling, I found this page https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2018/ENU/Maya-SDK/cpp-ref/node-icon-cmd-2node-icon-cmd-8cpp-example-html.html And that inspired me to use `MFnDependencyNode.setIcon()` to do the trick, but I end up using Maya Python API 1.0, since 2.0 won't work. Finally, I put them together as a small tool and upload it https://github.com/davidlatwe/NodeSticker Although this thread has been here almost a year..., but welcome to have a try :) Best, David Marcus Ottosson於 2017年11月16日星期四 UTC+8下午2時34分38秒寫道: > > Hi all, > > I’m looking to implement this. > > node = cmds.createNode("myCustomNode") > cmds.setAttr(node+ ".iconName", "polyMeasureUV.png") > > And have the icon appear wherever this node is drawn, such as the Outliner > and Node Editor. Ideally polyMeasureUV.png is one of Maya’s own internal > icons, the ones you can browse via the Shelf Editor. > > I know about the XBMLANGPATH but would like something that A) doesn’t > require a restart or meddling with the environment in order to work (if > that’s possible still using this approach, do let me know) and B) uses > Maya’s own icon library such that I won’t have to ship custom images. > > I’m chasing this, because I noticed the dagContainer have a feature like > it and works quite well. > > from maya import cmds > container = cmds.createNode("dagContainer", name="LegLeft03_LIM") > cmds.setAttr(container + ".iconName", "polyMeasureUV.png") > > [image: Inline images 1] > > Any ideas? > > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/6687779b-277a-49fe-ad21-0888aca2ca34%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.