Announcement

Collapse
No announcement yet.

how to set static switch parameter of Material Instance Constant

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    how to set static switch parameter of Material Instance Constant

    Hello all,

    Happy New Year!

    I have an issue to change switch parameter of material instance in asset view.
    I can do that if there are a few but I have over 1000 assets. (It is easy. just click check box!) so I tried to use python to do this automatically.


    I googled a lot but I could get only setting scalar and vector not boolean and switch.
    I know that boolean and switch can not change value at runtime but I want to change it not runtime.

    could you guys have any good solutions?

    Thanks

    #2
    See https://docs.unrealengine.com/en-US/...ngLibrary.html
    There is a get_material_default_static_switch_parameter_value() method.
    Oops, that's a get. Nevermind.

    Edit:
    Based on this previous forum post, others have created different material instances variants with these static parameters turned on/of and then used the appropriate one. Yeah, I know not great if you have many switch parameters.

    On another note: I found another guy implementing his own custom Blueprint function to set the switch parameter: https://qiita.com/EGJ-Kaz_Okada/item...895b398893cbbb
    Warning, page is in Japanese. Unfortunately, I don't think this can be converted to python.
    Last edited by brisket; 01-13-2021, 03:17 PM.

    Comment

    Working...
    X