Skip to content

Commit

Permalink
Zone shape input optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
ChildAdrian committed Dec 11, 2024
1 parent 66e44bc commit 5559736
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ This plug-in is reply on **my custom** [HoudiniEngineForUnreal](https://github.c

03. Open `/HoudiniMassTranslator/Example/HoudiniTrafficDemo` in the content of this plug-in, and simulate.

Also see what can be achieved by Only using your HDAs and these two unreal plugins: [City toolchains](https://youtu.be/5Vp5nAFq1X8?si=IGSDG4cUdsefwn5x)

# Usage Brief

Support both input and output of mass ai zone shapes
Expand Down
12 changes: 5 additions & 7 deletions Source/HoudiniMassTranslator/Private/HoudiniInputZoneShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,12 @@ bool FHoudiniZoneShapeComponentInputBuilder::HapiUpload(UHoudiniInput* Input, co
}

int32& NodeId = ZSCInput->NodeId;
if (NodeId < 0)
{
const bool bCreateNewNode = (NodeId < 0);
if (bCreateNewNode)
HAPI_SESSION_FAIL_RETURN(FHoudiniApi::CreateNode(FHoudiniEngine::Get().GetSession(), Input->GetGeoNodeId(), "null",
TCHAR_TO_UTF8(*FString::Printf(TEXT("%s_zone_shape_%08X"), *(Components[ComponentIndices[0]]->GetOuter()->GetName()), FPlatformTime::Cycles())),
false, &NodeId));

HOUDINI_FAIL_RETURN(Input->HapiConnectToMergeNode(NodeId));
}

HAPI_PartInfo PartInfo;
FHoudiniApi::PartInfo_Init(&PartInfo);
PartInfo.type = HAPI_PARTTYPE_CURVE;
Expand Down Expand Up @@ -289,9 +286,10 @@ bool FHoudiniZoneShapeComponentInputBuilder::HapiUpload(UHoudiniInput* Input, co
if (bHasSpline)
HOUDINI_FAIL_RETURN(HapiSetLaneProfileLambda(PartInfo.faceCount, HAPI_ATTROWNER_PRIM, SplineLaneProfileNames, SplineLanes, SplineLaneCounts));

// TODO:

HAPI_SESSION_FAIL_RETURN(FHoudiniApi::CommitGeo(FHoudiniEngine::Get().GetSession(), NodeId));

if (bCreateNewNode)
HOUDINI_FAIL_RETURN(Input->HapiConnectToMergeNode(NodeId));

return true;
}
Expand Down

0 comments on commit 5559736

Please sign in to comment.