hi all,
I want to call UEdGraph::AddPropertyChangedNotifier in my blueprintable actor,
does any one know how to get UEdGraph instance in C++?
Here is code sample that I want to implement:
UEdGraph* GetEditorGraphFromSomeWhere() {
return nullptr;
}
AMyActor::AMyActor()
{
PrimaryActorTick.bCanEverTick = true;
#if WITH_EDITOR
UEdGraph* pGraph = GetEditorGraphFromSomeWhere();
if (pGraph) {
FOnPropertyChanged::FDelegate myDelegate;
myDelegate.BindUObject(this, &AMyActor::OnPropertyChangedNotifyReceived);
pGraph->AddPropertyChangedNotifier(myDelegate);
}
#endif
}
the problem is that I don’t know how to implement GetEditorGraphFromSomeWhere.
Atheist91
(Atheist91)
August 2, 2016, 9:53am
2
May I ask why (and where i.e editor only, editor and game, game) you need to listen for changes of properties?
I asked kinda similar question here (and got an answer - the solution I ended up with is at the bottom of my question). Depends on what you exactly want to achieve that might help you.
hi,
PostEditChangeProperty and PostEditChangeChainProperty are not working if I declare my blueprint var as local variable. for example:
Both var1 and var1_local are my own implement structure, it looks like this:
USTRUCT(BlueprintType)
struct MYLIBRARY_API FMyParameters
{
GENERATED_BODY()
FMyParameters()
: PaperFlipbook(nullptr){
};
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Brush, meta = (DisplayThumbnail = "true", DisplayName = "PaperFlipbook", AllowedClasses = "PaperFlipbook"))
UPaperFlipbook* PaperFlipbook;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HorizonPlugin|DialogueSystem")
TArray<FSlateColor> ColorAndOpacity;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "HorizonPlugin|DialogueSystem")
TArray<FVector2D> SourceUV;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "HorizonPlugin|DialogueSystem")
TArray<FVector2D> SourceSize;
};
var1: just working perfectly when I override PostEditChangeProperty or PostEditChangeChainProperty in my actor.
var1_local: when I modify any field, it will pass in EmptyPropertyUpdateStruct that I can’t trace which filed are modified.
void UObject::PostEditChange(void)
{
FPropertyChangedEvent EmptyPropertyUpdateStruct(NULL);
this->PostEditChangeProperty(EmptyPropertyUpdateStruct);
}
After trace engine source code, I find out that if i add a AddPropertyChangedNotifier to UEdGraph, I can trace which field are modified for this case.
That why I want to find out how to access UEdGraph instance.
As a workaround, I will forbid my team member to use local variable in blueprint, but I think it is not a proper solution…
Did you find how to get the UEdGraph instance, i need it