This repo collects my public PCG tools
- Unreal Engine 5.4
- Make sure that you have installed a supported version of Unreal Engine.
- See the "Supported Versions" section above.
- Create a C++ UE project.
- Add the PCGExtension plugin to your UE project's Plugins/ folder.
- Regenerate visual studio project files.
- Close your IDE, go to your .uproject file, right click, and select "generate visual studio project files".
- Build and run your project.
This node allows you to create a custom collision box for a mesh and extract the data for this collision box inside PCG. This can be useful if you want to cull meshes based on a specific section of the mesh intersecting with some other object. For example, if you have populated a bunch of mushroom meshes across a surface and you want to cull them based on if the mushroom cap is intersecting with anything (but ignore intersections of the mushroom stalk).
- Pick a mesh that you want to extract collision data from.
- Open the mesh asset editor and select Collision -> Add Box Simplified Collision from the top toolbar to add a collision box.
- Move and scale the collision box as needed.
- If you don't see your collision box for some reason, check that you have Show -> Simple Collision turned on.
- (Optional) Name your collision box.
- By default, the ExtractCollisionBoxesNode will just grab the first collision box it finds. If you have multiple collision boxes attached to your mesh, you can select one by name.
- In the details panel for your mesh, go to Collision -> Primitives -> Boxes -> Index [n] -> Name and change the name field.
- (Optional) Repeat steps 1-4 for as many mesh variants as you want.
- Create a DataAsset of type PCGEMeshData.
- Add a reference to each mesh you wish to extract collision from to your DataAsset.
- In your PCG graph, add a new parameter of type PCGEMeshData and reference the data asset you just created.
- Right Click in Graph -> Get YOUR_PARAM to get the parameter you just created.
- Wire this to a GetPropertyFromObjectPathNode and set the PropertyName field to "WeightedMeshData"
- Wire this to the ExtractCollisionBoxes node and set the MeshAttribute field to "Mesh"
- If you inspect the PCG graph (while an active version of your PCG graph exists in the current scene), you should see one point for each extracted collision box.