Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to packaging include this plugin #4

Open
YongsunLee opened this issue Jan 19, 2022 · 8 comments
Open

How to packaging include this plugin #4

YongsunLee opened this issue Jan 19, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@YongsunLee
Copy link

Hi, @nama-gatsuo

I am trying to package (win64) a project using this plugin.

I'm getting an error in the packaging and I want to know what I'm missing.

Can you give me an answer about the packaging?

@nama-gatsuo
Copy link
Owner

nama-gatsuo commented Jan 19, 2022

Hi,

Thanks for pointing it out.
After quick research, 2 major problems were found.

  1. dlls & libs from Azure Kinect SDK should be located inside of project directory such like .\Plugins\AzureKinect\Binaries\Win64\.
    Currently they are in outside and referred from build script (AzureKinectBuild.cs)

  2. Try-Catch is NOT allowed to use in UE for packaging
    Try-Catch is heavily used in AzureKinectDevice.cpp since the SDK is designed to throw exception.

If they are resolved, the project should be packaged.
I just came up with a solution but please note that it's a very temporal patch

Follow bellow:

  • Locate k4a.dll, k4a.lib, k4abt.dll, k4abt.lib in C:\PJRoot\Plugins\AzureKinect\Binaries\Win64\
  • Fix AzureKinectBuild.cs to point correct path above
// Copyright Epic Games, Inc. All Rights Reserved.

using System.IO;
using UnrealBuildTool;

public class AzureKinect : ModuleRules
{
	public AzureKinect(ReadOnlyTargetRules Target) : base(Target)
	{
		// bEnableExceptions = true;

		PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

		if (Target.Platform == UnrealTargetPlatform.Win64)
		{
			string sdkPath = System.Environment.GetEnvironmentVariable("AZUREKINECT_SDK");
			string bodySdkPath = System.Environment.GetEnvironmentVariable("AZUREKINECT_BODY_SDK");

			PublicIncludePaths.AddRange(
				new string[] {
					Path.Combine(sdkPath, "sdk", "include"),
					Path.Combine(bodySdkPath, "sdk", "include")
				});

			PublicAdditionalLibraries.AddRange(
				new string[] {
					@"C:\PJRoot\Plugins\AzureKinect\Binaries\Win64\k4a.lib",
					@"C:\PJRoot\Plugins\AzureKinect\Binaries\Win64\k4abt.lib",
					//Path.Combine(sdkPath, "sdk", "windows-desktop", "amd64", "release", "lib", "k4a.lib"),
					//Path.Combine(bodySdkPath, "sdk", "windows-desktop", "amd64", "release", "lib", "k4abt.lib")
				});

			//string depthEngineDllPath = Path.Combine(sdkPath, "sdk", "windows-desktop", "amd64", "release", "bin", "depthengine_2_0.dll");
			//string k4aDllPath = Path.Combine(sdkPath, "sdk", "windows-desktop", "amd64", "release", "bin", "k4a.dll");
			string k4aDllPath = @"C:\PJRoot\Plugins\AzureKinect\Binaries\Win64\k4a.dll";
			//string k4abtDllPath = Path.Combine(bodySdkPath, "sdk", "windows-desktop", "amd64", "release", "bin", "k4abt.dll");
			string k4abtDllPath = @"C:\PJRoot\Plugins\AzureKinect\Binaries\Win64\k4abt.dll";

			PublicDelayLoadDLLs.AddRange(
				new string[] {
					// depthEngineDllPath,
					k4aDllPath,
					k4abtDllPath,
				});

			// RuntimeDependencies.Add(depthEngineDllPath);
			RuntimeDependencies.Add(k4aDllPath);
			RuntimeDependencies.Add(k4abtDllPath);
		}

		PrivateIncludePaths.AddRange(
			new string[]
			{
				"AzureKinect/Private",
			});

		PrivateDependencyModuleNames.AddRange(
			new string[]
			{
				"Core",
				"CoreUObject",
				"Engine",
				"RenderCore",
				"RHI",
				"AnimGraphRuntime",
			});
		
	}
}
  • Comment out all try-catch in AzureKinectDevice.cpp
// Fill out your copyright notice in the Description page of Project Settings.
#include "AzureKinectDevice.h"
#include "Runtime/RHI/Public/RHI.h"

DEFINE_LOG_CATEGORY(AzureKinectDeviceLog);

UAzureKinectDevice::UAzureKinectDevice() :
	NativeDevice(nullptr),
	Thread(nullptr),
	DeviceIndex(-1),
	bOpen(false),
	NumTrackedSkeletons(0),
	DepthMode(EKinectDepthMode::NFOV_2X2BINNED),
	ColorMode(EKinectColorResolution::RESOLUTION_720P),
	Fps(EKinectFps::PER_SECOND_30),
	SensorOrientation(EKinectSensorOrientation::DEFAULT),
	bSkeletonTracking(false)
{
	LoadDevices();
}

UAzureKinectDevice::UAzureKinectDevice(const FObjectInitializer& ObjectInitializer) :
	Super(ObjectInitializer)
{
	LoadDevices();
}

void UAzureKinectDevice::LoadDevices()
{
	
	int32 NumKinect = GetNumConnectedDevices();
	
	DeviceList.Empty(NumKinect + 1);
	DeviceList.Add(MakeShared<FString>("No Device"));

	if (NumKinect > 0)
	{
		for (int32 i = 0; i < NumKinect; i++)
		{
			//try
			{
				// Open connection to the device.
				k4a::device Device = k4a::device::open(i);
				// Get and store the device serial number
				DeviceList.Add(MakeShared<FString>(Device.get_serialnum().c_str()));
				Device.close();
			}
			/*catch (const k4a::error& Err)
			{
				UE_LOG(AzureKinectDeviceLog, Error, TEXT("Can't load: %s"), TCHAR_TO_UTF8(ANSI_TO_TCHAR(Err.what())));
			}*/
		}
	}
	
}

