Collision Complexity "Use Complex as Simple" causes Static Mesh's Body Setup to fail validation: "Bone None requires at least one collision shape"

Hello,

  • The Body Setup of a Static Mesh with Simple Collision will pass validation.

  • The Collision Complexity option, Use Complex as Simple, uses the Complex Collision as Simple Collision.

  • Consequently, I would think the Simple Collision of a Static Mesh with Use Complex as Simple would be unimportant, as it would be using the Complex Collision instead.

  • If I use the following code to validate the Body Setup of a Static Mesh with Complex Collision, Simple Collision, and Use Complex as Simple, the validation will succeed:

    • `StaticMesh->GetBodySetup()->IsDataValid(Context)`
  • However, if I remove the Simple Collision, and validate again, the validation will fail with the following error:

    • “Bone None requires at least one collision shape”

This seems contrary to Use Complex as Simple. I would expect it to create the body setup as if the Complex Collision were the simple collision, and have no errors.

Please see the attached repro project and repro steps to verify the findings I have stated above.

Is this a bug? Alternatively, contrary to what the property name would suggest, are our Static Meshes being set up wrong? Should Static Meshes have Simple Collision even if Use Complex as Simple is set? Please advise.

I understand this is an obscure issue, but it is causing issues in our project. Your help is greatly appreciated.

Many thanks,

Isaac Dexter

Steps to Reproduce

  1. Create a new empty C++ project.
  2. Copy "Engine/Content/BasicShapes/Cube.uasset to Game/Content.
  3. Open the copy, and in the toolbar press Collision, then Remove Collision. This will remove the mesh’s simple collision.[Image Removed]
  4. Now set the static mesh’s “Collision Complexity” property to “Use Complex Collision” as simple.[Image Removed]
  5. Save the mesh. Now create a new C++ class, inheriting from UObject. [Image Removed]
  6. In the header, give the class a Static Mesh UProperty with Edit Anywhere, and override the IsDataValid() method. Make the class Blueprintable.
#pragma once

#include "UObject/Object.h"
#include "UObject/UObjectGlobals.h"
#include "Misc/DataValidation.h"
#include "Engine/StaticMesh.h"

#include "BodyInstanceValidation.generated.h"

UCLASS(Blueprintable)
class BODYINSTANCEREPRO_API UBodyInstanceValidation : public UObject
{
  GENERATED_BODY()

public:
#if WITH_EDITOR
  virtual EDataValidationResult IsDataValid(FDataValidationContext& Context) const override;
#endif

private:
  UPROPERTY(EditAnywhere)
  TObjectPtr<UStaticMesh> StaticMesh;
};

  • In the source file, override the IsDataValid() method to get the Static Mesh’s Body Setup, and call IsDataValid() on it, returning the result.
#include "BodyInstanceValidation.h"
#include "PhysicsEngine/BodySetup.h"

#if WITH_EDITOR

EDataValidationResult UBodyInstanceValidation::IsDataValid(FDataValidationContext& Context) const
{
  EDataValidationResult Result = Super::IsDataValid(Context);

  if(StaticMesh)
  {
    Result = CombineDataValidationResults(StaticMesh->IsDataValid(Context), Result);
    if(UBodySetup* BodySetup = StaticMesh->GetBodySetup())
    {
      Result = CombineDataValidationResults(BodySetup->IsDataValid(Context), Result);
    }
  }

  return Result;
}

#endif

  • Create a Blueprint inheriting from the new C++ class. Set the Static Mesh property to the new ComplexAsSimple Cube mesh.
  • Right click the new Blueprint, and select Asset Actions, then Validate Assets.[Image Removed]
  • Go to the message log tab. The asset will have failed validation with the following message: “Bone None requires at least one collision shape”.

Hi,

It does look like a bug / inconsistency to me but I could be incorrect, I went ahead and asked Epic for clarification regarding this and will update here after.

Your meshes look to be set up properly.

Looking at the way the validation in UBodySetup is setup, it doesn’t account for Complex as simple - it just checks if AggGeom is populated, which is a Simplified collision representation that holds primitive shapes.

As you mentioned, a workaround would be to have a small dummy simple collision box setup in the meantime to pass the validation check - or to skip the UBodySetup check if the mesh is using Complex as simple.

Thank you for your patience.

Regards

Hi,

Just to add to the above this issue, after enabling sub-object validation we are also seeing this error on spline mesh components which intentionally have no collision (decals). It seems to expect AggGeom to be populated, even if both the asset and spline are set to use NoCollision.

Steps to repro:

  1. Place spline mesh actor in a blank level
  2. Create static mesh with 0 collision shapes
  3. Set static mesh Collision Preset to “NoCollision”
  4. Assign mesh to the spline
  5. Set spline to Collision Preset “NoCollision”
  6. Save level and observe error

Although the UBodySetup isn’t “valid”, AggGeom is intentionally empty in this case. Is this an oversight in the validation? Or, is the validity of the UBodySetup on these sub-objects simply not relevant in the first place?

Thanks

Hi [mention removed]​ is there any further update on this please?

Hi [mention removed]​,

I’m just replying to keep this ticket from being closed.

Sincerely,

Isaac.

Hi all,

Epic said it does look like a bug (or more accurately an oversight in a test assertion).

I went ahead and created a bug report for this issue that can be tracked here if/when it’s approved for public visibility: Unreal Engine Issues and Bug Tracker (UE\-349662\).

There is no ETA as priorities for bugs and features can shift at any time.

[mention removed]​, I added this into the bug report as well as it too falls under the oversight in test assertion.

Thank you all for your patience.

Regards

I’m closing this case, but feel free to respond here if you have follow-up questions!

Thank you all

Apologies for the delay, I went ahead and added this onto the question to Epic - they have a couple other spinning plates and I’ll update this once I get the information.

Thank you again for your patience.

Unfortunately, not yet. Epic has been busy with UEFest and catching up. Apologies for the delays.