How to include the header file from a plugin

I seem to be able to do that (I’m trying to access the Sequencer from a plugin, and your advice let me do that!).

But even though I’ve added “Sequencer” and “LevelSequence” to the ‘PublicDependencyModuleNames.AddRange’ statement, when I use Live Code to compile I continually get this error:

  [1/2] Compile [x64] etbbb.cpp
  F:\UEPROJECTS\MakePlugins7\Plugins\etbbb\Source\etbbb\Private\etbbb.cpp(68): error C2248: 'USequencerSettings::bLeftMouseDragDoesMarquee': cannot access protected member declared in class 'USequencerSettings'
  C:\Program Files\Epic Games\UE_5.4\Engine\Source\Editor\Sequencer\Public\SequencerSettings.h(579): note: see declaration of 'USequencerSettings::bLeftMouseDragDoesMarquee'

I don’t really understand what a ‘protected member class’ is, or how to change them. (I’m not good at C++ lol)

Hi virtualfilmer,

My understanding from your error snippet is that you are trying to access a boolean variable bLeftMouseDragDoesMarquee that is marked as protected, in the class USequencerSettings.

If you navigate to that file, you should see something like:

protected:
    . . .
    bool bLeftMouseDragDoesMarquee = false;

The “protected member” in the error refers to this protected variable. And it can only be accessed by a class that inherits USequencerSettings - see this. You could modify the source code and change the access specifier to be public to expose it to all classes but it might break the plugin if you mess with the variable.

With that being said - If it is not you who is trying to access that variable, but rather it is the plugin itself, you may need to try a different approach if the above doesn’t work. Such as:

  1. might require you to add more modules to the list
  2. adding it inside PrivateDependencyModuleNames instead (though I have no idea if it will make any difference)

or general workarounds like:

  1. closing the editor and Rebuilding the app in VisualStudio a couple of times (Clean Solution => Rebuild Soln). And reopen editor
  2. Deleting the .sln and regenerating it
  3. deleting directories Binaries/, Intermediate/, DerivedDataCache/, Saved/ (take a backup first if necessary) and rebuild.

Hope it helps. :smile:

Regards,
Wasabi.

Here’s my solution:: Import my OpenRTSCamera pulgin into < project >.build.cs and use RTSSelectable inside.

< project >.build.cs

// Copyright Epic Games, Inc. All Rights Reserved.

using System.IO;
using UnrealBuildTool;

public class OpenRTS : ModuleRules
{
	public OpenRTS(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

        PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "NavigationSystem", "AIModule", "Niagara", "EnhancedInput", "OpenRTSCamera" });
    }
}

Source include ;

#include "../../Plugins/OpenRTSCamera/Source/OpenRTSCamera/Public/RTSSelectable.h"

Finally, rebuild the project.