Godot Version
4.4
Question
When accessing Node properties in script via get_property_list(), how best to detect if the property is read-only?
The use case is a script-based batch duplicator of scene files. For each dupe it scans an input dictionary of property names and values and tries to write those onto a newly-instantiated node. However, if the property is read-only it will throw an error. The property in question is one from a custom class authored in native with a getter but without a setter, making it effectively read-only to script but not flagged as such. For example, this method did not return false:
func _is_prop_valid(property_data:Dictionary) -> bool:
# cannot change read-only properties
if property_data["usage"] & PROPERTY_USAGE_READ_ONLY:
return false
return true
Any other ways to catch when a property is read only via native implementation?