Skip to content
Jigwright

Set Material Parameter

Set a scalar, vector, or texture parameter on a Material Instance and verify by reading it back. Updates the instance so the change is visible without a manual recompile. Leaves the package dirty; call hf_save_object to persist.

hf_set_material_parameterWrite

Arguments

NameTypeDescription
materialreqstringAsset path of a MaterialInstanceConstant. Base Materials cannot have parameters set directly - create an instance instead.
parameterreqstringParameter name. Use hf_list_material_parameters to find the exact name.
typereqstringWhich kind of parameter this is.
scalar | vector | texture
valuereqstringscalar: a number. vector: R,G,B,A or (R=..,G=..,B=..,A=..). texture: an asset path, or 'none' to clear.
forceboolean
= false
Edit even when the asset cannot currently be saved - for example when revision control is configured but disconnected. The change will be made in memory and WILL BE LOST unless the underlying problem is fixed before saving. Only pass this if you intend to discard the work or fix the connection first.

Also in Materials: