I Have no idea why I can’t edit the SplineComponent in Editor.
I have simple ActorComponent :
ULBranchActorComponent .h
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class MGR_API ULBranchActorComponent : public UActorComponent
{
GENERATED_BODY()
public:
// Sets default values for this component's properties
ULBranchActorComponent();
// Called when the game starts
virtual void BeginPlay() override;
// Called every frame
virtual void TickComponent( float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction ) override;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "LTree-BranchComponent")
class USplineComponent* m_thisBranch;
};
ULBranchActorComponent.cpp
ULBranchActorComponent::ULBranchActorComponent()
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
// off to improve performance if you don't need them.
bWantsBeginPlay = true;
PrimaryComponentTick.bCanEverTick = true;
m_thisBranch = CreateDefaultSubobject<USplineComponent>(TEXT("branch"));
m_thisBranch->Activate(true);
m_thisBranch->bSplineHasBeenEdited = true;
m_thisBranch->MarkRenderStateDirty();
m_thisBranch->SetRelativeLocation(FVector(0, 0, 0));
// ...
}
Then in Actor LTree i have :
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "LTree")
TArray<class ULBranchActorComponent *>m_Branch;
And when I want to add a ULBranchActorComponent i call this :
ULBranchActorComponent *branch = NewObject<ULBranchActorComponent>(this, TEXT("branch"));
branch->m_thisBranch->Activate(true);
branch->m_thisBranch->bSplineHasBeenEdited = true;
branch->m_thisBranch->MarkRenderStateDirty();
m_Branch.Add(branch);
And in Editor I can’t edit those splines, like normal spline so left click and context menue.
I have changed the SplineComponent.h with this Spline not editable when set in Construction Script - Blueprint - Unreal Engine Forums.
So when i have single SplineComponent NOT ULBranchcomponent I’m able to edit this spline. But I want to have multiple splines in one Actor.