Skip to content

Conversation

@alienfrenZyNo1
Copy link

  1. JSON Argument Passing on Windows:

    • Previously, JSON parameters passed as command-line arguments from the Node.js server (src/index.ts) to the Godot operations script (src/scripts/godot_operations.gd) were getting corrupted on Windows.
    • This was caused by using child_process.spawn with shell: true and attempting Unix-style shell escaping, which doesn't work correctly in Windows shells (cmd/powershell).
    • Fix: Modified executeOperation in src/index.ts to use spawn with shell: false. This allows Node.js to handle argument quoting correctly across platforms, and the raw JSON string can be passed directly without needing shell-specific escaping.
  2. Godot Node Ownership Error:

    • After fixing the argument passing, the create_scene function in src/scripts/godot_operations.gd was failing with a Godot engine error: Condition "p_owner == this" is true.
    • This was caused by incorrectly setting scene_root.owner = scene_root before packing the scene.
    • Fix: Removed the scene_root.owner = scene_root line. The PackedScene.pack() method correctly handles the ownership of the root node being packed.

With these changes, the create_scene tool now functions correctly, successfully creating scene files as intended.

@An-actual-duck
Copy link

An-actual-duck commented May 24, 2025

Well I can create scenes now using the ide but for some reason creating a node causes the ide to hang. Because it just hangs there I'm not getting any output or anything to look at and explain why. Huge thanks for solving one issue, let me know if you have any idea why creating a node may be causing the ide to hang now.

edit: After messing around a small note. If I restart my ide it can then create a node, but after creating 1 node it can't do another.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants