When I try to include “Components/InstancedSkinnedMeshComponent.h”
I get the following error when building:
InstancedSkinnedMeshComponent.h(296, 2): [C3837] attributes are not allowed in this context
Empty default c++ 5.7 project.
I’m confused why the error would be in the instanced skinned mesh component, as it’s in the engine and working. Is there something else I need to do to get access to the skeletal mesh ISM?
It is an experimental feature for the new Nanite Foliage.
Here’s an exact example of the default created component made from inheritance.
``` #pragma once
include “CoreMinimal.h” include “Components/InstancedSkinnedMeshComponent.h” include “AsmrInstancedSkinnedMeshComponent.generated.h”
UCLASS(Blueprintable, ClassGroup=(Rendering), meta=(BlueprintSpawnableComponent))
class ASMR_API UMyInstancedSkinnedMeshComponent : public UInstancedSkinnedMeshComponent
{
GENERATED_BODY()
public:
// Sets default values for this component’s properties
UMyInstancedSkinnedMeshComponent();
};
```
I haven’t got experience with the new Nanite stuff or this header, but I’ll throw some guesses out there in case they might help.
Double check that that header file itself is not part of a plugin. If it’s part of a plugin and not part of the core engine, you need to make sure to update your .cs build file to have the include for the dependency module of whatever system that’s in. I’m going to assume that the new Nanite foliage stuff might be its own plugin and its own module.
Second thing is that you need to check to see exactly what functions or features you’re looking to access or subclass. you may be better served by going further down the chain of children or maybe even up the chain i am unsure if there are some classes which epic actually don’t want people subclassing directly from they want people subclassing below or above
Finally, and I’m assuming this is correct, but just double check that you’re not calling anything else. Just try maybe in a blueprint function library, for example, to do the include. If that works, maybe try to create a child of instant skin mesh components with no other code at all. See if that works.
Thanks for the steps. It’s a standard engine component.
Empty c++ 5.7 project created from editor, with new class inheriting from InstancedSkinnedMeshComponent, (though it doesn’t even need to be inherited just having the include pops the error.
I’m now building 5.7 from source, to see if it’s something in the toolchain that’s happening since I just grabbed the binaries the standard way from the launcher.
[EDIT] I’ve tried from source, but the same issue error happens, which I think has to do with the Experimental/Deprecated macro in this header file. Unsure.
If the class is deprecated, then that would perfectly explain it. You do not want to subclass and build out from deprecated functions or classes. And there should be a message in the deprecation warning to tell you where or what to use instead.
If the class is experimental, that should not stop you in any way from doing what you want to do.
If you really want to do it, then of course, with the source code, anything is possible just remove that macro and carry on. However, you will have embarked on the dangerous road that is a custom version of the engine. Tread carefully for all projects that have any ambition to be shipped one day.
Did you find a solution to this, that doesn’t involve getting the engine source code? I’d rather just stick with the binaries from the launcher.
I don’t understand how other files are able to include this one without running into the same issue honestly, unless the binaries were built with slightly different code then what’s provided.