bool UAzureKinectDevice::StartDevice()
{
	if (bOpen)
	{
		UE_LOG(AzureKinectDeviceLog, Warning, TEXT("This Device has been open."));
		return false;
	}

	
	if (DeviceIndex == -1)
	{
		UE_LOG(AzureKinectDeviceLog, Warning, TEXT("No Device is selected."));
		return false;
	}

	CalcFrameCount();

	//try
	{
		// Open connection to the device.
		NativeDevice = k4a::device::open(DeviceIndex);

		// Start the Camera and make sure the Depth Camera is Enabled
		k4a_device_configuration_t DeviceConfig = K4A_DEVICE_CONFIG_INIT_DISABLE_ALL;
		DeviceConfig.depth_mode = static_cast<k4a_depth_mode_t>(DepthMode);
		DeviceConfig.color_resolution = static_cast<k4a_color_resolution_t>(ColorMode);
		DeviceConfig.camera_fps = static_cast<k4a_fps_t>(Fps);
		DeviceConfig.color_format = k4a_image_format_t::K4A_IMAGE_FORMAT_COLOR_BGRA32;
		DeviceConfig.synchronized_images_only = true;
		DeviceConfig.wired_sync_mode = K4A_WIRED_SYNC_MODE_STANDALONE;

		NativeDevice.start_cameras(&DeviceConfig);

		KinectCalibration = NativeDevice.get_calibration(DeviceConfig.depth_mode, DeviceConfig.color_resolution);
		KinectTransformation = k4a::transformation(KinectCalibration);

		if (bSkeletonTracking)
		{
			k4abt_tracker_configuration_t TrackerConfig = K4ABT_TRACKER_CONFIG_DEFAULT;
			TrackerConfig.sensor_orientation = static_cast<k4abt_sensor_orientation_t>(SensorOrientation);

			// Retain body tracker
			BodyTracker = k4abt::tracker::create(KinectCalibration, TrackerConfig);
		}
		
	}
	/*catch (const k4a::error& Err)
	{
		if (NativeDevice)
		{
			NativeDevice.close();
		}

		FString Msg(ANSI_TO_TCHAR(Err.what()));
		UE_LOG(AzureKinectDeviceLog, Error, TEXT("Cant't open: %s"), *Msg);
		return false;
	}*/
	
	Thread = new FAzureKinectDeviceThread(this);

	bOpen = true;

	return true;
}

bool UAzureKinectDevice::StopDevice()
{

	if (!bOpen)
	{
		UE_LOG(AzureKinectDeviceLog, Warning, TEXT("KinectDevice is not running."));
		return false;
	}

	if (Thread)
	{
		Thread->EnsureCompletion();
		Thread = nullptr;
	}

	if (BodyTracker)
	{
		BodyTracker.shutdown();
		BodyTracker.destroy();
		BodyTracker = nullptr;
	}

	if (RemapImage)
	{
		RemapImage.reset();
	}

	if (NativeDevice)
	{
		NativeDevice.stop_cameras();
		NativeDevice.close();
		NativeDevice = nullptr;
		UE_LOG(AzureKinectDeviceLog, Verbose, TEXT("KinectDevice Camera is Stopped and Closed."));
	}

	bOpen = false;
	return true;
}

int32 UAzureKinectDevice::GetNumConnectedDevices()
{
	return k4a_device_get_installed_count();
}

int32 UAzureKinectDevice::GetNumTrackedSkeletons() const
{
	if (!bOpen)
	{
		return 0;
	}
	if (!bSkeletonTracking)
	{
		UE_LOG(AzureKinectDeviceLog, Error, TEXT("GetNumTrackedBodies: Skeleton Tracking is disabled!"));
		return 0;
	}

	FScopeLock Lock(Thread->GetCriticalSection());
	return NumTrackedSkeletons;
}

FAzureKinectSkeleton UAzureKinectDevice::GetSkeleton(int32 Index) const
{
	if (bOpen)
	{
		if (!bSkeletonTracking)
		{
			UE_LOG(AzureKinectDeviceLog, Error, TEXT("GetSkeleton: Skeleton Tracking is disabled!"));
			return FAzureKinectSkeleton();
		}

		FScopeLock Lock(Thread->GetCriticalSection());
		if (Skeletons.IsValidIndex(Index))
		{
			return Skeletons[Index];
		}
		else
		{
			UE_LOG(AzureKinectDeviceLog, Error, TEXT("GetSkeleton: Index is out of range!"));
			return FAzureKinectSkeleton();
		}
	}
	else
	{
		return FAzureKinectSkeleton();
	}
	
}

const TArray<FAzureKinectSkeleton>& UAzureKinectDevice::GetSkeletons() const {
	if (bOpen)
	{
		FScopeLock Lock(Thread->GetCriticalSection());
		return Skeletons;
	}
	else
	{
		return Skeletons;
	}
}

void UAzureKinectDevice::UpdateAsync()
{
	// Threaded function
	//try
	{
		if (!NativeDevice.get_capture(&Capture, FrameTime))
		{
			UE_LOG(AzureKinectDeviceLog, Verbose, TEXT("Timed out waiting for capture."));
		}
	}
	/*catch (const k4a::error& Err)
	{
		FString Msg(ANSI_TO_TCHAR(Err.what()));
		UE_LOG(AzureKinectDeviceLog, Error, TEXT("Can't capture frame: %s"), *Msg);
		return;
	}*/

	if (ColorMode != EKinectColorResolution::RESOLUTION_OFF && ColorTexture)
	{
		CaptureColorImage();
	}

	if (DepthMode != EKinectDepthMode::OFF && DepthTexture)
	{
		CaptureDepthImage();
	}
	
	if (DepthMode != EKinectDepthMode::OFF && InflaredTexture)
	{
		CaptureInflaredImage();
	}

	if (bSkeletonTracking && BodyTracker)
	{
		UpdateSkeletons();
	}

	Capture.reset();

}

