sideeffects / HoudiniEngineForUnreal-v2

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

GetGeoInfo() collision on some Unity builds with Windows #147

Open Ryan-DowlingSoka opened 2 years ago

Ryan-DowlingSoka commented 2 years ago

Windows implements its own GetGeoInfo() function that on PLATFORM_WINDOWS and depending on your unity build settings can cause a collision in a bunch of the Houdini Engine files.

In Houdini Engine Utils.cpp you've worked around this with:

`#if PLATFORM_WINDOWS

include "Windows/WindowsHWrapper.h"

// Of course, Windows defines its own GetGeoInfo,
// So we need to undefine that before including HoudiniApi.h to avoid collision...
#ifdef GetGeoInfo
    #undef GetGeoInfo
#endif

endif`

This has to be fixed in a few more places unfortunately:

HoudiniOutputTranslator.cpp needs that same fix at the top. HoudiniLandscapeTranslator.cpp as well.

Obviously it feels pretty gross to do it this way. It would likely be better to avoid the collision in some other way, but considering this is a HAPI thing, perhaps the solution is a rename only in UE code from GetGeoInfo to like GetHGeoInfo?