[Feature Request] Generic static switch for materials.

I really feel the lack of a Material generic static switch with custom labels for more flexible and better editable master materials.
It may be shown as a drop down list and makes able to support any type ( scalar, texture object , v3 etc) and to name the options.
The type will get inferred by the first link and enforced for the others.

I was going to make a new thread to request this feature but I found this one so, bump!

I’ve actually had this feature on previous work projects (implemented by our programming team by request) and I can’t stress enough how useful a Static Switch with multiple label-able options is, especially when it comes to creating complex master materials with lots of options.
because really, having On/Off switches for multi-case handling doesn’t cut it

Gonna shamelessly bump this. Static Switches as chains of if/elseif/elseif/…/else can get such a vast improvement with this
Maybe if it gains some interest…

So I realized Material nodes can be created from C++ as plugins (no need to modify the engine) which pushed me to attempt to implement this myself.
Sadly only UMaterialExpression is exposed as ENGINE_API but none of its subclasses are exposed, so we cannot do material parameters as plugins due to the way material parameter types are hardcoded.

Would be reeeeally nice if this small but very significant QOL improvement could get some attention, or at least getting a more flexible way to create new material expressions (including material parameters)

Please @Tim_Sweeney :pleading_face:

1 Like