void UAzureKinectDevice::CaptureColorImage()
{
	int32 Width = 0, Height = 0;
	uint8* SourceBuffer;

	if (RemapMode == EKinectRemap::COLOR_TO_DEPTH)
	{
		k4a::image DepthCapture = Capture.get_depth_image();
		k4a::image ColorCapture = Capture.get_color_image();

		if (!DepthCapture.is_valid() || !ColorCapture.is_valid()) return;

		Width = DepthCapture.get_width_pixels();
		Height = DepthCapture.get_height_pixels();

		if (Width == 0 || Height == 0) return;

		//
		if (!RemapImage || !RemapImage.is_valid())
		{
			RemapImage = k4a::image::create(K4A_IMAGE_FORMAT_COLOR_BGRA32, Width, Height, Width * static_cast<int>(sizeof(uint8) * 4));
		}

		//try
		{
			KinectTransformation.color_image_to_depth_camera(DepthCapture, ColorCapture, &RemapImage);
		}
		//catch (const k4a::error& Err)
		//{
		//	FString Msg(ANSI_TO_TCHAR(Err.what()));
		//	UE_LOG(AzureKinectDeviceLog, Error, TEXT("Cant't transform Color to Depth: %s"), *Msg);
		//	return;
		//}

		SourceBuffer = RemapImage.get_buffer();

		DepthCapture.reset();
		ColorCapture.reset();
	}
	else
	{
		k4a::image ColorCapture = Capture.get_color_image();

		if (!ColorCapture.is_valid()) return;

		Width = ColorCapture.get_width_pixels();
		Height = ColorCapture.get_height_pixels();
		if (Width == 0 || Height == 0) return;
		
		SourceBuffer = ColorCapture.get_buffer();

		ColorCapture.reset();
	}

	if (ColorTexture->GetSurfaceWidth() != Width || ColorTexture->GetSurfaceHeight() != Height)
	{
		ColorTexture->InitCustomFormat(Width, Height, EPixelFormat::PF_B8G8R8A8, false);
		ColorTexture->RenderTargetFormat = ETextureRenderTargetFormat::RTF_RGBA8;
		ColorTexture->UpdateResource();
	}	
	else
	{

		FTextureResource* TextureResource = ColorTexture->Resource;
		auto Region = FUpdateTextureRegion2D(0, 0, 0, 0, Width, Height);

		ENQUEUE_RENDER_COMMAND(UpdateTextureData)(
			[TextureResource, Region, SourceBuffer](FRHICommandListImmediate& RHICmdList) {
				FTexture2DRHIRef Texture2D = TextureResource->TextureRHI ? TextureResource->TextureRHI->GetTexture2D() : nullptr;
				if (!Texture2D)
				{
					return;
				}
				RHIUpdateTexture2D(Texture2D, 0, Region, 4 * Region.Width, SourceBuffer);
			});
	}

}

void UAzureKinectDevice::CaptureDepthImage()
{
	int32 Width = 0, Height = 0;
	uint8* SourceBuffer;
	if (RemapMode == EKinectRemap::DEPTH_TO_COLOR)
	{
		k4a::image DepthCapture = Capture.get_depth_image();
		k4a::image ColorCapture = Capture.get_color_image();

		if (!DepthCapture.is_valid() || !ColorCapture.is_valid()) return;

		Width = ColorCapture.get_width_pixels();
		Height = ColorCapture.get_height_pixels();
		
		if (Width == 0 || Height == 0) return;

		//
		if (!RemapImage || !RemapImage.is_valid())
		{
			RemapImage = k4a::image::create(K4A_IMAGE_FORMAT_DEPTH16, Width, Height, Width * static_cast<int>(sizeof(uint16)));
		}

		//try
		{
			KinectTransformation.depth_image_to_color_camera(DepthCapture, &RemapImage);
		}
		/*catch (const k4a::error& Err)
		{
			FString Msg(ANSI_TO_TCHAR(Err.what()));
			UE_LOG(AzureKinectDeviceLog, Error, TEXT("Cant't transform Depth to Color: %s"), *Msg);
			return;
		}*/

		SourceBuffer = RemapImage.get_buffer();

		DepthCapture.reset();
		ColorCapture.reset();
	}
	else
	{
		k4a::image DepthCapture = Capture.get_depth_image();
		if (!DepthCapture.is_valid()) return;

		Width = DepthCapture.get_width_pixels();
		Height = DepthCapture.get_height_pixels();

		if (Width == 0 || Height == 0) return;

		SourceBuffer = DepthCapture.get_buffer();

		DepthCapture.reset();
	}

	if (DepthTexture->GetSurfaceWidth() != Width || DepthTexture->GetSurfaceHeight() != Height)
	{
		DepthTexture->InitCustomFormat(Width, Height, EPixelFormat::PF_R8G8B8A8, true);
		DepthTexture->RenderTargetFormat = ETextureRenderTargetFormat::RTF_RGBA8;
		DepthTexture->UpdateResource();
	}
	else
	{
		
		TArray<uint8> SrcData;
		SrcData.Reset(Width * Height * 4);
		for (int hi = 0; hi < Height; hi++)
		{
			for (int wi = 0; wi < Width; wi++)
			{
				int index = hi * Width + wi;
				uint16 R = SourceBuffer[index * 2];
				uint16 G = SourceBuffer[index * 2 + 1];
				
				uint16 Sample = G << 8 | R;

				SrcData.Push(SourceBuffer[index * 2]);
				SrcData.Push(SourceBuffer[index * 2 + 1]);
				SrcData.Push(Sample > 0 ? 0x00 : 0xFF);
				SrcData.Push(0xFF);
				
			}
		}
		
		FTextureResource* TextureResource = DepthTexture->Resource;
		auto Region = FUpdateTextureRegion2D(0, 0, 0, 0, Width, Height);

		ENQUEUE_RENDER_COMMAND(UpdateTextureData)(
			[TextureResource, Region, SrcData](FRHICommandListImmediate& RHICmdList) {
				FTexture2DRHIRef Texture2D = TextureResource->TextureRHI ? TextureResource->TextureRHI->GetTexture2D() : nullptr;
				if (!Texture2D)
				{
					return;
				}
				RHIUpdateTexture2D(Texture2D, 0, Region, 4 * Region.Width, SrcData.GetData());

			});
	}

}

void UAzureKinectDevice::CaptureInflaredImage()
{
	const k4a::image& InflaredCapture = Capture.get_ir_image();
	if (!InflaredCapture.is_valid()) return;

	int32 Width = InflaredCapture.get_width_pixels(), Height = InflaredCapture.get_height_pixels();
	if (Width == 0 || Height == 0) return;

	if (InflaredTexture->GetSurfaceWidth() != Width || InflaredTexture->GetSurfaceWidth() != Height)
	{
		InflaredTexture->InitCustomFormat(Width, Height, EPixelFormat::PF_R8G8B8A8, true);
		InflaredTexture->RenderTargetFormat = ETextureRenderTargetFormat::RTF_RGBA8;
		InflaredTexture->UpdateResource();
	}
	else
	{
		const uint8* S = InflaredCapture.get_buffer();
		TArray<uint8> SrcData;
		SrcData.Reset(Width * Height * 4);
		for (int hi = 0; hi < Height; hi++)
		{
			for (int wi = 0; wi < Width; wi++)
			{
				int index = hi * Width + wi;

				if (S[index * 2] + S[index * 2 + 1] > 0)
				{
					SrcData.Push(S[index * 2]);
					SrcData.Push(S[index * 2 + 1]);
					SrcData.Push(0x00);
					SrcData.Push(0xff);
				}
				else
				{
					SrcData.Push(0x00);
					SrcData.Push(0x00);
					SrcData.Push(0xff);
					SrcData.Push(0xff);
				}
			}
		}
		
		FTextureResource* TextureResource = InflaredTexture->Resource;
		auto Region = FUpdateTextureRegion2D(0, 0, 0, 0, Width, Height);

		ENQUEUE_RENDER_COMMAND(UpdateTextureData)(
			[TextureResource, Region, SrcData](FRHICommandListImmediate& RHICmdList) {
				FTexture2DRHIRef Texture2D = TextureResource->TextureRHI ? TextureResource->TextureRHI->GetTexture2D() : nullptr;
				if (!Texture2D)
				{
					return;
				}

				RHIUpdateTexture2D(Texture2D, 0, Region, 4 * Region.Width, SrcData.GetData());
			});
	}
	
}

