RigTag
(Michael Alexcan)
March 27, 2020, 1:08am
2490
**Research **
Thanks for sharing the additional info, helps me lock onto the faster :)
Texture2D and Texture2DDynamic both derive from UTexture, but that is their common base class, so you can't cast a Texture2DDynamic to Texture2D.
Because if you can do that, you can convert Texture2DDynamic -> Texture2D via a UTexture initialization.
I've looked through the 4.15 Engine source code and Texture2DDynamic is used in only a few places, and there doesn't seem to be a conversion to UTexture2D.
The only use of Texture2DDynamic currently appears to be Download image -> Set Brush From Texture 2D dynamic.
Or it can be used with a Texture Parameter in a material shader.
I've figured out how to get the platform data from Texture2DDynamic
You have to use UTexture base class which returns a pointer to a pointer:
```
/**
* Textures that use the derived data cache must override function and
* provide a pointer to the linked list of platform data.
*/
virtual FTexturePlatformData** GetRunningPlatformData() { return NULL; }
```
For anyone trying at home make sure to dereference the ptr ptr carefully before trying to even think about access the ptr itself!
```
FTexturePlatformData** PtrPtr = T2D->GetRunningPlatformData();
if(!PtrPtr) return false;
FTexturePlatformData* PlatformDataPtr = *PtrPtr; //Check before dereferencing! ♥
//Now check the ptr itself too
if(!PlatformDataPtr)
{
return false;
}
//use the platform data
```
However the is that the platform data for a Texture2DDynamic does not appear to be valid because I guess Texture2DDynamic does not use derived data cache.
**So that means we need to use the FTextureSource itself, I think, to get the byte data.**
But I do not see how to get the byte data from FTextureSource where I will know what the color ordering is to convert to FLinearColor and I am out of to research .
Community Assistance Requested
Anyone want to continue and finish it?
We need a second version of GetPixel data that accepts FTexture2DDyanamic
Is there any plans on getting the Download Image Working with your plugin?
i was told that i can modified that { Download Image } blueprint node with c++ to have it take 2DTexture instead of waiting for the second GetPixel to accepts FTexture2DDyanamic but am not good with C++ :(.
we’ll probably be a piece of cake for you to share so that we can enjoy the plugin in the meantime.
Here’s a image of someone showing me that he got it working But not willing to share :
Thank you.