Access material parameters

__Aeon____Aeon__ Posts: 37Member

I know this sounds very beginner-ish but how do i set PARAM_GLOW from gdscript? I already came across the solution previously, yet, i forgot to save it to a snippet for later implementation, now i just can't get to figure it out once again.... :/

An object's material PARAM_GLOW parameter needs to be set during run-time, this object's mesh is contained in node B, which is instanced within node A, and node A is the scene-ready object node, i have a simple function like this linked to node A:

`func set_glow(l_glow_state):
if l_glow_state == TYPE_BOOL:
# Enable or Disable Glow
# get_node("B").PARAM_GLOW = l_glow_state
get_node("B"). ....

    return true
    return false`

I recall i came across something like get_node("B").PARAM_GLOW, yet it doesn't show up anymore within the autocompletion dropdown menu...


  • __Aeon____Aeon__ Posts: 37Member
    edited October 2017

    Nevermind, got it working.

    func set_glow(l_glow_val): material = get_node("B").get_mesh().surface_get_material(material_no) material.set_parameter(5, l_glow_val) get_node("B").get_mesh().surface_set_material(material_no, material)

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file