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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Static Mesh Dosnt accept dynamic Material

Hello All,

Im trying to apply a dynamic material instance to a static cone mesh. i can apply my non dynamic material normally, but when i try to create a dynamic version and apply that, it simply wont appear on the mesh in the PIE mode.

//.h

//pointer to dynamic material intance

 UPROPERTY()
 UMaterialInstanceDynamic * ConeMaterialInstance;

**// in the character constructor .cpp

//Get Blueprint Material from project

 static ConstructorHelpers::FObjectFinder<UMaterial> ConeMaterial(TEXT("Material'/Game/Material/ConeMat.ConeMat'"));

 //Create dynamic Material and store it

 ConeMaterialInstance = UMaterialInstanceDynamic::Create(ConeMaterial.Object, this);

//set material to cone mesh

 ConeMesh->SetMaterial(0, ConeMaterialInstance);
 
 //ChangeMaterial Color to test

 ConeMaterialInstance->SetVectorParameterValue(FName(TEXT("Color")), FLinearColor(2.0f, 0.0f, 0.0f, 1.0f));

For some reason the dynamic material doe not appear and instead shows the default grey check material.

I looked at this post for answers and implement what they said from it, but i still cant get it to work. https://answers.unrealengine.com/questions/2888/unable-to-change-material-colour.html

Any ideas would be great :) i think im missing something really basic.

Product Version: Not Selected
Tags:
more ▼

asked Aug 02 '14 at 06:42 AM in C++ Programming

avatar image

telso2
6 1 2 2

avatar image donggas90 Aug 02 '14 at 04:58 PM

Try to change mobillity of static mesh component to movable.

avatar image telso2 Aug 03 '14 at 08:42 AM

mmm, that didnt seem to work either. Its weird the setmaterial() function works when i apply the non dynamic material to it, but when i apply the dynamic material it doesnt work.

The pointer i get back from the Create() funciton is valid and not null, so i assume that means the function has created a dynamic material instance, it just does not want to assign it to the mesh...

avatar image Doug E ♦♦ STAFF Dec 12 '14 at 09:15 PM

Hey telso2-

I am investigating your report about the dynamic instances and would like to ask a couple of questions. Are you still experiencing this issue when using the 4.6 version of the engine? Are you trying to set up the dynamic material in the constructor or elsewhere in the class?

Cheers

Doug Wilson

avatar image telso2 Dec 15 '14 at 03:03 AM

Hey Doug,

Thanks for following this up, i appreciate it. This was for a project i was doing many months ago, I no longer have the files. I found a workaround for it at the time. I know that's not much help, sorry.

Tom.

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

1 answer: sort voted first

Hey telso2-

Since this is no longer a problem for you I will be marking this post as resolved for tracking purposes. If you do come across this issue in the future remember to check the latest version to see if it has already been addressed. If it is still a problem you can reopen this post with any details regarding the error or steps to reproduce it.

Cheers

Doug Wilson

more ▼

answered Dec 15 '14 at 04:11 PM

(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