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"

How to create previews of materials dynamically?


I'm making an architectural app (blueprints) where it is possible to visit a house or an apartment and change objects materials. To do that there is an UI that shows buttons with the materials preview or thumbnails so user can click the one he wants. But for now i'm using textures i made with Photoshop, and what i want is to be able to make dynamic thumbnails (texture) or materials, because i have hundreds of them now, and i need it to be automatic.

So my question : is it possible to have a camera somewhere in the scene with a sphere or a cube in front of it, and each time i want a preview , i can just apply the material to that mesh and take a '"picture" of it so i can use it as a texture ? or is there any other way to do that ?


Product Version: UE 4.18
more ▼

asked Dec 27 '17 at 11:30 AM in Blueprint Scripting

avatar image

11 2 8

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

1 answer: sort voted first

You can use a Static Camera and pilot it to view your scene and object from its position. You can then take a High Res screen shot from your viewport by clicking on the arrow on the top left corner of your Viewport and selecting High Resolution Screenshot. You can read about using static camera in here. Alternatively you can use a scene capture component. There's a usage example of it in ContentExamples. You should also be able to find tutorials on how to use a scene capture component online (Especially in minimaps tutorials).

Hope this answered your question.

more ▼

answered Dec 27 '17 at 11:49 AM

avatar image

1.5k 10 10 17

avatar image ahmbouth Dec 27 '17 at 12:00 PM

hey :) thanks for the answer :) But the thing is that i don't want to take the screenshots myself, nor to store them, i just want the blueprint to create a temporary thumbnail to stick it on the button, and make it disappear whenever i stop using that UI. So the app have to take the screenshot and use it as a texture without saving it on the disk. and btw ... sorry for my english :)

avatar image Vizgin Dec 27 '17 at 12:31 PM

Maybe this youtube video can help. He demonstrates how to use a Camera to take a picture and update the UI. I believe it's similar to what you want, i.e. adding a camera and automatically capturing the scene and then saving it into a texture. The only difference is that instead of putting the 2nd camera in your character blueprint, you can use a static camera and put it somewhere in the level. After you positioned your camera in the scene, go to the Level blueprint, click and drag your Camera from the World Outliner into the level blueprint to get a reference to it, and then implement those simple blueprints scripting in there. Finally, instead of Minimap, you would be using a button and updating its appearance! You might also want to use a Plane or Box instead of a Sphere mesh to capture a nice full shot :-)

avatar image ahmbouth Dec 27 '17 at 12:56 PM

cool :) i'm going to watch the tutorial now and try to apply it to my scene, thanks again :)

avatar image Vizgin Dec 27 '17 at 01:03 PM

You're welcome :-) Please consider marking the question as "resolved" if your issue has been addressed. It will help the community in both referring to this solution and also better filter the unanswered questions. Thanks.

(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