Cast nodes to blueprint classes show up in the new context menu. Sometimes we need the GeneratedClass, sometimes we need the SkeletonGeneratedClass...

[CL 2314925 by Dan Oconnor in Main branch]
This commit is contained in:
Dan Oconnor
2014-09-30 16:54:10 -04:00
committed by UnrealBot
parent 1cf3644763
commit cb8a6d7822
2 changed files with 13 additions and 1 deletions

View File

@@ -573,8 +573,11 @@ static void BlueprintActionDatabaseImpl::AddClassPropertyActions(UClass const* c
}
//------------------------------------------------------------------------------
static void BlueprintActionDatabaseImpl::AddClassCastActions(UClass* const Class, FActionList& ActionListOut)
static void BlueprintActionDatabaseImpl::AddClassCastActions(UClass* Class, FActionList& ActionListOut)
{
Class = Class->GetAuthoritativeClass();
check(Class);
UEdGraphSchema_K2 const* K2Schema = GetDefault<UEdGraphSchema_K2>();
bool bIsCastPermitted = UEdGraphSchema_K2::IsAllowableBlueprintVariableType(Class);

View File

@@ -1280,6 +1280,15 @@ UClass const* FBlueprintActionInfo::GetOwnerClass()
{
CachedOwnerClass = GetAssociatedMemberField()->GetOwnerClass();
}
if( CachedOwnerClass == nullptr )
{
if (const UBlueprint* AsBlueprint = Cast<UBlueprint>(ActionOwner))
{
CachedOwnerClass = AsBlueprint->SkeletonGeneratedClass;
}
}
CacheFlags |= EBlueprintActionInfoFlags::CachedClass;
}
return CachedOwnerClass;