How can I suppress warning about setting size with set_deferrred

Godot Version

4.3

Question

Hi, I currently work on a plugin, and want to disable warnings so users don’t get my warnings when they use my plugin.
Now the only warning is the following:
“Nodes with non-equal opposite anchors will have their size overridden after _ready().
If you want to set size, change the anchors or consider using set_deferred().”

I read the wiki page about warnings where @warning_ignore("warning_type") is explained, but I can neither find the name of this warning nor a list of all the warnings.

Another thing that confused me was that in that page they talked about some button with which you can apparently ignore the warnings, but I can’t find that here, so I am wondering if this is another type of warning that can’t be suppressed with warning_ignore.

Does anyone know how to disable this warning or whether it is possible in the first place?

(please don’t explain how to solve the underlying issue that makes the warning appear, I have my reasons why not to solve it)

I added a spurious unused var into a script and here, if you click the yellow warning icon this opens (with the ignore link underlined).

I don’t think this is going to help you in your situation though. Although you can get the warning name from here at least.

There is some stuff about using # ignore_warning but I don’t think that works any more. I read a bit about it here in this older post:

The link to the PR has it but it looks like it was removed.

I had a plugin that threw warnings and it annoyed me so much that I stopped using it. I hope you get it fixed, but perhaps trying to fix rather than work around these warnings would be better (I know, you said you had your reasons) because the warnings are there for a reason (I imagine anyway, although you seem advanced enough to know this already, and perhaps know when you don’t want them safely.)

Best wishes.

2 Likes