You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[gdextensions] Registered classes are ticking in editor #709
boolis_in_editor() const; // true in editorboolis_play_in_editor() const; // true if game is played from editor ( or run from build with "editor" feature)boolis_client() const; // standalone buildboolis_dedicated() const; // or is_server(). headless server build
or
enumclassPlayType
{
Editor,
PlayInEditor,
Standalone,
Server
}
PlayType get_play_type() const;
Built-in feature tags are defined at compile-time. The editor feature tag does not behave like Engine.is_editor_hint(), as the editor feature tag will always be true whenever a project is run from an editor binary.
As mentionned there I think the behavior should be the same as not-tool GDScript, unless a runtime or at least creation time accessor stating if the note type in question is or not a tool, is handled by the engine.
GDExtensions are ideally meant to work like Godot modules. In a Godot module, nodes always run as if they are marked with @tool, and they use Engine::get_singleton()->is_editor_hint() (as mentioned by Calinou in the first comment) to check if they are currently running in the editor. Yes, this is different than GDScript, but I believe this is by design.
GDExtensions are ideally meant to work like Godot modules. In a Godot module, nodes always run as if they are marked with @tool, and they use Engine::get_singleton()->is_editor_hint() (as mentioned by Calinou in the first comment) to check if they are currently running in the editor. Yes, this is different than GDScript, but I believe this is by design.
Ok thanks that explains it, I wasnt aware of that.
Activity
Calinou commentedon Feb 25, 2022
You probably need to check for
Engine::get_singleton()->is_editor_hint()before printing in_process(or perform an earlyreturnthis way).RedwanFox commentedon Feb 25, 2022
Read about it, I think it should be mentioned in documentation. Or maybe some helper functions. Godot documentation also mentions that it's possible to check via feature tags https://docs.godotengine.org/en/latest/tutorials/export/feature_tags.html
Something like:
or
Calinou commentedon Feb 25, 2022
Built-in feature tags are defined at compile-time. The
editorfeature tag does not behave likeEngine.is_editor_hint(), as theeditorfeature tag will always betruewhenever a project is run from an editor binary.RedwanFox commentedon Feb 25, 2022
That's why I have separated
is_in_editorandis_play_in_editorin my example of helpersKlaim commentedon Jun 14, 2023
As mentionned there I think the behavior should be the same as not-tool GDScript, unless a runtime or at least creation time accessor stating if the note type in question is or not a tool, is handled by the engine.
dsnopek commentedon Jun 14, 2023
GDExtensions are ideally meant to work like Godot modules. In a Godot module, nodes always run as if they are marked with
@tool, and they useEngine::get_singleton()->is_editor_hint()(as mentioned by Calinou in the first comment) to check if they are currently running in the editor. Yes, this is different than GDScript, but I believe this is by design.Klaim commentedon Jun 14, 2023
Ok thanks that explains it, I wasnt aware of that.