-
Notifications
You must be signed in to change notification settings - Fork 740
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
Override material instance parameters #39
Comments
As UMaterialInstanceConstant doesn't change parameters at Runtime, I have to wrap the following functions in my own UEPyMaterialInstance.h/.cpp
And it all works fine. I can easily create different variation of a material with a script. @rdeioris, what is the contribution policy here? Possible to push my changes to a dev branch? |
Yes, the material interface is not exposed to the reflection system (except for very few cases). I think a UEPyMaterial.c/.cpp api would be a better naming choise, so we can expose all of the material related features (starting from here: https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Materials/UMaterialInterface/index.html) Regarding contribution, simply make a pull request for the master branch (add your credits into the CONTRIBUTORS file) Regarding
combine them in a single function as PostEditChange() is mandatory. |
Ok, I can call PostEditChange() right after SetParentEditorOnly(). The following functions require to call PostEditChange to populate the changes down the chain as well.
As you may want to set multiple parameters without triggering post edit change event for performance reason, PostEditChange() could be exposed separately. |
Ok, at this point i think it is better to expose PostEditChange as a generic UObject method and follow the C++ pattern by calling it manually. |
I didn't realized that PostEditChange is UObject method. Good call. |
Remember to make a pull request when your code is usable :) Thanks |
Is there anyway to do with the current python binding?
I would like to do something like this:
myMaterialInstance.OverrideScalarParameterDefault("UseThisColor", 1.0, True)
Cheers,
Eric
The text was updated successfully, but these errors were encountered: