void CFlashUIFunctionNode::ProcessEvent( EFlowEvent event,SActivationInfo* pActInfo ) { if (event == eFE_Activate && IsPortActive(pActInfo, eI_Call)) { int port = GetDynStartPort(); SUIArguments args; for (TUIParams::const_iterator iter = m_funcDesc.InputParams.Params.begin(); iter != m_funcDesc.InputParams.Params.end(); ++iter) { GetDynInput( args, *iter, pActInfo, port++ ); } TUIData res; const int instanceId = GetPortInt( pActInfo, eI_InstanceID ); if (IsTemplate() && !UpdateTmplDesc( GetPortString(pActInfo, eI_TemplateInstanceName), pActInfo )) return; SPerInstanceCall2< const SUIArguments &, TUIData & > caller; caller.Execute(m_pElement, instanceId, functor(*this, &CFlashUIFunctionNode::CallFunction), args, res); string out; res.GetValueWithConversion( out ); ActivateOutput( pActInfo, eO_RetVal, out ); ActivateOutput( pActInfo, eO_OnCall, true ); } }
void UEdGraphNode::PostLoad() { Super::PostLoad(); // Create Guid if not present (and not CDO) if(!NodeGuid.IsValid() && !IsTemplate() && GetLinker() && GetLinker()->IsPersistent() && GetLinker()->IsLoading()) { UE_LOG(LogBlueprint, Warning, TEXT("Node '%s' missing NodeGuid."), *GetPathName()); // Generate new one CreateNewGuid(); } // Duplicating a Blueprint needs to have a new Node Guid generated, which was not occuring before this version if(GetLinkerUE4Version() < VER_UE4_POST_DUPLICATE_NODE_GUID) { // Generate new one CreateNewGuid(); } // Moving to the new style comments requires conversion to preserve previous state if(GetLinkerUE4Version() < VER_UE4_GRAPH_INTERACTIVE_COMMENTBUBBLES) { bCommentBubbleVisible = !NodeComment.IsEmpty(); } }
void CFlashUIGotoAndPlayBaseNode::GetConfiguration( SFlowNodeConfig &config ) { static const SInputPortConfig in_config[] = { CreateMovieClipsPort(), CreateInstanceIdPort(), InputPortConfig_Void( "GotoAndPlay", "GotoAndPlay to frame" ), InputPortConfig_Void( "GotoAndStop", "GotoAndStop to frame" ), InputPortConfig<int>( "FrameId", -1, "Frame Number, -1 = use FrameName"), InputPortConfig<string>( "FrameName", "FrameName, only used if FrameId is set to -1" ), InputPortConfig_Void( 0 ), {0} }; static const SInputPortConfig in_config_tmpl[] = { CreateMovieClipsForTmplPort(), CreateInstanceIdPort(), CreateTmplInstanceNamePort(), InputPortConfig_Void( "GotoAndPlay", "GotoAndPlay to frame" ), InputPortConfig_Void( "GotoAndStop", "GotoAndStop to frame" ), InputPortConfig<int>( "FrameId", -1, "Frame Number, -1 = use FrameName"), InputPortConfig<string>( "FrameName", "FrameName, only used if FrameId is set to -1" ), InputPortConfig_Void( 0 ), }; static const SOutputPortConfig out_config[] = { OutputPortConfig_Void( "OnGotoAndPlay", "On GotoAndPlay" ), OutputPortConfig_Void( "OnGotoAndStop", "On GotoAndStop" ), {0} }; config.pInputPorts = IsTemplate() ? in_config_tmpl : in_config; config.pOutputPorts = out_config; config.sDescription = "Access to MovieClips"; config.SetCategory(EFLN_APPROVED); }
bool AKUIInterface::Cancel() { IKUICancellable* oCancellable = NULL; int32 iLastIndex = 0; for ( int32 i = arCancellables.Num() - 1; i >= 0; --i ) { if ( arCancellables[ i ].Get() == NULL ) continue; oCancellable = Cast<IKUICancellable>( arCancellables[ i ].Get() ); iLastIndex = i; break; } arCancellables.SetNum( iLastIndex ); if ( oCancellable != NULL ) { OnCancel( Cast<UObject>( oCancellable ) ); if ( !IsTemplate() ) OnCancelBP( Cast<UObject>( oCancellable ) ); oCancellable->Cancel(); return true; } return false; }
bool UGASAbility::IsTickable() const { if (IsTemplate()) return false; return bShouldTick; }
void AKUIInterface::OnMatchEnd() { KUIBroadcastEvent( FKUIInterfaceEvent, EKUIInterfaceContainerEventList::E_MatchEnd ); if ( !IsTemplate() ) OnMatchEndBP(); }
void AKUIInterface::AddElement( uint8 iContainer, UKUIInterfaceElement* oElement ) { ctRootContainers[ iContainer ]->AddChild( oElement ); if ( !IsTemplate() ) OnElementAddedBP( iContainer, oElement ); }
void CFlashUIVariableBaseNode::GetConfiguration( SFlowNodeConfig &config ) { static const SInputPortConfig in_config[] = { CreateVariablesPort(), CreateInstanceIdPort(), InputPortConfig_Void( "Set", "Set value" ), InputPortConfig_Void( "Get", "Get value" ), InputPortConfig_AnyType( "Value", "Value to set" ), InputPortConfig_Void( 0 ), {0} }; static const SInputPortConfig in_config_tmpl[] = { CreateVariablesForTmplPort(), CreateInstanceIdPort(), CreateTmplInstanceNamePort(), InputPortConfig_Void( "Set", "Set value" ), InputPortConfig_Void( "Get", "Get value" ), InputPortConfig_AnyType( "Value", "Value to set" ), InputPortConfig_Void( 0 ), }; static const SOutputPortConfig out_config[] = { OutputPortConfig_Void( "OnSet", "On set value" ), OutputPortConfig_AnyType( "Value", "Value" ), {0} }; config.pInputPorts = IsTemplate() ? in_config_tmpl : in_config; config.pOutputPorts = out_config; config.sDescription = "Access to Variables"; config.SetCategory(EFLN_APPROVED); }
void AKUIInterface::SetFocus( UKUIInterfaceContainer* ctNewFocus ) { if ( ctFocused.Get() == ctNewFocus ) return; UKUIInterfaceContainer* const ctOldFocus = ctFocused.Get(); if ( ctOldFocus != NULL ) { FKUIInterfaceEvent stEventInfo( EKUIInterfaceContainerEventList::E_Blur ); ctOldFocus->SendEvent( stEventInfo ); } this->ctFocused = ctNewFocus; if ( ctNewFocus != NULL ) { FKUIInterfaceEvent stEventInfo( EKUIInterfaceContainerEventList::E_Focus ); ctNewFocus->SendEvent( stEventInfo ); } FKUIInterfaceContainerElementEvent stEventInfo( EKUIInterfaceContainerEventList::E_FocusChange, ctNewFocus ); BroadcastEvent( stEventInfo ); if ( !IsTemplate() ) OnFocusChangeBP( ctOldFocus, ctNewFocus ); }
FByteBulkData* UBodySetup::GetCookedData(FName Format) { if (IsTemplate()) { return NULL; } IInterface_CollisionDataProvider* CDP = Cast<IInterface_CollisionDataProvider>(GetOuter()); // If there is nothing to cook or if we are reading data from a cooked package for an asset with no collision, // we want to return here if ((AggGeom.ConvexElems.Num() == 0 && CDP == NULL) || !bHasCookedCollisionData) { return NULL; } FFormatContainer* UseCookedData = CookedFormatDataOverride ? CookedFormatDataOverride : &CookedFormatData; bool bContainedData = UseCookedData->Contains(Format); FByteBulkData* Result = &UseCookedData->GetFormat(Format); #if WITH_PHYSX if (!bContainedData) { if (FPlatformProperties::RequiresCookedData()) { UE_LOG(LogPhysics, Error, TEXT("Attempt to build physics data for %s when we are unable to. This platform requires cooked packages."), *GetPathName()); } if (AggGeom.ConvexElems.Num() == 0 && (CDP == NULL || CDP->ContainsPhysicsTriMeshData(bMeshCollideAll) == false)) { return NULL; } #if WITH_RUNTIME_PHYSICS_COOKING || WITH_EDITOR TArray<uint8> OutData; FDerivedDataPhysXCooker* DerivedPhysXData = new FDerivedDataPhysXCooker(Format, this); if (DerivedPhysXData->CanBuild()) { #if WITH_EDITOR GetDerivedDataCacheRef().GetSynchronous(DerivedPhysXData, OutData); #elif WITH_RUNTIME_PHYSICS_COOKING DerivedPhysXData->Build(OutData); #endif if (OutData.Num()) { Result->Lock(LOCK_READ_WRITE); FMemory::Memcpy(Result->Realloc(OutData.Num()), OutData.GetData(), OutData.Num()); Result->Unlock(); } } else #endif { UE_LOG(LogPhysics, Warning, TEXT("Attempt to build physics data for %s when we are unable to."), *GetPathName()); } } #endif // WITH_PHYSX check(Result); return Result->GetBulkDataSize() > 0 ? Result : NULL; // we don't return empty bulk data...but we save it to avoid thrashing the DDC }
void UActorComponent::SetComponentTickEnabled(bool bEnabled) { if (!IsTemplate() && PrimaryComponentTick.bCanEverTick) { PrimaryComponentTick.SetTickFunctionEnable(bEnabled); } }
UTexture::UTexture(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { SRGB = true; Filter = TF_Default; #if WITH_EDITORONLY_DATA AdjustBrightness = 1.0f; AdjustBrightnessCurve = 1.0f; AdjustVibrance = 0.0f; AdjustSaturation = 1.0f; AdjustRGBCurve = 1.0f; AdjustHue = 0.0f; AdjustMinAlpha = 0.0f; AdjustMaxAlpha = 1.0f; MaxTextureSize = 0; // means no limitation MipGenSettings = TMGS_FromTextureGroup; CompositeTextureMode = CTM_NormalRoughnessToAlpha; CompositePower = 1.0f; bUseLegacyGamma = false; AlphaCoverageThresholds = FVector4(0, 0, 0, 0); PaddingColor = FColor::Black; ChromaKeyColor = FColorList::Magenta; ChromaKeyThreshold = 1.0f / 255.0f; #endif // #if WITH_EDITORONLY_DATA if (FApp::CanEverRender() && !IsTemplate()) { TextureReference.BeginInit_GameThread(); } }
void UTexture::PostLoad() { Super::PostLoad(); #if WITH_EDITORONLY_DATA if (AssetImportData == nullptr) { AssetImportData = NewObject<UAssetImportData>(this, TEXT("AssetImportData")); } if (!SourceFilePath_DEPRECATED.IsEmpty()) { FAssetImportInfo Info; Info.Insert(FAssetImportInfo::FSourceFile(SourceFilePath_DEPRECATED)); AssetImportData->SourceData = MoveTemp(Info); } #endif if( !IsTemplate() ) { // Update cached LOD bias. UpdateCachedLODBias(); // The texture will be cached by the cubemap it is contained within on consoles. UTextureCube* CubeMap = Cast<UTextureCube>(GetOuter()); if (CubeMap == NULL) { // Recreate the texture's resource. UpdateResource(); } } }
void UActorComponent::DoDeferredRenderUpdates_Concurrent() { checkf(!HasAnyFlags(RF_Unreachable), TEXT("%s"), *GetFullName()); checkf(!IsTemplate(), TEXT("%s"), *GetFullName()); checkf(!IsPendingKill(), TEXT("%s"), *GetFullName()); if(!IsRegistered()) { UE_LOG(LogActorComponent, Log, TEXT("UpdateComponent: (%s) Not registered, Aborting."), *GetPathName()); return; } if(bRenderStateDirty) { SCOPE_CYCLE_COUNTER(STAT_PostTickComponentRecreate); RecreateRenderState_Concurrent(); checkf(!bRenderStateDirty, TEXT("Failed to route CreateRenderState_Concurrent (%s)"), *GetFullName()); } else { SCOPE_CYCLE_COUNTER(STAT_PostTickComponentLW); if(bRenderTransformDirty) { // Update the component's transform if the actor has been moved since it was last updated. SendRenderTransform_Concurrent(); } if(bRenderDynamicDataDirty) { SendRenderDynamicData_Concurrent(); } } }
void AKUIInterface::OnMatchUnpaused( uint32 iPlayerId ) { KUIBroadcastEvent( FKUIInterfaceContainerPlayerEvent, EKUIInterfaceContainerEventList::E_MatchUnpaused, iPlayerId ); if ( !IsTemplate() ) OnMatchUnpauseBP( iPlayerId ); }
void AKUIInterface::Tick( float fDeltaTime ) { FKUIInterfaceContainerTickEvent stEventInfo( EKUIInterfaceContainerEventList::E_Tick, fDeltaTime ); BroadcastEvent( stEventInfo ); if ( !IsTemplate() ) OnTickBP( fDeltaTime ); }
void UDataTable::FinishDestroy() { Super::FinishDestroy(); if(!IsTemplate()) { EmptyTable(); // Free memory when UObject goes away } }
UJavascriptHttpRequest::UJavascriptHttpRequest(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { if (!IsTemplate(RF_ClassDefaultObject)) { Request = FHttpModule::Get().CreateRequest(); } }
void UChildActorComponent::Serialize(FArchive& Ar) { Super::Serialize(Ar); if (Ar.HasAllPortFlags(PPF_DuplicateForPIE)) { // PIE duplication should just work normally Ar << ChildActorTemplate; } else if (Ar.HasAllPortFlags(PPF_Duplicate)) { if (GIsEditor && Ar.IsLoading() && !IsTemplate()) { // If we're not a template then we do not want the duplicate so serialize manually and destroy the template that was created for us Ar.Serialize(&ChildActorTemplate, sizeof(UObject*)); if (AActor* UnwantedDuplicate = static_cast<AActor*>(FindObjectWithOuter(this, AActor::StaticClass()))) { UnwantedDuplicate->MarkPendingKill(); } } else if (!GIsEditor && !Ar.IsLoading() && !GIsDuplicatingClassForReinstancing) { // Avoid the archiver in the duplicate writer case because we want to avoid the duplicate being created Ar.Serialize(&ChildActorTemplate, sizeof(UObject*)); } else { // When we're loading outside of the editor we won't have created the duplicate, so its fine to just use the normal path // When we're loading a template then we want the duplicate, so it is fine to use normal archiver // When we're saving in the editor we'll create the duplicate, but on loading decide whether to take it or not Ar << ChildActorTemplate; } } #if WITH_EDITOR // Since we sometimes serialize properties in instead of using duplication if we are a template // and are not pointing at a component we own we'll need to fix that if (ChildActorTemplate && ChildActorTemplate->GetOuter() != this && IsTemplate()) { const FString TemplateName = FString::Printf(TEXT("%s_%s_CAT"), *GetName(), *ChildActorClass->GetName()); ChildActorTemplate = CastChecked<AActor>(StaticDuplicateObject(ChildActorTemplate, this, *TemplateName)); } #endif }
UIWidget* UIShape::CreateCopy(UIWidget *Parent, const QString &Newname) { bool isnew = !Newname.isEmpty(); UIShape* shape = new UIShape(m_rootParent, Parent, isnew ? Newname : GetDerivedWidgetName(Parent->objectName()), (!isnew && IsTemplate()) ? WidgetFlagTemplate : WidgetFlagNone); shape->CopyFrom(this); return shape; }
void USoundWave::PostInitProperties() { Super::PostInitProperties(); if(!IsTemplate()) { InvalidateCompressedData(); } }
void UBodySetup::PostInitProperties() { Super::PostInitProperties(); if(!IsTemplate()) { BodySetupGuid = FGuid::NewGuid(); } }
void UShapeComponent::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) { if (!IsTemplate()) { UpdateBodySetup(); // do this before reregistering components so that new values are used for collision } Super::PostEditChangeProperty(PropertyChangedEvent); }
bool USoundWave::HasCompressedData(FName Format) const { if (IsTemplate() || IsRunningDedicatedServer()) { return false; } return CompressedFormatData.Contains(Format); }
void UEdGraph::PostInitProperties() { Super::PostInitProperties(); if (!IsTemplate()) { GraphGuid = FGuid::NewGuid(); } }
UIWidget* UITextEditor::CreateCopy(UIWidget *Parent, const QString &Newname) { bool isnew = !Newname.isEmpty(); UITextEditor* text = new UITextEditor(m_rootParent, Parent, isnew ? Newname : GetDerivedWidgetName(Parent->objectName()), (!isnew && IsTemplate()) ? WidgetFlagTemplate : WidgetFlagNone); text->CopyFrom(this); return text; }
void AKUIInterface::OnScreenResolutionChange( const FVector2D& v2OldRes, const FVector2D& v2NewRes ) { v2ScreenResolution = v2NewRes; KUIBroadcastEvent( FKUIInterfaceContainerScreenResolutionEvent, EKUIInterfaceContainerEventList::E_ScreenResolutionChange, v2OldRes, v2NewRes ); if ( !IsTemplate() ) OnScreenResolutionChangeBP( v2OldRes, v2NewRes ); }
UJavascriptEditorTick::UJavascriptEditorTick(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { #if WITH_EDITOR if (!IsTemplate(RF_ClassDefaultObject)) { Tickable = new FJavascriptEditorTick(this); } #endif }
void UWorldComposition::PostInitProperties() { Super::PostInitProperties(); if (!IsTemplate() && !GetOutermost()->HasAnyPackageFlags(PKG_PlayInEditor)) { // Tiles information is not serialized to disk, and should be regenerated on world composition object construction Rescan(); } }
void USkeleton::PostInitProperties() { Super::PostInitProperties(); // this gets called after constructor, and this data can get // serialized back if this already has Guid if (!IsTemplate()) { RegenerateGuid(); } }