本文整理汇总了C++中UObject::IsIn方法的典型用法代码示例。如果您正苦于以下问题:C++ UObject::IsIn方法的具体用法?C++ UObject::IsIn怎么用?C++ UObject::IsIn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UObject
的用法示例。
在下文中一共展示了UObject::IsIn方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleSpecialTypes
FString FEmitDefaultValueHelper::HandleSpecialTypes(FEmitterLocalContext& Context, const UProperty* Property, const uint8* ValuePtr)
{
//TODO: Use Path maps for Objects
if (auto ObjectProperty = Cast<UObjectProperty>(Property))
{
UObject* Object = ObjectProperty->GetPropertyValue(ValuePtr);
if (Object)
{
{
UClass* ObjectClassToUse = Context.GetFirstNativeOrConvertedClass(ObjectProperty->PropertyClass);
const FString MappedObject = Context.FindGloballyMappedObject(Object, ObjectClassToUse);
if (!MappedObject.IsEmpty())
{
return MappedObject;
}
}
const bool bCreatingSubObjectsOfClass = (Context.CurrentCodeType == FEmitterLocalContext::EGeneratedCodeType::SubobjectsOfClass);
{
auto BPGC = Context.GetCurrentlyGeneratedClass();
auto CDO = BPGC ? BPGC->GetDefaultObject(false) : nullptr;
if (BPGC && Object && CDO && Object->IsIn(BPGC) && !Object->IsIn(CDO) && bCreatingSubObjectsOfClass)
{
return HandleClassSubobject(Context, Object, FEmitterLocalContext::EClassSubobjectList::MiscConvertedSubobjects, true, true);
}
}
if (!bCreatingSubObjectsOfClass && Property->HasAnyPropertyFlags(CPF_InstancedReference))
{
const FString CreateAsInstancedSubobject = HandleInstancedSubobject(Context, Object, Object->HasAnyFlags(RF_ArchetypeObject));
if (!CreateAsInstancedSubobject.IsEmpty())
{
return CreateAsInstancedSubobject;
}
}
}
else if (ObjectProperty->HasMetaData(FBlueprintMetadata::MD_LatentCallbackTarget))
{
return TEXT("this");
}
}
if (auto StructProperty = Cast<UStructProperty>(Property))
{
FString StructConstructor;
if (SpecialStructureConstructor(StructProperty->Struct, ValuePtr, &StructConstructor))
{
return StructConstructor;
}
}
return FString();
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:53,代码来源:BlueprintCompilerCppBackendValueHelper.cpp
示例2: SearchMode
FReferenceChainSearch::FReferenceChainSearch( UObject* InObjectToFind, uint32 Mode )
:ObjectToFind(InObjectToFind), SearchMode(Mode)
{
if (ObjectToFind == NULL) { return; }
PerformSearch();
if ( !!(Mode & ESearchMode::PrintResults) )
{
bool bIsFirst = true;
for (int32 i=0; i < Referencers.Num(); ++i)
{
UObject* Obj = Referencers[i].RefChain[0].ReferencedBy;
if (!Obj->IsIn(ObjectToFind) && Obj != ObjectToFind)
{
if (bIsFirst)
{
UE_LOG(LogReferenceChain, Log, TEXT(" "));
UE_LOG(LogReferenceChain, Log, TEXT("External Referencers:"));
bIsFirst = false;
}
PrintReferencers(Referencers[i]);
}
}
bIsFirst = true;
for (int32 i=0; i < Referencers.Num(); ++i)
{
UObject* Obj = Referencers[i].RefChain[0].ReferencedBy;
CA_SUPPRESS(6011)
if (Obj->IsIn(ObjectToFind) || Obj == ObjectToFind)
{
if (bIsFirst)
{
UE_LOG(LogReferenceChain, Log, TEXT(" "));
UE_LOG(LogReferenceChain, Log, TEXT("Internal Referencers:"));
bIsFirst = false;
}
PrintReferencers(Referencers[i]);
}
}
}
示例3: CanPossessObject
bool FUMGSequencerObjectBindingManager::CanPossessObject( UObject& Object ) const
{
UWidgetBlueprint* WidgetBlueprint = WidgetBlueprintEditor.GetWidgetBlueprintObj();
// Only preview widgets in this blueprint can be possessed
UUserWidget* PreviewWidget = WidgetBlueprintEditor.GetPreview();
return Object.IsA<UVisual>() && Object.IsIn( PreviewWidget );
}
示例4: CanPossessObject
bool FUMGSequencerObjectBindingManager::CanPossessObject( UObject& Object ) const
{
// Can't possess empty slots.
UPanelSlot* Slot = Cast<UPanelSlot>(&Object);
if (Slot != nullptr && Slot->Content == nullptr)
{
return false;
}
UWidgetBlueprint* WidgetBlueprint = WidgetBlueprintEditor.GetWidgetBlueprintObj();
// Only preview widgets in this blueprint can be possessed
UUserWidget* PreviewWidget = WidgetBlueprintEditor.GetPreview();
return Object.IsA<UVisual>() && Object.IsIn( PreviewWidget );
}
示例5: ExportTextItem
void UInterfaceProperty::ExportTextItem( FString& ValueStr, const void* PropertyValue, const void* DefaultValue, UObject* Parent, int32 PortFlags, UObject* ExportRootScope ) const
{
FScriptInterface* InterfaceValue = (FScriptInterface*)PropertyValue;
UObject* Temp = InterfaceValue->GetObject();
if (0 != (PortFlags & PPF_ExportCpp))
{
const FString GetObjectStr = Temp
? FString::Printf(TEXT("LoadObject<UObject>(nullptr, TEXT(\"%s\"))"), *Temp->GetPathName().ReplaceCharWithEscapedChar())
: TEXT("");
ValueStr += FString::Printf(TEXT("TScriptInterface<I%s>(%s)")
, (InterfaceClass ? *InterfaceClass->GetName() : TEXT("Interface"))
, *GetObjectStr);
return;
}
if( Temp != NULL )
{
bool bExportFullyQualified = true;
// When exporting from one package or graph to another package or graph, we don't want to fully qualify the name, as it may refer
// to a level or graph that doesn't exist or cause a linkage to a node in a different graph
UObject* StopOuter = NULL;
if (PortFlags & PPF_ExportsNotFullyQualified)
{
StopOuter = (ExportRootScope || (Parent == NULL)) ? ExportRootScope : Parent->GetOutermost();
bExportFullyQualified = !Temp->IsIn(StopOuter);
}
// if we want a full qualified object reference, use the pathname, otherwise, use just the object name
if (bExportFullyQualified)
{
StopOuter = NULL;
if ( (PortFlags&PPF_SimpleObjectText) != 0 && Parent != NULL )
{
StopOuter = Parent->GetOutermost();
}
}
ValueStr += FString::Printf( TEXT("%s'%s'"), *Temp->GetClass()->GetName(), *Temp->GetPathName(StopOuter) );
}
else
{
ValueStr += TEXT("None");
}
}
示例6: CanPossessObject
bool UWidgetAnimation::CanPossessObject(UObject& Object) const
{
if (&Object == PreviewWidget.Get())
{
return true;
}
UPanelSlot* Slot = Cast<UPanelSlot>(&Object);
if ((Slot != nullptr) && (Slot->Content == nullptr))
{
// can't possess empty slots.
return false;
}
return (Object.IsA<UVisual>() && Object.IsIn(PreviewWidget.Get()));
}
示例7: HandleObjectReference
virtual void HandleObjectReference(UObject*& InObject, const UObject* InReferencingObject, const UProperty* InReferencingProperty) override
{
UObject* Object = InObject;
if (!Object || Object->IsA<UBlueprint>())
{
return;
}
UClass* ActualClass = Cast<UClass>(Dependencies.GetActualStruct());
UStruct* CurrentlyConvertedStruct = ActualClass ? Dependencies.FindOriginalClass(ActualClass) : Dependencies.GetActualStruct();
ensure(CurrentlyConvertedStruct);
if (Object == CurrentlyConvertedStruct)
{
return;
}
if (Object->HasAnyFlags(RF_ClassDefaultObject))
{
// Static functions from libraries are called on CDO. (The functions is stored as a name not an object).
UClass* OwnerClass = Object->GetClass();
if (OwnerClass && (OwnerClass != CurrentlyConvertedStruct))
{
UBlueprintGeneratedClass* OwnerAsBPGC = Cast<UBlueprintGeneratedClass>(OwnerClass);
if (OwnerAsBPGC && !Dependencies.ConvertedClasses.Contains(OwnerAsBPGC) && Dependencies.WillClassBeConverted(OwnerAsBPGC))
{
Dependencies.ConvertedClasses.Add(OwnerAsBPGC);
}
}
}
const bool bUseZConstructorInGeneratedCode = false;
//TODO: What About Delegates?
auto ObjAsBPGC = Cast<UBlueprintGeneratedClass>(Object);
const bool bWillBeConvetedAsBPGC = ObjAsBPGC && Dependencies.WillClassBeConverted(ObjAsBPGC);
if (bWillBeConvetedAsBPGC)
{
if (ObjAsBPGC != CurrentlyConvertedStruct)
{
Dependencies.ConvertedClasses.Add(ObjAsBPGC);
if(!bUseZConstructorInGeneratedCode)
{
IncludeTheHeaderInBody(ObjAsBPGC);
}
}
}
else if (UUserDefinedStruct* UDS = Cast<UUserDefinedStruct>(Object))
{
if (!UDS->HasAnyFlags(RF_ClassDefaultObject))
{
Dependencies.ConvertedStructs.Add(UDS);
if(!bUseZConstructorInGeneratedCode)
{
IncludeTheHeaderInBody(UDS);
}
}
}
else if (UUserDefinedEnum* UDE = Cast<UUserDefinedEnum>(Object))
{
if (!UDE->HasAnyFlags(RF_ClassDefaultObject))
{
Dependencies.ConvertedEnum.Add(UDE);
}
}
else if ((Object->IsAsset() || ObjAsBPGC) && !Object->IsIn(CurrentlyConvertedStruct))
{
// include all not converted super classes
for (auto SuperBPGC = ObjAsBPGC ? Cast<UBlueprintGeneratedClass>(ObjAsBPGC->GetSuperClass()) : nullptr;
SuperBPGC && !Dependencies.WillClassBeConverted(SuperBPGC);
SuperBPGC = Cast<UBlueprintGeneratedClass>(SuperBPGC->GetSuperClass()))
{
Dependencies.Assets.AddUnique(SuperBPGC);
}
Dependencies.Assets.AddUnique(Object);
return;
}
else if (auto ObjAsClass = Cast<UClass>(Object))
{
if (ObjAsClass->HasAnyClassFlags(CLASS_Native))
{
return;
}
}
else if (Object->IsA<UScriptStruct>())
{
return;
}
FindReferencesForNewObject(Object);
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:90,代码来源:BlueprintCompilerCppBackendGatherDependencies.cpp
示例8: GenerateDebugObjectNames
void SBlueprintEditorSelectedDebugObjectWidget::GenerateDebugObjectNames(bool bRestoreSelection)
{
TSharedPtr<FString> OldSelection;
// Store off the old selection
if (bRestoreSelection && DebugObjectsComboBox.IsValid())
{
OldSelection = DebugObjectsComboBox->GetSelectedItem();
}
// Empty the lists of actors and regenerate them
DebugObjects.Empty();
DebugObjectNames.Empty();
DebugObjects.Add(NULL);
DebugObjectNames.Add(MakeShareable(new FString(GetNoDebugString())));
// Grab custom objects that should always be visible, regardless of the world
TArray<FCustomDebugObject> CustomDebugObjects;
BlueprintEditor.Pin()->GetCustomDebugObjects(/*inout*/ CustomDebugObjects);
for (const FCustomDebugObject& Entry : CustomDebugObjects)
{
if (Entry.NameOverride.IsEmpty())
{
AddDebugObject(Entry.Object);
}
else
{
AddDebugObjectWithName(Entry.Object, Entry.NameOverride);
}
}
// Check for a specific debug world. If DebugWorld=NULL we take that as "any PIE world"
UWorld* DebugWorld = NULL;
if (DebugWorldsComboBox.IsValid())
{
TSharedPtr<FString> CurrentWorldSelection = DebugWorldsComboBox->GetSelectedItem();
int32 SelectedIndex = DebugWorldNames.Find(CurrentWorldSelection);
if (SelectedIndex > 0 && DebugWorldNames.IsValidIndex(SelectedIndex))
{
DebugWorld = DebugWorlds[SelectedIndex].Get();
}
}
UWorld* PreviewWorld = NULL;
TSharedPtr<SSCSEditorViewport> PreviewViewportPtr = BlueprintEditor.Pin()->GetSCSViewport();
if (PreviewViewportPtr.IsValid())
{
PreviewWorld = PreviewViewportPtr->GetPreviewScene().GetWorld();
}
for (TObjectIterator<UObject> It; It; ++It)
{
UObject* TestObject = *It;
// Skip Blueprint preview objects (don't allow them to be selected for debugging)
if (PreviewWorld != NULL && TestObject->IsIn(PreviewWorld))
{
continue;
}
const bool bPassesFlags = !TestObject->HasAnyFlags(RF_PendingKill | RF_ClassDefaultObject);
const bool bGeneratedByBlueprint = TestObject->GetClass()->ClassGeneratedBy == GetBlueprintObj();
if (bPassesFlags && bGeneratedByBlueprint)
{
UObject *ObjOuter = TestObject;
UWorld *ObjWorld = NULL;
while (ObjWorld == NULL && ObjOuter != NULL)
{
ObjOuter = ObjOuter->GetOuter();
ObjWorld = Cast<UWorld>(ObjOuter);
}
// Object not in any world
if (!ObjWorld)
{
continue;
}
// Make check on owning level (not streaming level)
if (ObjWorld->PersistentLevel && ObjWorld->PersistentLevel->OwningWorld)
{
ObjWorld = ObjWorld->PersistentLevel->OwningWorld;
}
// We have a specific debug world and the object isnt in it
if (DebugWorld && ObjWorld != DebugWorld)
{
continue;
}
// We don't have a specific debug world, but the object isnt in a PIE world
if (ObjWorld->WorldType != EWorldType::PIE)
{
continue;
}
AddDebugObject(TestObject);
}
//.........这里部分代码省略.........