-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat(shader-picker): new handling of shaders #259
base: develop
Are you sure you want to change the base?
feat(shader-picker): new handling of shaders #259
Conversation
* fix(shader): Prevent resetting parameters in shader settings Introduce an early return check for the shader's variation. If the selected variation is the same as the previously active one, the function exits early, preventing any unnecessary resetting of shader parameters. Fix StjerneIdioten#180 * feat(material): New way of adding shaders - The shaders will now be automatically loaded in a EnumProperty through the data path set in addon preferences - This includes a operator that will migrate the old "source" property over to the new "shader" enum property (and preserve all the other shader related data) - Made it possible to add "material_name" to the load_shader and load_shader_variation operators so it can be called through API without needing to have a active object with a active material to run the operators * Added support to export new shader setup
Convert from the old format while loading a file instead through a manual click on an operator
Delete all the functions that save out the data as it is no longer needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not really sure what to look after anymore haha.
The only thing that I have not included is support for custom shaders, not entirly sure where or how it should be done. In addition to that, probably 99.9% of cases in game shaders is used 😅Of course thats no reason not to include it. But yea... 🙈
def shader_getter(self): | ||
return self.get('shader', 0) | ||
|
||
shader: EnumProperty( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add to shader enum Custom Path entry and when it is selected, the path getter will show. + if u will not rename the variable and it still will be i3d_attributes.shader_picker.source, then even old blend files will be supported, because value is stored even when is not visible, for the shader enum, i recommend to parse all .xml files in data/shaders file, in case Giants will add / remove some shaders. |
Hmm yea adding "Custom Path" entry to enum is possible, but I am not 100% sure what I think about it tbh. Might become hard to find your own "custom shader" in a list with already 50 shaders in it.
|
You can make shader selection as searchbar, or you can manually place at second index "Custom Path", if the default is None. So it will be always on top of the enum. |
For the parameters, is there any way we could add default values, min/max values & for FS25 description to each of the parameter? 🤔 Have looked a little bit at it and it seems to not be doable through PropertyGroup properties at least ad FloatVectorProperty only support single float input for min/max anyways. |
closes: #180 #179 #170 #214
Can potentially also solve #68 but need more info on what it should look like