void UAzureKinectDevice::CaptureBodyIndexImage(const k4abt::frame& BodyFrame)
{
	k4a::image BodyIndexMap = BodyFrame.get_body_index_map();

	int32 Width = BodyIndexMap.get_width_pixels(), Height = BodyIndexMap.get_height_pixels();
	if (Width == 0 || Height == 0) return;

	if (BodyIndexTexture->GetSurfaceWidth() != Width || BodyIndexTexture->GetSurfaceHeight() != Height)
	{
		BodyIndexTexture->InitCustomFormat(Width, Height, EPixelFormat::PF_R8G8B8A8, true);
		BodyIndexTexture->RenderTargetFormat = ETextureRenderTargetFormat::RTF_RGBA8;
		BodyIndexTexture->UpdateResource();
	}
	else
	{
		uint8* S = BodyIndexMap.get_buffer();
		TArray<uint8> SrcData;
		SrcData.Reset(Width * Height * 4);
		for (int i = 0; i < Width * Height; i++)
		{
			SrcData.Push(S[i]);
			SrcData.Push(S[i]);
			SrcData.Push(S[i]);
			SrcData.Push(0xff);
		}

		FTextureResource* TextureResource = BodyIndexTexture->Resource;
		auto Region = FUpdateTextureRegion2D(0, 0, 0, 0, Width, Height);

		ENQUEUE_RENDER_COMMAND(UpdateTextureData)(
			[TextureResource, Region, SrcData](FRHICommandListImmediate& RHICmdList) {
				FTexture2DRHIRef Texture2D = TextureResource->TextureRHI ? TextureResource->TextureRHI->GetTexture2D() : nullptr;
				if (!Texture2D)
				{
					return;
				}
				RHIUpdateTexture2D(Texture2D, 0, Region, 4 * Region.Width, SrcData.GetData());

			});
	}

}

void UAzureKinectDevice::UpdateSkeletons()
{
	
	k4abt::frame BodyFrame = nullptr;
	TArray<int32> BodyIDs;
		
	//try
	{
		if (!BodyTracker.enqueue_capture(Capture, FrameTime))
		{
			UE_LOG(AzureKinectDeviceLog, Warning, TEXT("Failed adding capture to tracker process queue"));
			return;
		}
			
		if (!BodyTracker.pop_result(&BodyFrame, FrameTime))
		{
			UE_LOG(AzureKinectDeviceLog, Warning, TEXT("Failed Tracker pop body frame"));
			return;
		}
	}
	/*catch (const k4a::error& Err)
	{
		FString Msg(ANSI_TO_TCHAR(Err.what()));
		UE_LOG(AzureKinectDeviceLog, Error, TEXT("Couldn't get Body Frame: %s"), *Msg);
	}*/

	if (BodyIndexTexture)
	{
		CaptureBodyIndexImage(BodyFrame);
	}

	{
		FScopeLock Lock(Thread->GetCriticalSection());

		NumTrackedSkeletons = BodyFrame.get_num_bodies();
		Skeletons.Reset(NumTrackedSkeletons);

		for (int32 i = 0; i < NumTrackedSkeletons; i++)
		{
			k4abt_body_t Body;
			FAzureKinectSkeleton Skeleton;

			BodyFrame.get_body_skeleton(i, Body.skeleton);
			Skeleton.ID = BodyFrame.get_body_id(i);

			Skeleton.Joints.Reset(K4ABT_JOINT_COUNT);

			for (int32 j = 0; j < K4ABT_JOINT_COUNT; j++)
			{
				Skeleton.Joints.Push(JointToTransform(Body.skeleton.joints[j], j));
			}

			Skeletons.Push(Skeleton);
		}
	}
	
		
	BodyFrame.reset();
	
}

FTransform UAzureKinectDevice::JointToTransform(const k4abt_joint_t& Joint, int32 Index)
{

	// This transform algorithm is introdeced from 
	// https://github.com/secretlocation/azure-kinect-unreal/
	// Still there is room to refactor...

	/**
	 * Convert Azure Kinect Depth and Color camera co-ordinate system
	 * to Unreal co-ordinate system
	 * @see https://docs.microsoft.com/en-us/azure/kinect-dk/coordinate-systems
	 *
	 * Kinect [mm]				Unreal [cm]
	 * --------------------------------------
	 * +ve X-axis		Right		+ve Y-axis
	 * +ve Y-axis		Down		-ve Z-axis
	 * +ve Z-axis		Forward		+ve X-axis
	*/
	FVector Position(Joint.position.xyz.z, Joint.position.xyz.x, - Joint.position.xyz.y);
	Position *= 0.1f;

	/**
	 * Convert the Orientation from Kinect co-ordinate system to Unreal co-ordinate system.
	 * We negate the x, y components of the JointQuaternion since we are converting from
	 * Kinect's Right Hand orientation to Unreal's Left Hand orientation.
	 */
	FQuat Quat(
		-Joint.orientation.wxyz.x,
		-Joint.orientation.wxyz.y,
		Joint.orientation.wxyz.z,
		Joint.orientation.wxyz.w
	);
	
	return FTransform(Quat, Position);
}

void UAzureKinectDevice::CalcFrameCount()
{
	float FrameTimeInMilli = 0.0f;
	switch (Fps)
	{
	case EKinectFps::PER_SECOND_5:
		FrameTimeInMilli = 1000.f / 5.f;
		break;
	case EKinectFps::PER_SECOND_15:
		FrameTimeInMilli = 1000.f / 15.f;
		break;
	case EKinectFps::PER_SECOND_30:
		FrameTimeInMilli = 1000.f / 30.f;
		break;
	default:
		break;
	}
	FrameTime = std::chrono::milliseconds(FMath::CeilToInt(FrameTimeInMilli));
}

