godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.13k stars 21.17k forks source link

Editor tools not running on v4.2-beta4 #84704

Open malino-dev opened 11 months ago

malino-dev commented 11 months ago

Godot version

4.2-beta4

System information

Windows 10

Issue description

From the attached script (see steps to reproduce) the redraw does not happen. Since neither the redraw nor the prints happen in v4.2-beta4 but they do happen in v4.1.1, I suppose the _Process method just does not get executed for some reason (it does get executed on v4.1.1 and I get both, the redraw and prints in console).

Steps to reproduce

  1. Empty project
  2. Create 2D scene with following script attached
  3. Create 2D nodes that you attach to the scene script
  4. Assign color in scene script
  5. EDIT: Resizing panels like inspector redraws (presumably executing _Process)

Script:

[Tool]
public partial class Main : Node2D
{
    [Export] Node2D _nodeA, _nodeB;
    [Export] Color _color;

    private Vector2 PointA => _nodeA.GlobalPosition;
    private Vector2 PointB => _nodeB.GlobalPosition;

    public override void _Process(double delta)
    {
        QueueRedraw();
        GD.Print(PointA, PointB);
    }

    public override void _Draw()
    {
        Rect2 rect = new Rect2(PointA, PointB - PointA);
        this.DrawRect(rect, _color, filled: true, width: -1);
    }
}

Minimal reproduction project

FourierDrawingsAnim.zip

akien-mga commented 11 months ago

I can't reproduce the issue on Linux, it works fine for me with 4.2-beta4 and 4.2-beta5.

Please make sure you compiled the script successfully. The scene might need to be reloaded for script changes to be taken into account after compiling - but that's not a new problem, it should behave the same in 4.1.

malino-dev commented 11 months ago

It was recompiled multiple times. Oh, and I forgot to mention, it redraws when resizing the panels like the inspector panel.

raulsntos commented 11 months ago

Did you try reopening the scene after building the project?

Calinou commented 10 months ago

@malino-dev Bump :slightly_smiling_face: See raulsntos' question above.

malino-dev commented 10 months ago

Thanks for the ping, yes, I did. With the same issues.