Cannot open source file "DestructibleMesh.h"

Hi,

This should be an easy fix.

Go to the editor >> FILE >> REFRESH VISUAL STUDIO PROJECT.

Then go to VS and you will be prompt with a File Modification Detected warning. Click Reload All.

Hope it helps.

I have trying to extend the UDestructibleMesh class, but I get this error: "Cannot open source file “DestructibleMesh.h”. When I try to extend the UDestructibleComponent it works fine. This might be a bug, but I dont know. Can somebody confirm this is a bug? Or I just did something wrong?

The module is on, and I added the apex plugin to the dependencies:

PublicDependencyModuleNames.AddRange(
new string[]
	{
		"Core",
                "CoreUObject",
                "Engine",
                "Slate",
                "SlateCore",
                "ApexDestruction"
            }
);

The class is pretty much a barebone C++ created by the editor:

#pragma once

#include "CoreMinimal.h"
#include "DestructibleMesh.h"
#include "CoreDestructibleMesh.generated.h"

/**
 * 
 */
UCLASS()
class CUSTOMCORE_API UCoreDestructibleMesh : public UDestructibleMesh
{
	GENERATED_BODY()
	
};

Update:
I just tried to create this class with a fresh empty project. And I have the same result.

Hi,

Thanks for the reply. It looks like it solved the include issue in some degree. It doesnt cry for the source file anymore, at least until I want to make it blueprintable (because when I’m make it blueprintable the the error coming back), but I have an other issues now. Forgive me for my maybe noobish question, but my C++ knowlegde is lacking even though I programming for 10+ years. So I get the following errors. Do I need to override these functions or what do I need to do with this errors? Because it looks like the included header is still not working correctly, but I’m not sure.

Edit: I just tried to create this class with a fresh empty project. And I have the same result, so its looks like the project itself is not broken.

I tried it out and get the same error. Might be missing another module or header.

Maybe, but which ones?

You need to include the APEX Destruction Plugin in your build.cs (PublicDependencyModuleNames.add)

I’m not sure I did something wrong, or you didnt read my question carefully. Because there is the PublicDependencyModuleNames in my original question and you can see the apexdestruction is included. Can you please clarify what is the mistake I made? Did I misspell something? I dont really know.

Okey, I think I found the source of the issue. When you try to inherit from a plugin class the class needs to be flagged to be exportable. In this case the class definition should contain the following: “APEXDESTRUCTION_API”. But it doesnt, so you cant inherit from it. So the sollution is some engine source code thinkering (adding the flag to the source code), or just forget it.

If somebody has any workaround without engine thinkering please let me know, but until then I just mark the question as solved.

(I would be glad if this would be an exported engine feature)