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.
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!
asked Dec 04 '17 at 01:53 PM in Blueprint Scripting
Create an array of type Texture2D and add the images there:
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).
Follow this question
Once you sign in you will be able to subscribe for any updates here