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. 

Duplicating Blueprints With Dynamic Material Instance Variables

Having an issue with my variables resetting to the default value when I duplicate them (with any hotkey or any method) within the level editor. The construction script I built uses static meshes, scalar, and vector3 variables but it is only ones that relate to the dynamic material instances that reset when I duplicate. The static meshes stay and one of the dynamic material instances keep their variable values....I have no clue what is going on and from what I have found so far the only thing I can reason is: BUG. But it is probably me. Any thoughts? I'm still fairly new at blueprint.

Product Version: UE 4.14
more ▼

asked Jun 25 '17 at 06:40 AM in Blueprint Scripting

avatar image

1 1

avatar image Fumblemux Jul 08 '17 at 12:51 AM

Still having an issue.. I reordered things in the construction script and some of the variables still reset to default value. Looking back on it, the only variables that stay are the static meshes (I have 8), the float variables that only change static mesh locations, and some of the vector perimeters that decide the color of masked part of 2 dynamic material instances. I completely unplugged the entire construction script and nothing changed. I really have no idea WHY. Even with nothing technically going on in the blueprint (Unplugged at construction beginning), all the variables have the same settings, and the order of the variables changing, only the same variables are being transferred and not reset to default value.....bug?

avatar image Fumblemux Jul 11 '17 at 03:48 AM

After Rewriting the code using arrays and adding more variables, I think I have pinpointed the problem. There is a cap to how many variables will survive the duplication process. Now the code is in a place I like, the variable that resets has nothing to do with dynamic material instances. It is just one of the static mesh component variables that clears when I duplicate. This was not happening till I added my final variable. Is there a setting to increase the amount of variables are held in memory on duplication?

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

2 answers: sort voted first

Did you try the SetVectorParameterValueOnMaterials function that needs an MID as input and a color instead of SetVectorParameterValueOnMaterials that needs a Static Mesh and a Vector?

more ▼

answered Jun 25 '17 at 07:01 AM

avatar image

4.1k 88 38 152

avatar image Fumblemux Jun 25 '17 at 07:16 AM

alt text

Here is the the gist of one of the material instance generation, variable set, and material set. I create all the DMI then Set All the perimeters to public editable variables and then set the material to the target DMI. I think this is the first method you said?

capofblueprint1.jpg (158.0 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Cant Reproduce (4.16) works as expected.




Are you doing anything else with the Variables? Construction script will Run again if you duplicate so if you cahnge things in the script it will happen again on duplication.

Make a simple script if Possible that definitly does not work that I can try out. (not gonna use 4.14 though ;P)

more ▼

answered Jul 08 '17 at 02:29 AM

avatar image

6.9k 143 28 172

avatar image Fumblemux Jul 08 '17 at 05:31 PM

The difference I see from your's to mine is that it has a static mesh component as a target rather than the actor itself, there are several more variables in total (29) and no matter how the construction script is connected (or connected at all) the same variables reset when duplicated. I thought it was a issue with how many or what order the Dynamic Material Instances where being generated, but with or without them being generated it is all the same...

Maybe there is a way to work around this? I was messing around with using Add Child Actor Component but kept running in to an infinite generation error it it was within the blueprint I want to generate (understandably?) and if I generate it from a separate blueprint, I lose control of any variables. Any suggestions? I just want to have this blueprint with all the same variables repeated along a row. To be more specific, its a row of arcade cabinets that is all the same game.

(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