Can't set property for Native Script from Property Editor
After I've set a new value for registered property in Property Editor, I tried to read this value from GDScript.
var simpleclass = load("res://simple.gdns").new()
func _ready():
print(simpleclass._count);
But received value setted in code (or random value if no initialisation in C++ code).
This is code for registering: register_property("_count", &SimpleClass::_count, int(0));
After some research, I found that addresses for my class object are different when setting from Editor and from GDScript. For example:
Value from _wrapped_setter using Editor: 90942992
Value from _wrapped_getter using GDScript: 90966512
Then I added a log to a constructor and found that my class was created 2 times. So I think this is the root of the problem. To be honestly, I don't know is it a bug or am I doing something wrong :)
Maybe there's a bug in the property handling code. I'll check when I'm back home (in about 20 hours)
I'm closing this if that is ok. I've used this consistently over the past year so pretty sure this is fixed by now. Please re-open if I turn out to be wrong :)