@nama-gatsuo nama-gatsuo added the bug Something isn't working label Jan 19, 2022
@nama-gatsuo
Copy link
Owner

I'll give a try to fix this issue anyway...

@YongsunLee
Copy link
Author

YongsunLee commented Jan 20, 2022

Thanks for the quick reply.

I tried the workaround you suggested, but the packaging doesn't work.
Thank you for your efforts to solve it.

I'm leaving a log of my packaging error in case it might be of any help.

Details

UATHelper: 패키징 (Windows (64-bit)): ********** BUILD COMMAND COMPLETED ********** UATHelper: 패키징 (Windows (64-bit)): ********** COOK COMMAND STARTED ********** UATHelper: 패키징 (Windows (64-bit)): Cleaning cooked data. UATHelper: 패키징 (Windows (64-bit)): Running UE4Editor Cook for project C:\Users\user\Desktop\Builds\Builds.uproject UATHelper: 패키징 (Windows (64-bit)): Commandlet log file is C:\Program Files\Epic Games\UE_4.26_Server\Engine\Programs\AutomationTool\Saved\Cook-2022.01.20-14.26.03.txt UATHelper: 패키징 (Windows (64-bit)): Running: C:\Program Files\Epic Games\UE_4.26_Server\Engine\Binaries\Win64\UE4Editor-Cmd.exe C:\Users\user\Desktop\Builds\Builds.uproject -run=Cook -TargetPlatform=WindowsNoEditor -fileopenlog -ddc=DerivedDataBackendGraph -unversioned -abslog="C:\Program Files\Epic Games\UE_4.26_Server\Engine\Programs\AutomationTool\Saved\C ook-2022.01.20-14.26.03.txt" -stdout -CrashForUAT -unattended -NoLogTimes -UTF8Output UATHelper: 패키징 (Windows (64-bit)): LogInit: Display: Running engine for game: Builds UATHelper: 패키징 (Windows (64-bit)): LogHAL: Display: Platform has ~ 32 GB [34280935424 / 34359738368 / 32], which maps to Largest [LargestMinGB=32, LargerMinGB=12, DefaultMinGB=8, SmallerMinGB=6, SmallestMinGB=0) UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'AllDesktop' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'Android' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'Android_ASTC' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'Android_DXT' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'Android_ETC2' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'AndroidClient' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'Android_ASTCClient' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'Android_DXTClient' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'Android_ETC2Client' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'Android_Multi' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'Android_MultiClient' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'IOSClient' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'IOS' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'Lumin' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'LuminClient' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'MacNoEditor' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'Mac' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'MacClient' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'MacServer' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'TVOSClient' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'TVOS' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'WindowsNoEditor' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'Windows' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'WindowsClient' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Loaded TargetPlatform 'WindowsServer' UATHelper: 패키징 (Windows (64-bit)): LogTargetPlatformManager: Display: Building Assets For WindowsNoEditor UATHelper: 패키징 (Windows (64-bit)): LogAudioDebug: Display: Lib vorbis DLL was dynamically loaded. UATHelper: 패키징 (Windows (64-bit)): LogShaderCompilers: Display: Using Local Shader Compiler. UATHelper: 패키징 (Windows (64-bit)): LogDerivedDataCache: Display: Max Cache Size: 512 MB UATHelper: 패키징 (Windows (64-bit)): LogDerivedDataCache: Display: Loaded Boot cache: ../../../../../../Users/user/Desktop/Builds/DerivedDataCache/Boot.ddc UATHelper: 패키징 (Windows (64-bit)): LogDerivedDataCache: Display: Performance to ../../../Engine/DerivedDataCache: Latency=0.02ms. RandomReadSpeed=557.97MBs, RandomWriteSpeed=196.83MBs. Assigned SpeedClass 'Local' UATHelper: 패키징 (Windows (64-bit)): LogAudioCaptureCore: Display: No Audio Capture implementations found. Audio input will be silent. UATHelper: 패키징 (Windows (64-bit)): LogAudioCaptureCore: Display: No Audio Capture implementations found. Audio input will be silent. UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: begin: stack for UAT UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: === Critical error: === UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: Fatal error: [File:C:/Program Files/Epic Games/UE_4.26_Server/Engine/Source/Runtime/Launch/Private/Windows/LaunchWindows.cpp] [Line: 95] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: SECURE CRT: Invalid parameter detected. UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: Expression: Unknown Function: Unknown. File: Unknown Line: 0 UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffc69ae4f69 KERNELBASE.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbfc6b9ba6 UE4Editor-Core.dll!ReportAssert() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Core\Private\Windows\WindowsPlatformCrashContext.cpp:1616] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbfc6bd529 UE4Editor-Core.dll!FWindowsErrorOutputDevice::Serialize() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Core\Private\Windows\WindowsErrorOutputDevice.cpp:78] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbfc3d39f0 UE4Editor-Core.dll!FOutputDevice::LogfImpl() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Core\Private\Misc\OutputDevice.cpp:61] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffc69f42438 ucrtbase.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffc69f42379 ucrtbase.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffc69f750be ucrtbase.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffc69f3a4c3 ucrtbase.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffc69f3b216 ucrtbase.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffc69f3b347 ucrtbase.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffc69f3b3e4 ucrtbase.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbb9a0a3cd k4a.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbb9a32874 k4a.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffc4f891030 VCRUNTIME140.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffc4f894628 VCRUNTIME140.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffc6c351456 ntdll.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbb9a09c52 k4a.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbb9a2e256 k4a.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffc6c2f38b0 ntdll.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffc69b0a65b KERNELBASE.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbb9a09aa7 k4a.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbb9a0a0f9 k4a.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbb99d2d94 k4a.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbb9511633 UE4Editor-AzureKinect.dll!UAzureKinectDevice::LoadDevices() [C:\Users\user\Desktop\Builds\Plugins\AzureKinectForUE\Source\AzureKinect\Private\AzureKinectDevice.cpp:43] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbb9504412 UE4Editor-AzureKinect.dll!UAzureKinectDevice::UAzureKinectDevice() [C:\Users\user\Desktop\Builds\Plugins\AzureKinectForUE\Source\AzureKinect\Private\AzureKinectDevice.cpp:25] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbfbacd313 UE4Editor-CoreUObject.dll!UClass::CreateDefaultObject() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:3707] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbfbd9028e UE4Editor-CoreUObject.dll!UObjectLoadAllCompiledInDefaultProperties() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectBase.cpp:908] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbfbd731df UE4Editor-CoreUObject.dll!ProcessNewlyLoadedUObjects() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectBase.cpp:997] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbfbca3705 UE4Editor-CoreUObject.dll!TBaseStaticDelegateInstance<void __cdecl(FName,bool),FDefaultDelegateUserPolicy>::ExecuteIfSafe() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:731] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbfc40e179 UE4Editor-Core.dll!TMulticastDelegate<void __cdecl(FName,bool),FDefaultDelegateUserPolicy>::Broadcast() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Core\Public\Delegates\DelegateSignatureImpl.inl:955] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbfc42f8d9 UE4Editor-Core.dll!FModuleManager::LoadModuleWithFailureReason() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Core\Private\Modules\ModuleManager.cpp:519] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbfb86e5fe UE4Editor-Projects.dll!FModuleDescriptor::LoadModulesForPhase() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Projects\Private\ModuleDescriptor.cpp:561] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbfb88318a UE4Editor-Projects.dll!FPluginManager::TryLoadModulesForPlugin() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Projects\Private\PluginManager.cpp:1295] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffbfb86e3f0 UE4Editor-Projects.dll!FPluginManager::LoadModulesForEnabledPlugins() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Projects\Private\PluginManager.cpp:1369] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ff63915538b UE4Editor-Cmd.exe!FEngineLoop::LoadStartupModules() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:3815] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ff639158866 UE4Editor-Cmd.exe!FEngineLoop::PreInitPostStartupScreen() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:3198] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ff639150e9d UE4Editor-Cmd.exe!GuardedMain() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Launch\Private\Launch.cpp:127] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ff6391511fa UE4Editor-Cmd.exe!GuardedMainWrapper() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:137] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ff639165051 UE4Editor-Cmd.exe!WinMain() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:268] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ff639167102 UE4Editor-Cmd.exe!__scrt_common_main_seh() [d:\a01\_work\20\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffc6b467034 KERNEL32.DLL!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: [Callstack] 0x00007ffc6c302651 ntdll.dll!UnknownFunction [] UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: UATHelper: 패키징 (Windows (64-bit)): LogWindows: Error: end: stack for UAT PackagingResults: Error: begin: stack for UAT PackagingResults: Error: === Critical error: === PackagingResults: Error: Fatal error: [File:C:/Program Files/Epic Games/UE_4.26_Server/Engine/Source/Runtime/Launch/Private/Windows/LaunchWindows.cpp] [Line: 95] PackagingResults: Error: SECURE CRT: Invalid parameter detected. PackagingResults: Error: Expression: Unknown Function: Unknown. File: Unknown Line: 0 PackagingResults: Error: [Callstack] 0x00007ffc69ae4f69 KERNELBASE.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffbfc6b9ba6 UE4Editor-Core.dll!ReportAssert() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Core\Private\Windows\WindowsPlatformCrashContext.cpp:1616] PackagingResults: Error: [Callstack] 0x00007ffbfc6bd529 UE4Editor-Core.dll!FWindowsErrorOutputDevice::Serialize() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Core\Private\Windows\WindowsErrorOutputDevice.cpp:78] PackagingResults: Error: [Callstack] 0x00007ffbfc3d39f0 UE4Editor-Core.dll!FOutputDevice::LogfImpl() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Core\Private\Misc\OutputDevice.cpp:61] PackagingResults: Error: [Callstack] 0x00007ffc69f42438 ucrtbase.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffc69f42379 ucrtbase.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffc69f750be ucrtbase.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffc69f3a4c3 ucrtbase.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffc69f3b216 ucrtbase.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffc69f3b347 ucrtbase.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffc69f3b3e4 ucrtbase.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffbb9a0a3cd k4a.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffbb9a32874 k4a.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffc4f891030 VCRUNTIME140.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffc4f894628 VCRUNTIME140.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffc6c351456 ntdll.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffbb9a09c52 k4a.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffbb9a2e256 k4a.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffc6c2f38b0 ntdll.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffc69b0a65b KERNELBASE.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffbb9a09aa7 k4a.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffbb9a0a0f9 k4a.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffbb99d2d94 k4a.dll!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffbb9511633 UE4Editor-AzureKinect.dll!UAzureKinectDevice::LoadDevices() [C:\Users\user\Desktop\Builds\Plugins\AzureKinectForUE\Source\AzureKinect\Private\AzureKinectDevice.cpp:43] PackagingResults: Error: [Callstack] 0x00007ffbb9504412 UE4Editor-AzureKinect.dll!UAzureKinectDevice::UAzureKinectDevice() [C:\Users\user\Desktop\Builds\Plugins\AzureKinectForUE\Source\AzureKinect\Private\AzureKinectDevice.cpp:25] PackagingResults: Error: [Callstack] 0x00007ffbfbacd313 UE4Editor-CoreUObject.dll!UClass::CreateDefaultObject() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:3707] PackagingResults: Error: [Callstack] 0x00007ffbfbd9028e UE4Editor-CoreUObject.dll!UObjectLoadAllCompiledInDefaultProperties() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectBase.cpp:908] PackagingResults: Error: [Callstack] 0x00007ffbfbd731df UE4Editor-CoreUObject.dll!ProcessNewlyLoadedUObjects() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectBase.cpp:997] PackagingResults: Error: [Callstack] 0x00007ffbfbca3705 UE4Editor-CoreUObject.dll!TBaseStaticDelegateInstance<void __cdecl(FName,bool),FDefaultDelegateUserPolicy>::ExecuteIfSafe() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:731] PackagingResults: Error: [Callstack] 0x00007ffbfc40e179 UE4Editor-Core.dll!TMulticastDelegate<void __cdecl(FName,bool),FDefaultDelegateUserPolicy>::Broadcast() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Core\Public\Delegates\DelegateSignatureImpl.inl:955] PackagingResults: Error: [Callstack] 0x00007ffbfc42f8d9 UE4Editor-Core.dll!FModuleManager::LoadModuleWithFailureReason() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Core\Private\Modules\ModuleManager.cpp:519] PackagingResults: Error: [Callstack] 0x00007ffbfb86e5fe UE4Editor-Projects.dll!FModuleDescriptor::LoadModulesForPhase() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Projects\Private\ModuleDescriptor.cpp:561] PackagingResults: Error: [Callstack] 0x00007ffbfb88318a UE4Editor-Projects.dll!FPluginManager::TryLoadModulesForPlugin() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Projects\Private\PluginManager.cpp:1295] PackagingResults: Error: [Callstack] 0x00007ffbfb86e3f0 UE4Editor-Projects.dll!FPluginManager::LoadModulesForEnabledPlugins() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Projects\Private\PluginManager.cpp:1369] PackagingResults: Error: [Callstack] 0x00007ff63915538b UE4Editor-Cmd.exe!FEngineLoop::LoadStartupModules() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:3815] PackagingResults: Error: [Callstack] 0x00007ff639158866 UE4Editor-Cmd.exe!FEngineLoop::PreInitPostStartupScreen() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:3198] PackagingResults: Error: [Callstack] 0x00007ff639150e9d UE4Editor-Cmd.exe!GuardedMain() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Launch\Private\Launch.cpp:127] PackagingResults: Error: [Callstack] 0x00007ff6391511fa UE4Editor-Cmd.exe!GuardedMainWrapper() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:137] PackagingResults: Error: [Callstack] 0x00007ff639165051 UE4Editor-Cmd.exe!WinMain() [C:\Program Files\Epic Games\UE_4.26_Server\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:268] PackagingResults: Error: [Callstack] 0x00007ff639167102 UE4Editor-Cmd.exe!__scrt_common_main_seh() [d:\a01\_work\20\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288] PackagingResults: Error: [Callstack] 0x00007ffc6b467034 KERNEL32.DLL!UnknownFunction [] PackagingResults: Error: [Callstack] 0x00007ffc6c302651 ntdll.dll!UnknownFunction [] PackagingResults: Error: end: stack for UAT UATHelper: 패키징 (Windows (64-bit)): Took 16.8562186s to run UE4Editor-Cmd.exe, ExitCode=3 UATHelper: 패키징 (Windows (64-bit)): ERROR: Cook failed. UATHelper: 패키징 (Windows (64-bit)): (see C:\Program Files\Epic Games\UE_4.26_Server\Engine\Programs\AutomationTool\Saved\Logs\Log.txt for full exception trace) PackagingResults: Error: Cook failed. UATHelper: 패키징 (Windows (64-bit)): AutomationTool exiting with ExitCode=25 (Error_UnknownCookFailure) UATHelper: 패키징 (Windows (64-bit)): BUILD FAILED PackagingResults: Error: Unknown Cook Failure

