![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Bryce |
If I have a GDScript like this that extends the built in OpenSimplexNoise:
extends OpenSimplexNoise
class_name OpenSimplexNoiseCurve
export(Curve) var curve
# override parent method
func get_image(width: int, height: int):
print("get_image override")
# call parent method to get noise image
var img:Image = .get_image(width, height)
img.lock()
# loop through pixels and apply curve
var c: Color
for x in width:
for y in height:
c = img.get_pixel(x, y)
c.r = curve.interpolate(c.r)
c.g = c.r
c.b = c.r
img.set_pixel(x, y, c)
img.unlock()
return img
I can call the get_image()
method from within my own script and it works as expected.
But if I add an OpenSimplexNoiseCurve
resource to a NoiseTexture
on a Material via the inspector, it doesn’t print the message, change the image output, or throw an error.
Is this a bug, or will built in Resources like NoiseTexture only call the base method of a property Resource, and not the one overridden in GDScript?
Does anyone have more info on this?
Bryce | 2020-03-09 21:54
Adding a comment again to hopefully bump this and get an answer.
Bryce | 2020-04-06 03:17