Hi Jake, I don't think you can replace icons on built-in nodes menu items.
As for custom toolbar menu buttons, you can set the icon on creation with
addCommand but it looks like if you try to set the icon again using
findItem.setIcon, the menu disappears. I believe there's an existing bug
filed with The Foundry for that. Cheers -E

On Tue, Mar 24, 2015 at 5:06 PM, Jake Richards <tru...@blueskystudios.com>
wrote:

> Correct, I verified that I actually grabbed the right menu:
>
> menu = nodes.menu('Image')
>
> # Result: menu
>
> # Result: <Menu object at 0x53f9b40>
>
> [i.name() for i in menu.items()]
>
> # Result: ['Read', 'Write', 'UDIM import', 'Constant', 'CheckerBoard',
> 'ColorBars', 'ColorWheel', 'CurveTool', 'Viewer']
>
>
> So, it appears I'm getting the right thing as those are the menu items
> under the Image nodes menu.
>
> I had thought about blowing it away and recreating it but wanted to see if
> there was better way before heading down that path.
>
>
> Thanks!
>
> jake
>
>
>
> ------------------------------
>
> *From: *"Charles Taylor" <ctay...@spinvfx.com>
> *To: *nuke-python@support.thefoundry.co.uk
> *Sent: *Tuesday, March 24, 2015 12:48:28 PM
> *Subject: *Re: [Nuke-python] Changing Nodes Icons
>
>
> Is your nodes.menu('Image') command returning what you think it is? It's
> not impossible that you're just getting a new menu object that's unrelated
> to the actual in-play menu object.
>
> You can also go the sledgehammer approach and remove the menu and add back
> a new menu with your custom icon.
>
> ./c.t
>
> On 03/24/2015 12:34 PM, Jake Richards wrote:
>
> Hello:
>   I want to change the icon for a menu under the Nodes menu, but Nuke
> doesn't seem to want to update it using the setIcon command.
> Here's what I've tried:
>
>  nodes=nuke.menu('Nodes')
>
> menu = nodes.menu('Image')
>
> menu.setIcon('/my/new/icon.png')
>
> menu.icon()
>
> # Result: '/my/new/icon.png'
>
> Yet, the image is still the same.  I've tried setting the visibility
> true/false, enable/disabling it, removing the panel from the gui and adding
> it back, calling nodes.updateMenuItems()... just about anything I could
> think of to refresh that icon but it still is the old one.  Is there some
> other way to set that icon that I'm just not grasping?   This is in nuke
> 8.0v6 and 9.0v4 in linux.
>
> Thanks!
> Jake
>
>
> --
> --
> --------------------------------------------
> tru...@blueskystudios.com       203-992-6319
> LTD                         Blue Sky Studios
> --------------------------------------------
>
>
> _______________________________________________
> Nuke-python mailing listnuke-pyt...@support.thefoundry.co.uk, 
> http://forums.thefoundry.co.uk/http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
>
> _______________________________________________
> Nuke-python mailing list
> Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
>
> _______________________________________________
> Nuke-python mailing list
> Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to