My packaging environment is

  • UE4 4.26.2
  • Skeleton ABP
  • AzureKinectDevice

and in the case of Niagara, I did not migrate because it seems impossible to reproduce the same in version 4.26.2.

Should I worry about whether this packaging error is also caused by version differences?

PS The version is different, but in the editor it plays without problems

Add.

I pressed "Close Issue" incorrectly.
Attached is the Cook log.

Cook-2022.01.20-15.39.46.txt
.

@YongsunLee
Copy link
Author

Hi, @nama-gatsuo

The build was successful by improving your temporary work a little more.

Here's the method I used:

  1. dlls & libs from Azure Kinect SDK should be located inside of project directory such like
  • .\Plugins\AzureKinect\Binaries\Win64.
  1. Included the include folder (Azure Kinect SDK & Body Tracking SDK).
  • .\Plugins\AzureKinect\Source\ThirdParty\Azure Kinect Body Tracking SDK\include
  • .\Plugins\AzureKinect\Source\ThirdParty\Azure Kinect SDK v1.4.1\include
  1. And I modified PublicIncludePaths in AzureKinect.Build.cs file.
  • "C:\PJRoot\Plugins\AzureKinect\Source\ThirdParty\Azure Kinect SDK v1.4.1\include"
  • "C:\PJRoot\Plugins\AzureKinect\Source\ThirdParty\Azure Kinect Body Tracking SDK\include\include"
  1. Delete the Try-Catch statement

  2. Packaging after launching UE4 Editor through Visual Studio

