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"

UMaterialParameterCollection and UProperty, Values not being saved

In UActorComponent, if I use

 UPROPERTY(EditDefaultsOnly)
 UMaterialParameterCollection* MaterialParameterCollection

And create a derived BP class, set the default value, and open/close editor, the default value is lost.

If I use

 UPROPERTY(EditAnywhere)
 UMaterialParameterCollection* MaterialParameterCollection

And create a derived BP class, set the values in each instance, and open/close editor, the variable values stay even after opening / closing the editor. Default values still do not work.

Thankfully I can use StaticLoadObject with a hard reference and that works. Set Vector Parameter Value -node also works in BP for my uses, however, the option to create a variable of type "Material Parameter Collection" is prohibited in blueprints.

This behaviour seems strange to me and very specific to this class. Although the workarounds work just fine, I'd like to know why this happens.

Product Version: UE 4.21
Tags:
more ▼

asked Dec 26 '18 at 09:25 AM in C++ Programming

avatar image

JoSf
253 2 6 9

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

I'll add this here if someone else runs into the issue...

Instead of using the C++ component directly, make it blueprintable. Create a derived blueprint class and set the default values there. For any actors you want to attach the ActorComponent to, use the blueprint version.

This allows me to change the value, and edit it in any actor blueprint I've attached the actor component to, and the set values remain saved even when opening / closing the editor.

more ▼

answered Jan 17 '19 at 11:48 AM

avatar image

JoSf
253 2 6 9

(comments are locked)
10|2000 characters needed characters left
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