Giter Site home page Giter Site logo

Comments (6)

rdeioris avatar rdeioris commented on June 24, 2024 1

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.

from unrealenginepython.

jiamingfeng avatar jiamingfeng commented on June 24, 2024

As UMaterialInstanceConstant doesn't change parameters at Runtime, I have to wrap the following functions in my own UEPyMaterialInstance.h/.cpp

SetScalarParameterValueEditorOnly();
SetVectorParameterValueEditorOnly();
SetTextureParameterValueEditorOnly();
SetParentEditorOnly();
PostEditChange();

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?

from unrealenginepython.

rdeioris avatar rdeioris commented on June 24, 2024

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

SetParentEditorOnly();
PostEditChange();

combine them in a single function as PostEditChange() is mandatory.

from unrealenginepython.

jiamingfeng avatar jiamingfeng commented on June 24, 2024

Ok, I can call PostEditChange() right after SetParentEditorOnly(). The following functions require to call PostEditChange to populate the changes down the chain as well.

SetScalarParameterValueEditorOnly();
SetVectorParameterValueEditorOnly();
SetTextureParameterValueEditorOnly();

As you may want to set multiple parameters without triggering post edit change event for performance reason, PostEditChange() could be exposed separately.

from unrealenginepython.

jiamingfeng avatar jiamingfeng commented on June 24, 2024

I didn't realized that PostEditChange is UObject method. Good call.

from unrealenginepython.

rdeioris avatar rdeioris commented on June 24, 2024

Remember to make a pull request when your code is usable :) Thanks

from unrealenginepython.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.