Packaging was successful by following the above method.

@MarisFreimanis
Copy link

MarisFreimanis commented Feb 7, 2022

@YongsunLee do you mind sharing your AzureKinect.Build.cs code, with changes you made?

@YongsunLee
Copy link
Author

YongsunLee commented Feb 15, 2022

Hi, @Freymox

My AzureKinect.Build.cs

Details

// Copyright Epic Games, Inc. All Rights Reserved.
using System.IO;
using UnrealBuildTool;

public class AzureKinect : ModuleRules
{
public AzureKinect(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
bEnableExceptions = true;

	if (Target.Platform == UnrealTargetPlatform.Win64)
	{
		PublicIncludePaths.AddRange(
			new string[] {
				@"D:\Build\WinterSceneProject\Plugins\AzureKinectForUE\Source\ThirdParty\Azure Kinect SDK v1.4.1\include",
				@"D:\Build\WinterSceneProject\Plugins\AzureKinectForUE\Source\ThirdParty\Azure Kinect Body Tracking SDK\include",
			});

		PublicAdditionalLibraries.AddRange(
			new string[] {
				@"D:\Build\WinterSceneProject\Plugins\AzureKinectForUE\Binaries\Win64\k4a.lib",
				@"D:\Build\WinterSceneProject\Plugins\AzureKinectForUE\Binaries\Win64\k4abt.lib",
			});

		string k4aDllPath = @"D:\Build\WinterSceneProject\Plugins\AzureKinectForUE\Binaries\Win64\k4a.dll";
		string k4abtDllPath = @"D:\Build\WinterSceneProject\Plugins\AzureKinectForUE\Binaries\Win64\k4abt.dll";
		string depthEngineDllPath = @"D:\Build\WinterSceneProject\Plugins\AzureKinectForUE\Binaries\Win64\depthengine_2_0.dll";
		string directMLDllPath = @"D:\Build\WinterSceneProject\Plugins\AzureKinectForUE\Binaries\Win64\directml.dll";

		PublicDelayLoadDLLs.AddRange(
			new string[] {
				depthEngineDllPath,
				k4aDllPath,
				k4abtDllPath,
				directMLDllPath,
			});

		RuntimeDependencies.Add(depthEngineDllPath);
		RuntimeDependencies.Add(k4aDllPath);
		RuntimeDependencies.Add(k4abtDllPath);
		RuntimeDependencies.Add(directMLDllPath);
	}


	PrivateIncludePaths.AddRange(
		new string[]
		{
				"AzureKinect/Private",
		});

	PrivateDependencyModuleNames.AddRange(
		new string[]
		{
			"Core",
			"CoreUObject",
			"Engine",
			"RenderCore",
			"RHI",
			"AnimGraphRuntime",
		});

}

}

