Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it by design that can no longer set "_editor_icon" programmatically? #99408

Closed
koodikulma-fi opened this issue Nov 18, 2024 · 2 comments
Closed
Labels

Comments

@koodikulma-fi
Copy link

koodikulma-fi commented Nov 18, 2024

Tested versions

  • Reproducible in v4.3
  • Was still working like has been in v4.0.

System information

Win 11

Issue description

Description

Earlier, you could always set the icon for each node programmatically by node.set_meta("_editor_icon", icon_res).

  • However, in Godot v4.3 (and possibly a bit earlier), it no longer has any effect to do this.
  • Is this feature limitation purposeful or accidental? (I hope accidental.)

Consequences

This change greatly reduces the scope of visualizing information in the tree.

  • You can no longer change the icon based on some state of the node, which can sometimes tremendously help to read the situation as a whole. (Unless you make a script for each icon usage, and change the script, and re-init and -set the values, etc.)
  • You can no longer represent a tree with custom icons dynamically (eg. for mapping more info to your custom nodes), as each item in the tree would need to have its own script with icon attached.
  • Generally speaking, you can no longer set icon on nodes that have no custom script. This also cuts away a lot of dynamic visualization possibilities.

(Note. Visualizing complexity in a tree can tremendously speed up workflow in certain cases.)

Suggestion

Would it be possible to still allow using "_editor_icon" (or some other means) to set icon dynamically? So that it can override whatever custom default (or internal) class based icon was used.

Steps to reproduce

Way it used to work:

var some_icon := load("res://some_icon.svg") # Any custom icon, can load dynamically.
var node := Node.new()
node.set_meta("_editor_icon", some_icon) 

The only way to use now is static:

@icon("res://some_icon.svg") # <-- Can never be dynamic.
extends Node

Minimal reproduction project (MRP)

editor-icon.zip

@reach-satori
Copy link
Contributor

Was removed in #75472. Quote:

I removed the meta hack for icons, because there doesn't seem to be anything that uses it in the editor anymore. It was introduced sometime around #20560, #21717 refactored it a bunch, and #30697 removed it even more. So currently it's only read in our codebase, but never set. Something may still rely on this existing, as a hack, but I don't think it's worth to support such undocumented "feature".

@koodikulma-fi
Copy link
Author

Thanks for the info - tried to search for it many times, but couldn't find.

It's unfortunate, from my point of view, that there's no longer any way to set icons for nodes dynamically. But now that I know that it's by design, I'll make respective adjustments and compromises in the tools. (Btw. I do agree that, as a design, "_editor_icon" meta data was hacky.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants