Search Unity

Programmatic Control of Post-Processing v2 Fun

Discussion in 'Image Effects' started by stonstad, Jul 2, 2019.

  1. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    659
    Unity 2019.1.8f1, Post Processing v2 [2.1.7] - 2019-06-12

    Man, I am really struggling to see what it is I am doing (or not doing) which prevents my v2 post processing effects from enabling programatically at runtime.

    I reviewed the helpful docs (here: https://github.com/Unity-Technologies/PostProcessing/wiki/Manipulating-the-Stack#profile-editing) and they definitely help address some common pitfalls.

    1) Access a shared profile to prevent profile copies...
    2) Profile is assigned to a variable
    3) Assign to override...

    Here's the code which sets three effects to enabled and logs the enabled state.


    And here's the state of the profile (with none of the above effects enabled) but the console shows the code executed.


    Is there a kind person out there who can be a second pair of eyes and let me know what I might be missing?
     
    Last edited: Jul 11, 2019
  2. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    659
    Has anyone seen this behavior before? Not sure if it is a bug or just oversight on my part.
     
  3. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    659
    OK. Missing logic was <effect>.active = true, i.e. ambientOcclusionLayer.active = true... .enabled and .active are both applicable and must be true in this scenario.