godotengine / godot

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

Virtual variety makes "Export Property" unavailable. #82719

Open LiyanJun233 opened 9 months ago

LiyanJun233 commented 9 months ago

Godot version

v4.1.1.stable.mono.official [bd6af8e0e]

System information

Windows 11

Issue description

I created scene named "Character" and added a script for it. Then I created other scenes as my character scene. I also added scripts for these scenes and changed its inheriting class from "Node2D" to "Character" in Script Editor. After that, I built the project, and it gives warnings like that: CSC(0,0): warning CS8785: 生成器“ScriptPropertiesGenerator”未能生成源。它不会影响输出,因此可能会造成编译错误。异常的类型为“NullReferenceException”,显示消息“Object reference not set to an instance of an object.” CSC(0,0): warning CS8785: 生成器“ScriptSerializationGenerator”未能生成源。它不会影响输出,因此可能会造成编译错误。异常的类型为“NullReferenceException”,显示消息“Object reference not set to an instance of an object.” And the output said: Transient parent has another exclusive child. Meanwhile, if I used Property Export in scripts, it will not be able to build, and show errors like that: C:\Users\Liyan\Documents\GodotProject\Deltarune Engine\Godot.SourceGenerators\Godot.SourceGenerators.ScriptPropertyDefValGenerator\Button_ScriptPropertyDefVal.generated.cs(9,33): “AnimatedSprite2D.PropertyName”未包含“Hint”的定义 These makes me cannot use Property Export.

Steps to reproduce

1.Create a scene with script, and add a virtual variety for it. 2.Create another scene with script and change the inheriting class to the previous script in script editor, then override the virtual variety. 3.Create a scene with script which used Property Export. 4.Build it and you will see the errors and warnings in output and build information.

Minimal reproduction project

BugTest.zip

KoBeWi commented 8 months ago

Aside from errors, this sounds like #23316