In 5.0,I changed the code like this,
UFoliageType* FoliageType = InstancedFoliageActor->GetLocalFoliageTypeForSource(BakedStaticMesh);
//support much foliagetype use one staticmesh
UFoliageType_InstancedStaticMesh* FoliageSMC = Cast<UFoliageType_InstancedStaticMesh>(InOutputObject.OutputObject);
if (IsValid(FoliageSMC))
{
FoliageType = Cast<UFoliageType>(FoliageSMC);
}
then,in this way,it can support one staticmesh,but many FoliageType,This is for One foliage,many Material.
but now,the data change to Map,Can't support one staticmesh many Foliage Type,and hard to custom by myself
Hope this problem can be solved.
UFoliageType * FoliageType = nullptr;
if (FoliageMap.Contains(BakedStaticMesh))
{
// Re-use FoliageType already created/ used on this export.
FoliageType = FoliageMap[BakedStaticMesh];
}
else
{
FHoudiniPackageParams Params = InstancerPackageParams;
Params.ObjectName.Empty();
// We need to create a new FoliageType for this Static Mesh
// TODO: Add foliage default settings
FoliageType = FHoudiniFoliageTools::CreateFoliageType(Params, InOutputIndex, BakedStaticMesh);
FoliageMap.Add(BakedStaticMesh, FoliageType);
In 5.0,I changed the code like this, UFoliageType* FoliageType = InstancedFoliageActor->GetLocalFoliageTypeForSource(BakedStaticMesh);
then,in this way,it can support one staticmesh,but many FoliageType,This is for One foliage,many Material.
but now,the data change to Map,Can't support one staticmesh many Foliage Type,and hard to custom by myself Hope this problem can be solved. UFoliageType * FoliageType = nullptr; if (FoliageMap.Contains(BakedStaticMesh)) { // Re-use FoliageType already created/ used on this export. FoliageType = FoliageMap[BakedStaticMesh]; } else { FHoudiniPackageParams Params = InstancerPackageParams; Params.ObjectName.Empty();