I Copy my Azure Kinect.build.cs .

You can think of my project location (D:\Build\WinterSceneProject) as your project location.

And after packaging, copy the AzureKinect (including Body Tracking SDK) dll file to win64 of the packaging folder and put it back.

I don't know if this is the right way, so please change it when the developer suggests a better solution.

@LucyZhao1229
Copy link

LucyZhao1229 commented Mar 30, 2022

Hi, @YongsunLee
I have a erro when open my project: “the following modules are missing or built with a different engine version:AzureKinect AzureKinectEditor”, Do you have any idea to solve it?
I installed Azure Kinect Body Tracking SDK 1.1.0, Azure Kinect SDK v1.4.1,
UE4.27.2

@fhqht12331
Copy link

The first time you package with the plug-in and open the game, it works, and from the second time you open it, the next log occurs with fat error. Does anyone have a solution?

[2023.11.21-13.38.29:306][ 0]AzureKinectDeviceLog: Warning: Failed adding capture to tracker process queue
[2023.11.21-13.38.29:306][ 0]AzureKinectDeviceLog: Warning: Failed adding capture to tracker process queue
[2023.11.21-13.38.29:306][ 0]LogRHI: Display: Encountered a new compute PSO: 1992897872
[2023.11.21-13.38.29:306][ 0]AzureKinectDeviceLog: Warning: Failed adding capture to tracker process queue
[2023.11.21-13.38.29:306][ 0]LogRHI: Error: Breadcrumbs 'RHIThread'

[2023.11.21-13.38.29:306][ 0]LogWindows: Could not start crash report client using ../../../Engine/Binaries/Win64/CrashReportClient-Win64-Debug.exe
[2023.11.21-13.38.29:306][ 0]LogMemory: Platform Memory Stats for Windows
[2023.11.21-13.38.29:306][ 0]LogMemory: Process Physical Memory: 1820.04 MB used, 1820.04 MB peak
[2023.11.21-13.38.29:306][ 0]LogMemory: Process Virtual Memory: 4536.45 MB used, 4536.49 MB peak
[2023.11.21-13.38.29:306][ 0]LogMemory: Physical Memory: 17656.90 MB used, 47609.94 MB free, 65266.84 MB total
[2023.11.21-13.38.29:306][ 0]LogMemory: Virtual Memory: 25281.36 MB used, 44081.48 MB free, 69362.84 MB total
[2023.11.21-13.38.29:306][ 0]AzureKinectDeviceLog: Warning: Failed adding capture to tracker process queue
[2023.11.21-13.38.29:306][ 0]Message dialog closed, result: Ok, title: The UE-Kinect_Package_4 Game has crashed and will close, text:
[2023.11.21-13.38.29:306][ 0]LogWindows: Error: === Critical error: ===
[2023.11.21-13.38.29:306][ 0]LogWindows: Error:
[2023.11.21-13.38.29:306][ 0]LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffff00000105
[2023.11.21-13.38.29:306][ 0]LogWindows: Error:
[2023.11.21-13.38.29:306][ 0]LogWindows: Error: [Callstack] 0x00007ff7d4600fed Kinect_Package_4.exe!<lambda_8c0c43cbb6ffd445e3874522569a9c1c>::operator()() [E:\UE\Kinect_Package_4\Plugins\Kinect-Body-Tracking-Unreal-Engine-Plugin\Source\AzureKinect\Private\AzureKinectDevice.cpp:583]
[2023.11.21-13.38.29:306][ 0]LogWindows: Error: [Callstack] 0x00007ff7d46061e0 Kinect_Package_4.exe!TEnqueueUniqueRenderCommandType<UAzureKinectDevice::CaptureBodyIndexImage'::9'::UpdateTextureDataName,<lambda_8c0c43cbb6ffd445e3874522569a9c1c> >::DoTask() [E:\UE_5.2\Engine\Source\Runtime\RenderCore\Public\RenderingThread.h:209]
[2023.11.21-13.38.29:306][ 0]LogWindows: Error: [Callstack] 0x00007ff7d4606a2b Kinect_Package_4.exe!TGraphTask<TEnqueueUniqueRenderCommandType<UAzureKinectDevice::CaptureBodyIndexImage'::9'::UpdateTextureDataName,<lambda_8c0c43cbb6ffd445e3874522569a9c1c> > >::ExecuteTask() [E:\UE_5.2\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:1310]
[2023.11.21-13.38.29:306][ 0]LogWindows: Error: [Callstack] 0x00007ff7d5fe4367 Kinect_Package_4.exe!FNamedTaskThread::ProcessTasksNamedThread() []
[2023.11.21-13.38.29:306][ 0]LogWindows: Error: [Callstack] 0x00007ff7d5fe487e Kinect_Package_4.exe!FNamedTaskThread::ProcessTasksUntilQuit() []
[2023.11.21-13.38.29:306][ 0]LogWindows: Error: [Callstack] 0x00007ff7d98a7e6a Kinect_Package_4.exe!RenderingThreadMain() []
[2023.11.21-13.38.29:306][ 0]LogWindows: Error: [Callstack] 0x00007ff7d98ad169 Kinect_Package_4.exe!FRenderingThread::Run() []
[2023.11.21-13.38.29:306][ 0]LogWindows: Error: [Callstack] 0x00007ff7d662c392 Kinect_Package_4.exe!FRunnableThreadWin::Run() []
[2023.11.21-13.38.29:306][ 0]LogWindows: Error: [Callstack] 0x00007ff7d6622460 Kinect_Package_4.exe!FRunnableThreadWin::GuardedRun() []
[2023.11.21-13.38.29:306][ 0]LogWindows: Error: [Callstack] 0x00007ffa24cb7344 KERNEL32.DLL!UnknownFunction []
[2023.11.21-13.38.29:306][ 0]LogWindows: Error: [Callstack] 0x00007ffa258226b1 ntdll.dll!UnknownFunction []
[2023.11.21-13.38.29:306][ 0]LogWindows: Error:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants