本文整理汇总了C++中TObjectIterator::GetOuter方法的典型用法代码示例。如果您正苦于以下问题:C++ TObjectIterator::GetOuter方法的具体用法?C++ TObjectIterator::GetOuter怎么用?C++ TObjectIterator::GetOuter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TObjectIterator
的用法示例。
在下文中一共展示了TObjectIterator::GetOuter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadFile
bool UDiffAssetsCommandlet::LoadFile(const FString& Filename, TArray<UObject *>& LoadedObjects)
{
UPackage* Package = Cast<UPackage>(LoadPackage( NULL, *Filename, LOAD_None ));
if (!Package)
{
UE_LOG(LogDiffAssetsCommandlet, Warning, TEXT("Could not load %s"), *Filename);
return false;
}
for (TObjectIterator<UObject> It; It; ++It)
{
if (It->GetOuter() == Package)
{
LoadedObjects.Add(*It);
}
}
if (!LoadedObjects.Num())
{
UE_LOG(LogDiffAssetsCommandlet, Warning, TEXT("Loaded %s, but it didn't contain any objects."), *Filename);
return false;
}
LoadedObjects.Sort();
return true;
}
示例2: ExportObjectInner
void UExporter::ExportObjectInner(const FExportObjectInnerContext* Context, UObject* Object, FOutputDevice& Ar, uint32 PortFlags, bool bSkipComponents)
{
// indent all the text in here
TextIndent += 3;
FExportObjectInnerContext::InnerList ObjectInners;
if ( Context )
{
const FExportObjectInnerContext::InnerList* Inners = Context->ObjectToInnerMap.Find( Object );
if ( Inners )
{
ObjectInners = *Inners;
}
}
else
{
for (TObjectIterator<UObject> It; It; ++It)
{
if ( It->GetOuter() == Object )
{
ObjectInners.Add( *It );
}
}
}
TArray<UObject*> Components;
if (!bSkipComponents)
{
// first export the components
Object->CollectDefaultSubobjects(Components, false);
}
if (!(PortFlags & PPF_SeparateDefine))
{
for ( int32 ObjIndex = 0 ; ObjIndex < ObjectInners.Num() ; ++ObjIndex )
{
// NOTE: We ignore inner objects that have been tagged for death
UObject* Obj = ObjectInners[ObjIndex];
if ( !Obj->IsPendingKill() && !Obj->IsDefaultSubobject() && !Obj->HasAnyFlags(RF_TextExportTransient) && FCString::Stricmp(*Obj->GetClass()->GetName(), TEXT("Model")) != 0)
{
// export the object
UExporter::ExportToOutputDevice( Context, Obj, NULL, Ar, (PortFlags & PPF_Copy) ? TEXT("Copy") : TEXT("T3D"), TextIndent, PortFlags | PPF_SeparateDeclare, false, ExportRootScope );
}
}
if (!bSkipComponents)
{
ExportComponentDefinitions(Context, Components, Ar, PortFlags | PPF_SeparateDeclare);
}
}
if (!(PortFlags & PPF_SeparateDeclare))
{
for ( int32 ObjIndex = 0 ; ObjIndex < ObjectInners.Num() ; ++ObjIndex )
{
// NOTE: We ignore inner objects that have been tagged for death
UObject* Obj = ObjectInners[ObjIndex];
if ( !Obj->IsPendingKill() && !Obj->IsDefaultSubobject() && !Obj->HasAnyFlags(RF_TextExportTransient) && FCString::Stricmp(*Obj->GetClass()->GetName(), TEXT("Model")) != 0)
{
// export the object
UExporter::ExportToOutputDevice( Context, Obj, NULL, Ar, (PortFlags & PPF_Copy) ? TEXT("Copy") : TEXT("T3D"), TextIndent, PortFlags | PPF_SeparateDefine, false, ExportRootScope );
// don't reexport below in ExportProperties
Obj->Mark(OBJECTMARK_TagImp);
}
}
if (!bSkipComponents)
{
ExportComponentDefinitions(Context, Components, Ar, PortFlags | PPF_SeparateDefine);
}
// export the object's properties
// Note: we use archetype as the object to diff properties against before they exported. When object is created, they should create from archetype
// and using this system, it should recover all properties it needs to copy
uint8 *CompareObject;
if (Object->HasAnyFlags(RF_ClassDefaultObject))
{
CompareObject = (uint8*)Object;
}
else
{
CompareObject = (uint8*)Object->GetArchetype();
}
ExportProperties( Context, Ar, Object->GetClass(), (uint8*)Object, TextIndent, Object->GetClass(), CompareObject, Object, PortFlags, ExportRootScope );
if (!bSkipComponents)
{
// Export anything extra for the components. Used for instanced foliage.
// This is done after the actor properties so these are set when regenerating the extra data objects.
ExportComponentExtra( Context, Components, Ar, PortFlags );
}
}
// remove indent
TextIndent -= 3;
}