x

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"

Failed to set media texture to a media texture which is from "Construct object from class"

This is my construction script. alt text

But when I play the media player,My Texture get nothing,the height is zero and the material is wrong just like that. alt text

And if i edit the construction script,make my Texture an asset from content explorer.Everything is OK.alt text

alt text

Why asset are different from "Construct object from class" ?

Product Version: UE 4.16
Tags:
捕获1.png (540.0 kB)
捕获2.png (192.6 kB)
捕获3.png (424.6 kB)
捕获4.png (353.0 kB)
more ▼

asked Aug 12 '17 at 03:28 AM in Blueprint Scripting

avatar image

Wxzuir
1

avatar image Situx Aug 06 '18 at 05:10 AM

Almost a year later this still is an issue. Looks like the created texture is not properly instantiated with “construct from class” on a construction script. If you set the variable to public and open it from the properties pane on the main viewport, you can see it’s not working. Then if you change any property inside the asset, like checking sRGB, it gets rendered.

avatar image herb64 Sep 05 '18 at 10:06 AM

UE 4.20.2 - running into the same issue: when using "Construct media texture" in blueprint - just a white screen is rendered. Trying to set all variables (SRGB, Clear Color, autoclear...) as presented in Content Browser for my working texture does not help. This is how I tried to create my media texture. When just setting "Tex2use" to a media texture created in Content Browser texture, it works fine. Rest of BP code unchanged. alt text

avatar image herb64 Sep 05 '18 at 10:44 AM

With UE4 4.20.2 : I did also run into a "white screen" when doing the "Construct Media Texture" in the Actor Blueprint code at BeginPlay. It works for me, if doing the "Construct Media Texture" in the Construction Script (as you obviously also did), but ONLY this construction.

Then at BeginPlay in Event Graph, doing the all other stuff:

  • Construct Media Player

  • Create Dynamic Material Instance

  • Set Texture parameter value to assign the texture to the material

  • Set media player to the material texture

  • Set media Player to the Media Sound Component

  • Run "Open URL" on Media Player to stream an MP4 URL (contained in string)

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
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