No way to set stereo layer type in C++

In StereoLayerComponent.h, there is no method to set stereo layer type. No public function allows to set following variable:

/** Specifies how and where the quad is rendered to the screen **/
UPROPERTY(EditAnywhere, BlueprintReadOnly, export, Category=“StereoLayer”)
TEnumAsByte StereoLayerType;

Is it possible to set the StereoLayer type in C++ without editing the Engine code?

Other functions are implemented (e.g. set texture), but some as above are not.

I didn’t want to use blueprint for this case.

Make a child class of UStereoLayerComponent and expose it there then use the new class in place of the StereoLayerComponent

.h

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Components/StereoLayerComponent.h"
#include "MyStereoLayerComponent.generated.h"

/**
 * 
 */
UCLASS(Blueprintable, BlueprintType)
class YOUR_API UMyStereoLayerComponent : public UStereoLayerComponent
{
	GENERATED_BODY()

		UFUNCTION(BlueprintCallable) // if bp is needed
		void SetStereoLayerType(EStereoLayerType passedInStereoLayerType);
};

.cpp

// Fill out your copyright notice in the Description page of Project Settings.

#include "MyStereoLayerComponent.h"
void UMyStereoLayerComponent::SetStereoLayerType(EStereoLayerType passedInStereoLayerType) {
	StereoLayerType = passedInStereoLayerType;
}
1 Like

Thank you very much, great method. Tried it, now able to access them.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.