Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Question Default value ignored for unexposed properties. Bug?

Discussion in 'Shader Graph' started by snw, Mar 26, 2020.

  1. snw

    snw

    Joined:
    Mar 13, 2014
    Posts:
    42
    Hi,

    I just noticed that the "Default" value for a an unexposed property does not get compiled to the shader. I guess this is a bug?

    Specs:
    Unity 2019.3.5f1
    Shader Graph 7.3.1


    (P.S: Setting the property by script works as expected)


    Cheers.
     
  2. alexandral_unity

    alexandral_unity

    Unity Technologies

    Joined:
    Jun 18, 2018
    Posts:
    163
    This is actually by design. The unexposed properties must be set to type default or else they can't be overridden by c# scripts, which is one of the primary use cases for unexposed properties. We're working on better communication of this in the documentation. c:
     
    snw likes this.
  3. snw

    snw

    Joined:
    Mar 13, 2014
    Posts:
    42
    Ok, thanks.

    One suggestion though: maybe remove/grey-out the "default" input field for unexposed properties? Because if there is an input field, I expect its value to actually have an effect. As this doesn't seem to be the case here, why not just get rid of it to avoid confusion?
     
  4. alexandral_unity

    alexandral_unity

    Unity Technologies

    Joined:
    Jun 18, 2018
    Posts:
    163
    We're actually looking into different methods of setting the properties so that they can be unexposed and use default values, but currently it's not a bug for the existing implementation. But we want to enable that workflow.
     
    snw likes this.