Skip to content

Fixed an error when switch area light shape to disk while an emissive… #1112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed glitch in Project settings window when selecting diffusion profiles in material section (case 1253090)
- Fixed issue with light layers bigger than 8 (and above the supported range).
- Fixed issue with culling layer mask of area light's emissive mesh
- Fixed errors when switching area light to disk shape while an area emissive mesh was displayed.

### Changed
- Improve MIP selection for decals on Transparents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,10 @@ public void Update()
settings.Update();

lightGameObject.Update();
deportedAreaLightEmissiveMeshMotionVector?.serializedObject.Update();
deportedAreaLightEmissiveMeshLayer?.serializedObject.Update();
if (deportedAreaLightEmissiveMeshMotionVector.IsTargetAlive())
deportedAreaLightEmissiveMeshMotionVector?.serializedObject.Update();
if (deportedAreaLightEmissiveMeshLayer.IsTargetAlive())
deportedAreaLightEmissiveMeshLayer?.serializedObject.Update();
}

void ApplyInternal(bool withDeportedEmissiveMeshData)
Expand All @@ -482,8 +484,10 @@ void ApplyInternal(bool withDeportedEmissiveMeshData)
settings.ApplyModifiedProperties();
if (withDeportedEmissiveMeshData)
{
deportedAreaLightEmissiveMeshMotionVector?.serializedObject.ApplyModifiedProperties();
deportedAreaLightEmissiveMeshLayer?.serializedObject.ApplyModifiedProperties();
if (deportedAreaLightEmissiveMeshMotionVector.IsTargetAlive())
deportedAreaLightEmissiveMeshMotionVector?.serializedObject.ApplyModifiedProperties();
if (deportedAreaLightEmissiveMeshLayer.IsTargetAlive())
deportedAreaLightEmissiveMeshLayer?.serializedObject.ApplyModifiedProperties();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ public static IEnumerable<string> EnumerateDisplayName(this SerializedProperty p
yield return property.displayName;
}

public static bool IsTargetAlive(this SerializedProperty property)
=> property != null && property.serializedObject.targetObject != null &&
!property.serializedObject.targetObject.Equals(null);

/// <summary>
/// Helper to get an enum value from a SerializedProperty.
/// This handle case where index do not correspond to enum value.
Expand Down