-
Notifications
You must be signed in to change notification settings - Fork 98
Make sure the preset is applied correctly #76
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
base: 1.x
Are you sure you want to change the base?
Conversation
|
I think adding the order is indeed helpful, but the default value of order (-1) does not affect the default value of the current material, which might lead to some misunderstandings. What was your reason for adding this feature? |
If you're referring to preset.order, initially I tried to configure the order for each preset, so I added a default value. However, I realized it would increase management overhead, and now the -1 is just a placeholder so I can clean it up. |
|
I want to ask what the intention is behind "Ignores applying all default presets"? |
I haven't fully reviewed this project, but I've noticed that every setup includes all associated default presets, which is clearly problematic. The solution is to either prepend all default presets or ignore them. Considering that users may apply presets multiple times, it's valuable to separate them. |
|
This is exactly why I say that the preset organization is confusing, because there is no way to confirm whether the preset obtained is from the user, which makes the default preset have two meanings. To simplify this problem, the configuration of the default preset should use another entry. |
|
In certain cases, all active presets must be applied, for example:
LWGUI determines the default values under the current material settings by creating a new material and then compares them with existing values to decide whether to display the undo button. If all presets are not applied when creating a material, the default values are only influenced by the Shader, which contradicts the original design intention of the PresetDrawer. Additionally, if there are overlapping properties among multiple active presets, their priority should be from top to bottom, meaning that properties lower in the material editor have higher priority. |
I'm sorry, I didn't understand your point. Could you provide a specific example and screenshot? |
I don't quite understand what you mean. A higher priority means that the configuration is kept first, which means it is applied later, which is consistent with the ascending order. If the configuration below is more important, its order needs to be greater than the one above. |
|
Yes, the order of props generation is consistent with the order arranged in the Shader. Therefore, the lower the position, the later the preset is applied. |
This is a before and after comparison of the results of applying a material. The first two items are from the user and are invalid because they are overwritten by the default preset. |
|
As I said before, if you need to apply the default configuration, you should use another entry. On the one hand, you cannot confirm the source of the configuration, and on the other hand, the default presets also need to be sorted. |
|
Did you encounter this issue when calling PresetHelper.ApplyPresetsInMaterial()? And you want to apply only the Alpha/Both user-modified Presets, skipping other unmodified PresetDrawers, correct? |
Yes.
No, but due to the default values for newly created materials, there is no need to apply a default preset. If you want the default presets to be included, just use |
I found that the presets could not be applied because its organization is very messy.
This commit does two things: