x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

How to change material parameter in level blueprint

I'm trying to change a scalar parameter for my material in game after I press "J", but it doesn't do anything. I don't want to assign it to a static mesh because it's controls the rotation of a world aligned texture which will affect the entire wolrd. Any help would be appreciated. Here is the blueprint. alt text

Product Version: UE 4.10
Tags:
level blueprint.png (139.0 kB)
more ▼

asked Mar 18 '16 at 06:39 AM in Blueprint Scripting

avatar image

STHG-MasterFULL
21 2 2 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

Thank you Black Phoenix, that helped me a lot. After I saw your last suggestion I tried to apply that to my foliage instance, but then another problem appears... there's no Set Material for foliage instance :(

alt text

So then I found this thread about Material Parameter Collection: https://answers.unrealengine.com/questions/162512/how-to-apply-dynamic-material-instance-to-foliage.html

Which I then applied to my level blueprint.

alt text

Thou I found another answer, your suggestions helped me for future knowledge with blueprints. Thanks a lot.

more ▼

answered Mar 22 '16 at 04:35 PM

avatar image

STHG-MasterFULL
21 2 2 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

It is doing something but the create dynamic material instance isn't applied to anything in your level because you didn't assign it to anything.....to verify that the values are indeed changing though you can grab the variable RotWind and from it drag off and use a Get Vector Parameter Value node then right-click and get a Print String node from the Return Value of the Get Vector Parameter Value node plug it into the In String pin now run that after you press J and it should print the values to the screen so you can see that they are changing...you can't see them change because you are changing them on a material that isn't applied to anything for you to see.

alt text

more ▼

answered Mar 18 '16 at 07:10 AM

avatar image

Black Phoenyx
4.1k 165 9 170

avatar image STHG-MasterFULL Mar 18 '16 at 09:06 AM

Thanks for helping me. Well it looks like it's changing, but according to vector values is changing only the alpha, whereas according to scalar values it's also changing, and from both they change only to the value of 1, even though i set higher. I've thought about trying to put vector parameter and change its X value instead, but it was to no vail. Is there anything else I could do to solve this problem or to understand the situation? I'm pretty new to blueprints and I still don't know too much. Anyway thanks again for the help.alt text

alt text

Edit: Don't care for the potato resolution. Intel HD Graphics don't like too much graphics.

avatar image Black Phoenyx Mar 18 '16 at 04:37 PM

You should apply the material to something in the level in order to see the changes after the dynamic version is created using a set material node and have it set to something in your scene otherwise the dynamic version is just sitting in the BP and not being applied to anything. If there is something in the scene you want it to affect you can move those nodes into it's BP and then apply the material to it there.

These may also be helpful: https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/HowTo/Instancing/index.html https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/MaterialInstances/index.html

avatar image STHG-MasterFULL Mar 18 '16 at 06:40 PM

The material is applied to something. In the images above, the white plane contains the instanced material that I'm trying to change during runtime, since I'm using it as a reference if the blueprint is working. I want it to affect every single thing in the editor that has that material instead of applying it to just one mesh, since I'm trying to adjust the world aligned texture. Because its a grass mesh and it looks that the foliage editor can't accept blueprints. And that's why I'm trying to do that in level blueprint, but I still can't get results in runtime. Edit: In the images above I plugged the nodes incorrectly, so I adjusted them and values are being changed, but the material is not being affected.

avatar image Black Phoenyx Mar 18 '16 at 07:42 PM

When is the material applied? Is it further down in the BP execution? If not it isn't applied to anything in the scene only an instance of the parent material is...not a dynamic instance which is why you need to create one (that is make a new copy of the instance that is now dynamic) which you have done but without that dynamic version actually applied to anything in the level the changes you make to the dynamic version you just created will be sitting in the BP. Use a Set Material Node and apply it to the white plane mesh after it is created.

avatar image STHG-MasterFULL Mar 18 '16 at 08:24 PM

Do I have to make a new variable of the Material Reference type? where should I plug it? Tried making a new copy of the instanced material (by just right-clicking in the instance an creating a new one [which may not be the way you're trying to tell me]), but still no result. Anyway I'm linking the simplified version of the project here and thanks for the help: https://drive.google.com/file/d/0BwxacDzhL5p2TTFQaXp1cGk1aGc/view?usp=sharing

Edit: I'm able to control the parameters in viewport if I make an actor class. But even the actor class won't change during runtime and like I said before, actor class won't help in that situation.

avatar image Black Phoenyx Mar 18 '16 at 09:49 PM

Here's the project files: https://drive.google.com/file/d/0B7UKpIN_HxWXaGZqUWZ6amlScnc/view?usp=sharing

You have to apply the material you are changing to something so you can see the changes you are making:

alt text

setparameter.png (274.4 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Now another question. How do I rotate a Wind Directional Source in Level Blueprint when I press a button?

more ▼

answered Mar 22 '16 at 04:45 PM

avatar image

STHG-MasterFULL
21 2 2 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question