Download

Question about FImportVertexTextureHelper::PickVertexColorFromTex

Hi,
Im having troubles getting the color of a vertex from uv coordinates.

The Syntax goes like
void PickVertexColorFromTex
(
FColor & NewVertexColor,
uint8 * MipData,
FVector2D & UV,
UTexture2D * Tex,
uint8 & ColorMask
)

Module MeshPaint
Header Editor/MeshPaint/Public/MeshPaintEdMode.h
Source Editor/MeshPaint/Private/MeshPaintEdMode.cpp

I don’t understand how to use uint8 & ColorMask
its there a tutorial to understand uint8 data structure

Also When I include Editor/MeshPaint/Public/MeshPaintEdMode.h I got fatal error: ‘IVREditorModule.h’ file not found

My code:


BPF_ColorInfo.h
#pragma once

#include "Kismet/BlueprintFunctionLibrary.h"
#include "Editor/MeshPaint/Public/MeshPaintEdMode.h"
#include "BPF_ColorInfo.generated.h"

 * 
 */
UCLASS()
class CHARCUSTOMIZATION_API UBPF_ColorInfo : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()
	
    UFUNCTION(BlueprintPure, meta = (DisplayName = "UV Color Info", CompactNodeTitle = "UVColorInfo", Keywords = "Get Color From UV Coordinates"), Category = Game)
    static FColor M_GetColorInfo(UTexture2D* colorCodeSet,  FVector2D uv);
	
	
};


BPF_ColorInfo.cpp

#include "CharCustomization.h"
#include "BPF_ColorInfo.h"


FColor  UBPF_ColorInfo::M_GetColorInfo(UTexture2D* colorCodeSet, FVector2D uv){
    
    
    FColor v_color = FColor::Black;
  
    uint8 colorMask = 0x00;
    uint8* mipData = static_cast<uint8*>(colorCodeSet->PlatformData->Mips[0].BulkData.Lock(LOCK_READ_WRITE));

   FImportVertexTextureHelper::PickVertexColorFromTex(v_color, mipData,uv, colorCodeSet, colorMask);
    return v_color;
}




cheers,
-Alex