I’m trying to get instanced objects in the editor viewport to execute Blueprint code when I modify their details. Specifically, I’m changing a Dynamic Material Instance at runtime, and would like the changes to appear in the viewport.
I have PostEditChangeProperty
call a Dynamic delegate that the object blueprint is hooked up to. But the blueprint code doesn’t appear to execute.
I’m seeing the C++ logs, but not the bp printed string. Any idea why?
Header:
#if WITH_EDITOR
virtual void PostEditChangeProperty(struct FPropertyChangedEvent& InChangeEvent) override;
#endif // WITH_EDITOR
UPROPERTY(BlueprintAssignable)
FOnEditorUpdateDelegate OnEditorUpdateDelegate;
Implementation:
void UTP_WeaponComponent::PostEditChangeProperty(FPropertyChangedEvent& InChangeEvent)
{
UE_LOG(LogTemp, Warning, TEXT(__FUNCTION__));
OnEditorUpdateDelegate.Broadcast();
Super::PostEditChangeProperty(InChangeEvent);
}