sideeffects / HoudiniEngineForUnreal-v2

Houdini Engine Plugin for Unreal Engine 4 - Version 2
http://www.sidefx.com/unreal
Other
294 stars 75 forks source link

Cannot build plugin on UE 4.26.1 #135

Closed jholland-work closed 3 years ago

jholland-work commented 3 years ago

Ubuntu 20.04 Houdini Ver: 18.5.540 HoudinEngine Branch: 18.5-4.26

When building the plugin, getting the following error: In file included from /mnt/UnrealEngine/Engine/Plugins/Runtime/HoudiniEngine/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HoudiniEngine/Module.HoudiniEngine.1_of_5.cpp:12: /mnt/UnrealEngine/Engine/Plugins/Runtime/HoudiniEngine/Source/HoudiniEngine/Private/HoudiniEngineUtils.cpp:4632:5: error: cannot initialize a parameter of type 'const HAPI_Int64 *' (aka 'const long *') with an rvalue of type 'const TArray<long long, TSizedDefaultAllocator<32> >::ElementType *' (aka 'const long long *') InPropertyAttribute.IntValues.GetData(), 0, AttributeInfo.count))

VicSch commented 3 years ago

Hi, have you found a solution? I have the same error.

jholland-work commented 3 years ago

I've been in touch with the devs, they're working in it.

Cheers, John

On Mon, May 10, 2021 at 2:12 AM Victor @.***> wrote:

Hi, have you found a solution? I have the same error.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sideeffects/HoudiniEngineForUnreal-v2/issues/135#issuecomment-836443206, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR6IIZ3LFUXY4GRD6DL7GADTM6PONANCNFSM44HUAR4A .

dpernuit commented 3 years ago

Hi,

The issue on Linux is caused by the fact that we can't guarantee that HAPI_Int64 and int64 are of the same type. I'll try to push an update to the plugin code soon with the fix, meanwhile, replacing the code in HoudiniEngineUtils.cpp that has the issue with the following should fix the issue.

(in FHoudiniEngineUtils::SetGenericPropertyAttribute() ~ln4630)

        case EAttribStorageType::INT64:
        {
#if PLATFORM_LINUX
            // On Linux, we unfortunately cannot guarantee that int64 and HAPI_Int64 are of the same type,
            TArray<HAPI_Int64> HAPIIntValues;
            HAPIIntValues.SetNumZeroed(InPropertyAttribute.IntValues.Num());
            for (int32 n = 0; n < HAPIIntValues.Num(); n++)
                HAPIIntValues[n] = (HAPI_Int64)InPropertyAttribute.IntValues[n];

            if (HAPI_RESULT_SUCCESS != FHoudiniApi::SetAttributeInt64Data(
                FHoudiniEngine::Get().GetSession(),
                InGeoNodeId, InPartId, TCHAR_TO_ANSI(*InPropertyAttribute.AttributeName), &AttributeInfo,
                HAPIIntValues.GetData(), 0, AttributeInfo.count))
            {
                HOUDINI_LOG_WARNING(TEXT("Could not set attribute %s"), *InPropertyAttribute.AttributeName);
            }
#else
            if (HAPI_RESULT_SUCCESS != FHoudiniApi::SetAttributeInt64Data(
                FHoudiniEngine::Get().GetSession(),
                InGeoNodeId, InPartId, TCHAR_TO_ANSI(*InPropertyAttribute.AttributeName), &AttributeInfo,
                InPropertyAttribute.IntValues.GetData(), 0, AttributeInfo.count))
            {
                HOUDINI_LOG_WARNING(TEXT("Could not set attribute %s"), *InPropertyAttribute.AttributeName);
            }           
#endif
            break;
        }