Skip to content

Bugfix: 1238833 #283

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

Closed
wants to merge 4 commits into from
Closed
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 @@ -568,6 +568,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed shadowmask UI now correctly showing shadowmask disable
- Made more explicit the warning about raytracing and asynchronous compute. Also fixed the condition in which it appears.
- Fixed a null ref exception in static sky when the default volume profile is invalid.
- Fixed errors messages when edit DecalProjector shape (case 1238833)

### Changed
- Improve MIP selection for decals on Transparents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,22 +150,15 @@ public Bounds OnGetFrameBounds()
public void UpdateMaterialEditor()
{
int validMaterialsCount = 0;
for (int index = 0; index < targets.Length; ++index)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this problematic loop on target.

It has no meanings on this file l.112 as it is used as a hook on each DecalProjector when the material change. So there we should not use the target notion. We should have a DecalProjector parameter to gather changes.

On line 109 though, the same function is called from OnEnable where multiselection can work on several target at a time.

It seams that this function (original version) is OK for line 109 but we should add another dedicated callback for the individual updated used in event

Copy link
Contributor Author

@skhiat skhiat May 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After slack discussion. The problem seems to come from another direction.

{
DecalProjector decalProjector = (targets[index] as DecalProjector);
if((decalProjector != null) && (decalProjector.material != null))
validMaterialsCount++;
}
DecalProjector decalProjector = (target as DecalProjector);
if ((decalProjector != null) && (decalProjector.material != null))
validMaterialsCount++;
// Update material editor with the new material
UnityEngine.Object[] materials = new UnityEngine.Object[validMaterialsCount];
validMaterialsCount = 0;
for (int index = 0; index < targets.Length; ++index)
{
DecalProjector decalProjector = (targets[index] as DecalProjector);

if((decalProjector != null) && (decalProjector.material != null))
materials[validMaterialsCount++] = (targets[index] as DecalProjector).material;
}
if ((decalProjector != null) && (decalProjector.material != null))
materials[validMaterialsCount++] = (target as DecalProjector).material;
m_MaterialEditor = (MaterialEditor)CreateEditor(materials);
}

Expand Down