You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure how to log this, if it should be a proposal, let me know and I'll close this and re-log it.
In my addons Waterways and ShellFur, I make custom inspectors for the materials and using ShaderMaterial.can_revert_property() and ShaderMaterial.get_revert_property() it was possible to forward the reverting to my inspectors. These functions have been removed in Godot 4.0 and there does not appear to be any alternative way of doing it.
Example of custom inspector in Godot 3.5
Example code of using this in 3.5:
func property_can_revert(property : String) -> bool:
if property.begins_with("mat_"):
var param_name = property.right(len("mat_"))
return _material.property_can_revert(str("shader_param/", param_name))
if not DEFAULT_PARAMETERS.has(property):
return false
if get(property) != DEFAULT_PARAMETERS[property]:
return true
return false
func property_get_revert(property : String):
if property.begins_with("mat_"):
var param_name = property.right(len("mat_"))
var revert_value = _material.property_get_revert(str("shader_param/", param_name))
return revert_value
Steps to reproduce
NA
Minimal reproduction project
NA
The text was updated successfully, but these errors were encountered:
Those functions still exist, they were renamed to _property_can_revert and _property_get_revert to properly match the convention for virtual methods: #64334.
They're also exposed in the Object docs properly now :)
@akien-mga I know property_can_revert and _property_can_revert have been renamed. But you cannot call them to get the values like you could with the ShaderMaterial ones.
@akien-mga I missed it too at first, but the issue is not with the methods that we can override, but with the methods that we would call. Kasper implements a higher order method that calls into a method of the material. Override works, but the inner call doesn't, because I think we still need to expose a public counterpart of the virtual method (e.g. you implement _set, but you call set externally).
Godot version
4.0.beta5
System information
Windows 10, GTX 980 Ti, Vulkan Forward+
Issue description
Not sure how to log this, if it should be a proposal, let me know and I'll close this and re-log it.
In my addons Waterways and ShellFur, I make custom inspectors for the materials and using
ShaderMaterial.can_revert_property()
andShaderMaterial.get_revert_property()
it was possible to forward the reverting to my inspectors. These functions have been removed in Godot 4.0 and there does not appear to be any alternative way of doing it.Example of custom inspector in Godot 3.5
Example code of using this in 3.5:
Steps to reproduce
NA
Minimal reproduction project
NA
The text was updated successfully, but these errors were encountered: