Search Unity

Post Processing package 3.2.0 has a dependency to built in package VR.

Discussion in 'General Graphics' started by Meceka, Jan 18, 2022.

  1. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    423
    Older versions of the package didn't have this dependency. By default VR is enabled in Package Manager's Built-In section, I disabled it a long time ago as we don't need VR. I just updated the post-processing to 3.2.0 and I have compile errors because it requires the VR package in the new version.

    Code (CSharp):
    1. Library\PackageCache\com.unity.postprocessing@3.2.0\PostProcessing\Runtime\PostProcessLayer.cs(722,33): error CS0103: The name 'XRSettings' does not exist in the current context
    2.  
    3. Library\PackageCache\com.unity.postprocessing@3.2.0\PostProcessing\Runtime\PostProcessLayer.cs(722,67): error CS0103: The name 'XRSettings' does not exist in the current context
     
    R2-RT likes this.
  2. ryanmillerca

    ryanmillerca

    Joined:
    Aug 12, 2012
    Posts:
    143
    I'm getting this as well.

    Code (CSharp):
    1. Library/PackageCache/com.unity.postprocessing@3.2.1/PostProcessing/Runtime/PostProcessLayer.cs(9,39): error CS1069: The type name 'XRSettings' could not be found in the namespace 'UnityEngine.XR'. This type has been forwarded to assembly 'UnityEngine.VRModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' Enable the built in package 'VR' in the Package Manager window to fix this error.
    2. Library/PackageCache/com.unity.postprocessing@3.2.1/PostProcessing/Runtime/PostProcessRenderContext.cs(6,39): error CS1069: The type name 'XRSettings' could not be found in the namespace 'UnityEngine.XR'. This type has been forwarded to assembly 'UnityEngine.VRModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' Enable the built in package 'VR' in the Package Manager window to fix this error.
    I'm using Unity 2021.2.13f1 on MacOS Apple Silicon (not sure that matters). This is not a XR or VR project. The code that requests these are in PostProcessLayer.cs and PostProcessingRenderContext.cs. It's wrapped in these defines:

    Code (CSharp):
    1. #if (ENABLE_VR_MODULE && ENABLE_VR)
    2.     using XRSettings = UnityEngine.XR.XRSettings;
    3. #endif
    And I'm sure those defines aren't enabled, yet the code is being executed. To me, this seems like an issue with the build process not listening to the conditional defines properly, as these using statements should be skipped.

    The regular Post Processing package should definitely not have dependencies on VR/XR. The suggested solution in console to "Enable the built in package 'VR' in the Package Manager window to fix this error." is not an acceptable fix.
     
  3. ryanmillerca

    ryanmillerca

    Joined:
    Aug 12, 2012
    Posts:
    143