How to get an image asset as a texture 2D

Thu 16. Nov 2017, 10:11

First of all, congratulations and thank you for supporting UE4 community with your latest plugin beta release. It's been highly anticipated with some of the UE developers including myself.

In my Widget BP I'm trying to display a picture from the project assets. I found a node "Load as Texture" with Texture output but the Brush in the Widget requires Texture 2D. Therefore I'm unable to make the node connection from "Return Value" to "Texture (see the attached screenshot). What is the proper (or Nevigo's intended) way to get the picture as a Texture 2D from a project asset?

LoadAsTexture.jpg
LoadAsTexture.jpg (29.77 KiB) Viewed 43522 times


I'd like to share some of my experience with the plugin and also have some tips from the UE4 developper perspective. Would this forum be a proper medium for this?
unreal_dev
 
Posts: 9
Joined: Sun 20. Aug 2017, 09:45

Re: How to get an image asset as a texture 2D

Thu 16. Nov 2017, 11:46

Hi unreal_dev,

The Object returned is in fact a Texture2D passed as a Texture object so you only need to cast it to a Texture2D.
Its probably a good idea to change the LoadAsTexture() return type to Texture2D, as we never could return any other Texture type. I'll add that to our feature requests.

texture2d.png


Hope that helps and Thank you for trying our plugin!

Best regards

Nico
Nico Probst
Senior Software Engineer | Articy | LinkedIn
User avatar
[Articy] Nico Probst
Articy Staff
Articy Staff
 
Posts: 217
Joined: Wed 23. Nov 2011, 09:45
Location: Bochum

Re: How to get an image asset as a texture 2D

Sun 19. Nov 2017, 12:28

Thank you, Nico,

However, just after the Load as Texture node the Cast to Texture 2D fails all the time. I'm working with Maniac Manfred project. I can get all the parameter values from any Asset so the problem seems to be with the Load as Texture node returning Null.

Are you able to load any texture at your end?
unreal_dev
 
Posts: 9
Joined: Sun 20. Aug 2017, 09:45

Re: How to get an image asset as a texture 2D

Mon 20. Nov 2017, 10:40

Hi unreal_dev,

my mistake, you did everything correctly. Its the unreal export inside articy:draft that is broken and is not using the correct folder, also the file picker in the export dialog is wrong.
I fixed it and it should be working with the next articy:draft version, which we probably release in the coming days.

As a workaround so you can test the asset loading: You should find an Articy and ArticyContent folder inside your projects Content folder. The ArticyContent folder is the wrong one, inside that you find a Resources folder and in that a Assets folder, copy that Assets folder into the Articyfolder and the plugin should find the assets.

repair.png
repair.png (6.97 KiB) Viewed 43494 times


ex.
Wrong: Content\ArticyContent\Resources\Assets\Images\Characters\Lunatic.png
Correct: Content\Articy\Assets\Images\Characters\Lunatic.png

Sorry for the inconvenience and thanks for reporting it!

Best regards

Nico
Nico Probst
Senior Software Engineer | Articy | LinkedIn
User avatar
[Articy] Nico Probst
Articy Staff
Articy Staff
 
Posts: 217
Joined: Wed 23. Nov 2011, 09:45
Location: Bochum

Re: How to get an image asset as a texture 2D

Mon 20. Nov 2017, 11:01

Thank you, Nico, after moving the Assets folder it works
unreal_dev
 
Posts: 9
Joined: Sun 20. Aug 2017, 09:45

Re: How to get an image asset as a texture 2D

Wed 29. Nov 2017, 14:19

I've changed the line in ArticyHelpers.h:70
from:
Code: Select all
static const FString ArticyFolder = FString(TEXT("/Game/Articy"));

to:
Code: Select all
static const FString ArticyFolder = FString(TEXT("/Game/ArticyContent/Resources"));


It fixes the issue.
dread
 
Posts: 19
Joined: Wed 29. Nov 2017, 14:10

Return to articy:draft Unreal Importer

Who is online

Users browsing this forum: No registered users and 2 guests

Who We Are
Contact Us
Social Links