How to change "Embed Icon in Operator" option in Type Properties with Python? Or it's impossible?

   2105   3   1
User Avatar
Member
7 posts
Joined: Dec. 2017
Offline
How to change “Embed Icon in Operator” option in Type Properties with Python? Or it's impossible?
User Avatar
Member
3 posts
Joined: Aug. 2019
Offline
So, anyone found a solution to this? Is it also only possible by hacking into the XML definition or something like that and, if so, how?
User Avatar
Member
27 posts
Joined: Feb. 2017
Offline
It seems it should be here [www.sidefx.com], but SideFX forgot about it.

You can manually add section [www.sidefx.com] with icon data. Use set_icon function from $HFS/houdini/python2.7libs/sas/inspectassets.py directly or as reference.
Edited by ivantitov_zd - July 23, 2021 06:49:50
English is not my native language, sorry in advance for any misunderstanding
User Avatar
Member
380 posts
Joined: July 2005
Offline
hmm, yeah... just looked into this myself, and inspectassets.py. Not obvious at all.

Manually, one can put something like `MISC_digital_asset` in the Icon Field of Operator Type Properties to pick up and use that icon in the HOUDINI_PATH with embed Icon In Operator toggled off...

but it seems to me as of H19.5.435 there still isn't a way to toggle that off by way of HOM, so you can
hda_def.setIcon("MISC_digital_asset") to just put the raw string there. That HOM call is smart enough to locate the icon you provide it if it can be found in the HOUDINI_PATH, but it surprisingly goes ahead and embeds it because this toggle gets in the way.

It would be great if, as you mentioned, this was in hou.HDAOptions, though those look geared toward the Save Tab.
This option should probably be at the top level, alongside setIcon, or even better, as an argument to setIcon itself.
  • Quick Links