Attributes of [unreal_lightmap_resolution] don't behave correctly.

   1399   0   0
User Avatar
Member
1 posts
Joined: Oct. 2015
Offline
I'd like to set the lightmap resolution for each component using the attribute.
However, it seems that is currently not working properly.
I tried a little investigation.


    // Assign generation parameters for this static mesh.
    HoudiniCookParams.HoudiniCookManager->SetStaticMeshGenerationParameters( StaticMesh );


    // Set resolution of lightmap.
    StaticMesh->LightMapResolution = GeneratedLightMapResolution;

It seems that of is overwritten with that of here.
so,I commented out here.
Then it became the behavior that I wanted.

Next, I also wanted to get the same behavior on .
For that, I did the following.

// We need to check light map uv set for correctness. Unreal seems to have occasional issues with
// zero UV sets when building lightmaps.
int32 LightMapResolutionOverride = -1;
if (SrcModel->BuildSettings.bGenerateLightmapUVs)
{
// See if we need to disable lightmap generation because of bad UVs.
if (FHoudiniEngineUtils::ContainsInvalidLightmapFaces(RawMesh, StaticMesh->LightMapCoordinateIndex))
{
SrcModel->BuildSettings.bGenerateLightmapUVs = false;
HOUDINI_LOG_MESSAGE(
TEXT("Skipping Lightmap Generation: Object , Geo , Part invalid face detected “)
TEXT(”- skipping."),
ObjectInfo.nodeId, *ObjectName, GeoInfo.nodeId, PartIdx, *PartName);
}
}
if( PartLightMapResolutions.Num() > 0 )
LightMapResolutionOverride = PartLightMapResolutions;

// Apply lightmap resolution override if it has been specified
if ( LightMapResolutionOverride > 0 )
StaticMesh->LightMapResolution = LightMapResolutionOverride;


I made sure to overwrite of .
However, since I don't have high programming skills, I don't know if these fixes are correct.
If you can, I'd like to know the correct way to fix it.
  • Quick Links