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"

Loading Texture on startup

So currently I am using Unreal Engine 4.18 to make an application for my bachelor thesis about VR Therapy. The application will be a simulation for holding presentations.

My goal is to create an application, were the user can just drag and drop his presentation slides into a specific "textures folder" following a naming convention like Slide1, Slide2 ... so that the game can take those textures and apply them to the materials. alt text

I cam across Rama and his Victory Plugin, there is a node to load textures (https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/4014-39-rama-s-extra-blueprint-nodes-for-you-as-a-plugin-no-c-required/page36?3851-(39)-Rama-s-Extra-Blueprint-Nodes-for-You-as-a-Plugin-No-C-Required!=&viewfull=1)

However I am not sure how to store those textures once I got them, there is no " set texture" node. Can someone help me getting this to work? The idea is that I will just create about 40 materials and when I start the game, load the slide texture from the given path to the Materials.

Thanks in Advance!

Product Version: UE 4.18
fetch.jpg (243.7 kB)
more ▼

asked Dec 04 '17 at 01:53 PM in Blueprint Scripting

avatar image

1 2 3

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

1 answer: sort voted first

Create an array of type Texture2D and add the images there:

alt text

This will allow you to fetch them by index later on. Once you have the array, create a Dynamic Material Instance with a TextureSample converted to a parameter. Now you can fetch any existing index from the ImageArray and feed it to the Dynamic Material Instance.

If you prefer to fetch images by name, look into Map (Dictionary).

capture.png (72.6 kB)
more ▼

answered Dec 04 '17 at 03:25 PM

avatar image

15.3k 77 26 62

avatar image LauriGhost Dec 04 '17 at 04:53 PM

Hey, thanks for your reply!

The thing is also, I don't know how to add the node " Set Brush from Texture" somewhow this is not available to me. I already created an array for changing materials ( another function), can i somehow add what you just said to my blueprints?

In the end I want the application to be able to store loaded textures into different materials, and after that the user can change the materials in runtime from one to another. ( material changing is working, but the part about loading and storing textures is not yet created)

alt text

avatar image Everynone Dec 05 '17 at 08:35 AM

Brushes in SetBrushFromTexture are used in UMG which handles user interface. Judging by the code above, it's not something you need to worry about as you're using meshes instead.

I do not have Rama's plugin installed so I can't give you a proper visual solution.

You already have an array MyChoices - I'm assuming it stores the textures you want. In BeginPlay for this blueprint, run the node that loads textures and and add them to the array like in the screenshot I posted.

If you populated the array manually (since material changing is working), you will need to Clear the array first - otherwise you'll add the loaded textures to the end of the list rather than replace them.

If it gives you a headache, let me know. I'll try to get my hands on the plugin.

edit: so it would look similar to this:

alt text

untitled.png (139.2 kB)
(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