iOS gives error "No texture data available to upload"
I'm trying to grab an image from a UnityARVideo with the new ARKit plugin and send it as part of a message to the server. I've gotten what I think is the right UnityARVideo object [by getting it from the UnityARCameraManager] and then this code: UnityARVideo video = cameraManager.GetUnityARVideo(); // getter I made myself iosPhoto = (video.m_ClearMaterial.GetTexture("_textureY") as Texture2D); iosPhoto.Apply();
then, in the next step...
byte[] photoData = iosPhoto.EncodeToJPG(75); msg.texture = photoData;
I'm getting this error in the iOS logs: No texture data available to upload
and later... Unable to retrieve image reference
What's going on? Is it straightforward or difficult? How do I start to debug it? I'm pretty new to Unity but not to programming in general.
Also, the formatting sucks, how do I format code nicely?
I'm having the same issue. Both of the textures I try to grab from the clear material return null; As does the mainTexture.
Your answer
Follow this Question
Related Questions
How to load a folder of textures automatically to an array of Raw Images? 2 Answers
1024x1024 Texture2D Takes up over 8MB of memory 0 Answers
Convert Texture to Texture2d takes a lot of time in android device. 0 Answers
How do I use a sliced 2D sprite as the repeating texture on a 3D object? 0 Answers
shader graph messes up the texture (2D) 0 Answers