Commit b833d56
SpeedTree 9 - Add dependency on extracted materials & Fix remapping of materials
Big conversation here: https://unity.slack.com/archives/C05C7C93RL4/p1701979272164239
Big description here: https://jira.unity3d.com/browse/UUM-57578?filter=-1
`ISSUE 1`
This is a fix for SpeedTree9 assets only. That's the best solution I found, considering the limitation of the Preview system. Basically, with this PR, we now have a dependency on the extracted materials (so outside the Prefab).
With it, if the user deletes an extracted Material (non-reversible operation), it re-triggers the preview generation (thanks to the function `GenerateAssetData` in `PreviewImporter.cpp`).
Also, instead of having a pink Mesh in the scene (since there's no more material attached to the Mesh), the importer is regenerating the materials as embedded automatically, so the user doesn't have to `Reset` the asset or manually press `Apply & Generate Materials). Pretty convenient.
`ISSUE 2`
Also, there was issues with the remapping options. Basically, the entry materials were duplicated and sometimes the remapping wasn't working (material was set to null after hitting `apply`). Adding the variable `defaultName` avoid those issues, by always keeping the initial material name (e.g `RulesExampleMat`) on the left of the entry, and having the real material name and instance (e.g MyMatyellow) in the object field.
Here's the final results in action (sorry for the poor gif quality, had to compress a lot the gif):

`ISSUE 3`
When textures were moved somewhere else in the project (i.e not next to the assets), it was breaking the material references to them. Now it's not the case anymore, we are checking for them if they are not next to the asset.
1 parent 8104c04 commit b833d56
File tree
1 file changed
+7
-4
lines changed- Packages/com.unity.render-pipelines.high-definition/Editor/Material/Nature
1 file changed
+7
-4
lines changedLines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
82 | 85 | | |
83 | 86 | | |
84 | | - | |
85 | | - | |
| 87 | + | |
| 88 | + | |
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
| |||
0 commit comments