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

Foliage Type can't support many foliagetypes use one staticmesh #276

Open
cgTD123 opened this issue Nov 24, 2023 · 0 comments
Open

Foliage Type can't support many foliagetypes use one staticmesh #276

cgTD123 opened this issue Nov 24, 2023 · 0 comments

Comments

@cgTD123
Copy link

cgTD123 commented Nov 24, 2023

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant