Example #1
0
UEdGraphPin* UEdGraphNode::CreatePin(EEdGraphPinDirection Dir, const FEdGraphPinType& InPinType, const FString& PinName, int32 Index /*= INDEX_NONE*/)
{
	UEdGraphPin* NewPin = NewObject<UEdGraphPin>(this);
	NewPin->PinName = PinName;
	NewPin->Direction = Dir;

	NewPin->PinType = InPinType;

	NewPin->SetFlags(RF_Transactional);

	if (HasAnyFlags(RF_Transient))
	{
		NewPin->SetFlags(RF_Transient);
	}

	Modify(false);
	if (Pins.IsValidIndex(Index))
	{
		Pins.Insert(NewPin, Index);
	}
	else
	{
		Pins.Add(NewPin);
	}
	return NewPin;
}
void UMovieSceneShotSection::SetShotNameAndNumber(const FText& InDisplayName, int32 InShotNumber)
{
	Modify();

	DisplayName = InDisplayName;
	ShotNumber = InShotNumber;
}
Example #3
0
void UEdGraphPin::MakeLinkTo(UEdGraphPin* ToPin)
{
	Modify();

	if (ToPin != NULL)
	{
		ToPin->Modify();

		// Make sure we don't already link to it
		if (!LinkedTo.Contains(ToPin))
		{
			UEdGraphNode* MyNode = GetOwningNode();

			// Check that the other pin does not link to us
			ensureMsg(!ToPin->LinkedTo.Contains(this), *GetLinkInfoString( LOCTEXT("MakeLinkTo", "MakeLinkTo").ToString(), LOCTEXT("IsLinked", "is linked with pin").ToString(), ToPin));			    
			ensureMsg(MyNode->GetOuter() == ToPin->GetOwningNode()->GetOuter(), *GetLinkInfoString( LOCTEXT("MakeLinkTo", "MakeLinkTo").ToString(), LOCTEXT("OuterMismatch", "has a different outer than pin").ToString(), ToPin)); // Ensure both pins belong to the same graph

			// Add to both lists
			LinkedTo.Add(ToPin);
			ToPin->LinkedTo.Add(this);

			GraphPinHelpers::EnableAllConnectedNodes(MyNode);
			GraphPinHelpers::EnableAllConnectedNodes(ToPin->GetOwningNode());
		}
	}
}
Example #4
0
bool UMovieScene::RemoveSpawnable( const FGuid& Guid )
{
	bool bAnythingRemoved = false;
	if( ensure( Guid.IsValid() ) )
	{
		for( auto SpawnableIter( Spawnables.CreateIterator() ); SpawnableIter; ++SpawnableIter )
		{
			auto& CurSpawnable = *SpawnableIter;
			if( CurSpawnable.GetGuid() == Guid )
			{
				Modify();

				{
					UClass* GeneratedClass = CurSpawnable.GetClass();
					UBlueprint* Blueprint = GeneratedClass ? Cast<UBlueprint>(GeneratedClass->ClassGeneratedBy) : nullptr;
					check(nullptr != Blueprint);
					// @todo sequencer: Also remove created Blueprint inner object.  Is this sufficient?  Needs to work with Undo too!
					Blueprint->ClearFlags( RF_Standalone );	// @todo sequencer: Probably not needed for Blueprint
					Blueprint->MarkPendingKill();
				}

				RemoveBinding( Guid );

				// Found it!
				Spawnables.RemoveAt( SpawnableIter.GetIndex() );


				bAnythingRemoved = true;
				break;
			}
		}
	}

	return bAnythingRemoved;
}
Example #5
0
void Beam::AddLayerElement(LayerElement *element)
{

    element->SetParent( this );
    m_children.push_back(element);
    Modify();
}
void UAnimGraphNode_BlendListByEnum::RemovePinFromBlendList(UEdGraphPin* Pin)
{
	int32 RawArrayIndex = 0;
	bool bIsPosePin = false;
	bool bIsTimePin = false;
	GetPinInformation(Pin->PinName, /*out*/ RawArrayIndex, /*out*/ bIsPosePin, /*out*/ bIsTimePin);

	const int32 ExposedEnumIndex = (bIsPosePin || bIsTimePin) ? (RawArrayIndex - 1) : INDEX_NONE;

	if (ExposedEnumIndex != INDEX_NONE)
	{
		FScopedTransaction Transaction( LOCTEXT("RemovePin", "RemovePin") );
		Modify();

		// Record it as no longer exposed
		VisibleEnumEntries.RemoveAt(ExposedEnumIndex);

		// Remove the pose from the node
		UProperty* AssociatedProperty;
		int32 ArrayIndex;
		GetPinAssociatedProperty(GetFNodeType(), Pin, /*out*/ AssociatedProperty, /*out*/ ArrayIndex);

		ensure(ArrayIndex == (ExposedEnumIndex + 1));

		// setting up removed pins info 
		RemovedPinArrayIndex = ArrayIndex;
		Node.RemovePose(ArrayIndex);
		ReconstructNode();
		//@TODO: Just want to invalidate the visual representation currently
		FBlueprintEditorUtils::MarkBlueprintAsStructurallyModified(GetBlueprint());
	}
}
Example #7
0
void main()
{
 ABList L;
 printf("nnttWelcom to the information management system!nttt Copyright. Huang Wenbo,2010.n");
 InitList_AB(L);
    load(L);
    system("color 18");
 int flag=1;
 while(flag)
 {
  
  switch(menu())
  {
  case 1:CreatABList(L);break;
  case 2:Increase(L);break;
  case 3:del(L);break;
  case 4:Modify(L);break;
  case 5:search(L);break;
  case 6:save(L);break;
  case 7:destroy(L);break;
  case 8:system("cls");break;
  case 9:flag = 0;printf("ttt欢迎下次使用! nttCopyright.Huang Wenbo,2010.n");
  }
 }
 
}
Example #8
0
void Measure::AddChild(Object *child)
{
    if (child->IsControlElement()) {
        assert(dynamic_cast<ControlElement *>(child));
    }
    else if (child->IsEditorialElement()) {
        assert(dynamic_cast<EditorialElement *>(child));
    }
    else if (child->Is(STAFF)) {
        Staff *staff = dynamic_cast<Staff *>(child);
        assert(staff);
        if (staff && (staff->GetN() < 1)) {
            // This is not 100% safe if we have a <app> and <rdg> with more than
            // one staff as a previous child.
            staff->SetN(this->GetChildCount());
        }
    }
    else {
        LogError("Adding '%s' to a '%s'", child->GetClassName().c_str(), this->GetClassName().c_str());
        assert(false);
    }

    child->SetParent(this);
    m_children.push_back(child);
    Modify();
}
Example #9
0
bool UMovieScene::ReplacePossessable( const FGuid& OldGuid, const FGuid& NewGuid, const FString& NewName )
{
	bool bAnythingReplaced = false;

	for( auto PossessableIter( Possessables.CreateIterator() ); PossessableIter; ++PossessableIter )
	{
		auto& CurPossessable = *PossessableIter;

		if( CurPossessable.GetGuid() == OldGuid )
		{	
			Modify();

			// Found it!
			CurPossessable.SetGuid(NewGuid);
			CurPossessable.SetName(NewName);

			ReplaceBinding( OldGuid, NewGuid, NewName );

			bAnythingReplaced = true;
			break;
		}
	}

	return bAnythingReplaced;
}
Example #10
0
void AGroupActor::Add(AActor& InActor)
{	
	// See if the incoming actor already belongs to a group
	AGroupActor* InActorParent = AGroupActor::GetParentForActor(&InActor);
	if(InActorParent) // If so, detach it first
	{
		if(InActorParent == this)
		{
			return;
		}
		InActorParent->Modify();
		InActorParent->Remove(InActor);
	}
	
	Modify();
	AGroupActor* InGroupPtr = Cast<AGroupActor>(&InActor);
	if(InGroupPtr)
	{
		check(InGroupPtr != this);
		SubGroups.AddUnique(InGroupPtr);
	}
	else
	{
		GroupActors.AddUnique(&InActor);
		InActor.Modify();
		InActor.GroupActor = this;
	}
}
void UEnvironmentQueryGraph::UpdateVersion()
{
	if (GraphVersion == EQSGraphVersion::Latest)
	{
		return;
	}

	// convert to nested nodes
	if (GraphVersion < EQSGraphVersion::NestedNodes)
	{
		UpdateVersion_NestedNodes();
	}

	if (GraphVersion < EQSGraphVersion::CopyPasteOutersBug)
	{
		UpdateVersion_FixupOuters();
	}

	if (GraphVersion < EQSGraphVersion::BlueprintClasses)
	{
		UpdateVersion_CollectClassData();
	}

	GraphVersion = EQSGraphVersion::Latest;
	Modify();
}
Example #12
0
void ScoreDef::AddStaffGrp( StaffGrp *staffGrp )
{
    assert( m_children.empty() );
	staffGrp->SetParent( this );
	m_children.push_back( staffGrp );
    Modify();
}
Example #13
0
/*!
 * \brief Set value of a string item.
 */
bool CNutConfDoc::SetValue(CConfigItem & item, const wxString & strValue)
{
    if (item.m_option) {
        char *newval = strdup(strValue.mb_str());

        /* Check if edited value changed. */
        if (item.m_option->nco_value == NULL || strcmp(item.m_option->nco_value, newval)) {
            /* Remove any previously edited value. */
            if (item.m_option->nco_value) {
                free(item.m_option->nco_value);
                item.m_option->nco_value = NULL;
            }
            /* Check if new value differs from configured value. */
            char *cfgval = GetConfigValue(m_repository, item.m_option->nco_name);
            if ((cfgval == NULL && *newval) || (cfgval && strcmp(cfgval, newval))) {
                item.m_option->nco_value = newval;
                item.m_option->nco_active = 1;
                Modify(true);
            } else {
                free(newval);
            }
            if (cfgval) {
                free(cfgval);
            }
            CNutConfHint hint(&item, nutValueChanged);
            UpdateAllViews(NULL, &hint);
        } else {
            free(newval);
        }
    }
    return true;
}
void UStaticMeshComponent::InvalidateLightingCacheDetailed(bool bInvalidateBuildEnqueuedLighting, bool bTranslationOnly)
{
	if(bHasCachedStaticLighting)
	{
		// Save the static mesh state for transactions, force it to be marked dirty if we are going to discard any static lighting data.
		Modify(true);

		// Detach the component from the scene for the duration of this function.
		FComponentReregisterContext ReregisterContext(this);

		// Block until the RT processes the unregister before modifying variables that it may need to access
		FlushRenderingCommands();

		Super::InvalidateLightingCacheDetailed(bInvalidateBuildEnqueuedLighting, bTranslationOnly);

		// Discard all cached lighting.
		check(AttachmentCounter.GetValue() == 0);
		IrrelevantLights.Empty();
		for(int32 i = 0; i < LODData.Num(); i++)
		{
			FStaticMeshComponentLODInfo& LODDataElement = LODData[i];
			LODDataElement.LightMap = NULL;
			LODDataElement.ShadowMap = NULL;
		}
	}
	
	if (bInvalidateBuildEnqueuedLighting)
	{
		bStaticLightingBuildEnqueued = false;
	}
}
Example #15
0
void UDataTable::CleanBeforeStructChange()
{
    RowsSerializedWithTags.Reset();
    TemporarilyReferencedObjects.Empty();
    {
        class FRawStructWriter : public FObjectWriter
        {
            TSet<UObject*>& TemporarilyReferencedObjects;
        public:
            FRawStructWriter(TArray<uint8>& InBytes, TSet<UObject*>& InTemporarilyReferencedObjects)
                : FObjectWriter(InBytes), TemporarilyReferencedObjects(InTemporarilyReferencedObjects) {}
            virtual FArchive& operator<<(class UObject*& Res) override
            {
                FObjectWriter::operator<<(Res);
                TemporarilyReferencedObjects.Add(Res);
                return *this;
            }
        };

        FRawStructWriter MemoryWriter(RowsSerializedWithTags, TemporarilyReferencedObjects);
        SaveStructData(MemoryWriter);
    }
    EmptyTable();
    Modify();
}
void USimpleConstructionScript::RemoveNode(USCS_Node* Node)
{
	// If it's a root node we are removing, clear it from the list
	if(RootNodes.Contains(Node))
	{
		Modify();

		RootNodes.Remove(Node);

		Node->Modify();

		Node->bIsParentComponentNative = false;
		Node->ParentComponentOrVariableName = NAME_None;
		Node->ParentComponentOwnerClassName = NAME_None;

		ValidateSceneRootNodes();
	}
	// Not the root, so iterate over all nodes looking for the one with us in its ChildNodes array
	else
	{
		USCS_Node* ParentNode = FindParentNode(Node);
		if(ParentNode != NULL)
		{
			ParentNode->Modify();

			ParentNode->ChildNodes.Remove(Node);
		}
	}
}
Example #17
0
void StaffGrp::AddChild(Object *child)
{
    if (child->Is(INSTRDEF)) {
        assert(dynamic_cast<InstrDef *>(child));
    }
    else if (child->Is(LABEL)) {
        assert(dynamic_cast<Label *>(child));
    }
    else if (child->Is(LABELABBR)) {
        assert(dynamic_cast<LabelAbbr *>(child));
    }
    else if (child->Is(STAFFDEF)) {
        assert(dynamic_cast<StaffDef *>(child));
    }
    else if (child->Is(STAFFGRP)) {
        assert(dynamic_cast<StaffGrp *>(child));
    }
    else if (child->IsEditorialElement()) {
        assert(dynamic_cast<EditorialElement *>(child));
    }
    else {
        LogError("Adding '%s' to a '%s'", child->GetClassName().c_str(), this->GetClassName().c_str());
        assert(false);
    }

    child->SetParent(this);
    m_children.push_back(child);
    Modify();
}
Example #18
0
int EBuffer::FoldCreate(int Line) { /*FOLD00*/
  int n;

  if (Modify() == 0) return 0;

  if (FindFold(Line) != -1) return 1;  // already exists

  if (BFI(this, BFI_Undo)) {
    if (PushULong(Line) == 0) return 0;

    if (PushUChar(ucFoldCreate) == 0) return 0;
  }

  n = FindNearFold(Line);
  n++;
  FF = (EFold *)realloc((void *)FF, sizeof(EFold) * ((1 + FCount) | 7));
  assert(FF != 0);
  memmove(FF + n + 1, FF + n, sizeof(EFold) * (FCount - n));
  FCount++;
  FF[n].line  = Line;
  FF[n].level = 0;
  FF[n].open  = 1;
  FF[n].flags = 0;
  Draw(Line, Line);
  return 1;
}
main() {
	int k, n, a, b;
	for(a = 0; a < 10002; a++)	LOW[a] = a & (-a);
	scanf("%d", &k);
	while(k--) {
		scanf("%d", &n);
		for(a = 0; a < n; a++)
			scanf("%d %d %d", &A[a].a, &A[a].b, &A[a].c), 
			B[a].a = A[a].b, B[a].b = A[a].a, B[a].c = A[a].c;
		MergeSort(0, n-1, A), MergeSort(0, n-1, B);
		int Pa, Pb, Pc, t, Ans = 0;
		for(a = 0; a < n; ) {
			Pa = A[a].a;
			while(a < n && A[a].a <= Pa)	a++;
			memset(C, 0, (10000-Pa+2)*4);
			for(b = 0; b < n && Pa+B[b].a <= 10000; ) {
				Pb = B[b].a, Pc = 10000-Pa-Pb+1;
				while(b < n && B[b].a <= Pb) {
					if(B[b].b <= Pa)	Modify(B[b].c+1, Pc);
					b++;
				}
				t = Operator(Pc);
				Ans = Ans > t ? Ans : t;
			}
		}
		printf("%d\n", Ans);
	}
	return 0;
}
void UAnimPreviewInstance::SetKeyImplementation(const FCompactPose& PreControllerInLocalSpace, const FCompactPose& PostControllerInLocalSpace)
{
#if WITH_EDITOR
	// evaluate the curve data first
	UAnimSequence* CurrentSequence = Cast<UAnimSequence>(CurrentAsset);
	UDebugSkelMeshComponent* Component = Cast<UDebugSkelMeshComponent> (GetSkelMeshComponent());

	if(CurrentSequence && CurrentSkeleton && Component && Component->SkeletalMesh)
	{
		FScopedTransaction ScopedTransaction(LOCTEXT("SetKey", "Set Key"));
		CurrentSequence->Modify(true);
		Modify();

		TArray<FName> BonesToModify;
		// need to get component transform first. Depending on when this gets called, the transform is not up-to-date. 
		// first look at the bonecontrollers, and convert each bone controller to transform curve key
		// and add new curvebonecontrollers with additive data type
		// clear bone controller data
		for(auto& SingleBoneController : BoneControllers)
		{
			// find bone name, and just get transform of the bone in local space
			// and get the additive data
			// find if this already exists, then just add curve data only
			FName BoneName = SingleBoneController.BoneToModify.BoneName;
			// now convert data
			const FMeshPoseBoneIndex MeshBoneIndex(Component->GetBoneIndex(BoneName));
			const FCompactPoseBoneIndex BoneIndex = RequiredBones.MakeCompactPoseIndex(MeshBoneIndex);
			FTransform  LocalTransform = PostControllerInLocalSpace[BoneIndex];

			// now we have LocalTransform and get additive data
			FTransform AdditiveTransform = LocalTransform.GetRelativeTransform(PreControllerInLocalSpace[BoneIndex]);
			AddKeyToSequence(CurrentSequence, CurrentTime, BoneName, AdditiveTransform);

			BonesToModify.Add(BoneName);
		}

		// see if the bone is selected right now and if that is added - if bone is selected, we should add identity key to it. 
		if ( Component->BonesOfInterest.Num() > 0 )
		{
			// if they're selected, we should add to the modifyBone list even if they're not modified, so that they can key that point. 
			// first make sure those are added 
			// if not added, make sure to set the key for them
			for (const auto& BoneIndex : Component->BonesOfInterest)
			{
				FName BoneName = Component->GetBoneName(BoneIndex);
				// if it's not on BonesToModify, add identity here. 
				if (!BonesToModify.Contains(BoneName))
				{
					AddKeyToSequence(CurrentSequence, CurrentTime, BoneName, FTransform::Identity);
				}
			}
		}

		ResetModifiedBone(false);

		OnSetKeyCompleteDelegate.ExecuteIfBound();
	}
#endif
}
Example #21
0
TArray<FString> UCurveBase::CreateCurveFromCSVString(const FString& InString)
{
	// Array used to store problems about curve import
	TArray<FString> OutProblems;

	TArray<FRichCurveEditInfo> Curves = GetCurves();
	const int32 NumCurves = Curves.Num();

	const FCsvParser Parser(InString);
	const FCsvParser::FRows& Rows = Parser.GetRows();

	if(Rows.Num() == 0)
	{
		OutProblems.Add(FString(TEXT("No data.")));
		return OutProblems;
	}

	// First clear out old data.
	ResetCurve();

	// Each row represents a point
	for(int32 RowIdx=0; RowIdx<Rows.Num(); RowIdx++)
	{
		const TArray<const TCHAR*>& Cells = Rows[RowIdx];
		const int32 NumCells = Cells.Num();

		// Need at least two cell, Time and one Value
		if(NumCells < 2)
		{
			OutProblems.Add(FString::Printf(TEXT("Row '%d' has less than 2 cells."), RowIdx));
			continue;
		}

		float Time = FCString::Atof(Cells[0]);
		for(int32 CellIdx=1; CellIdx<NumCells && CellIdx<(NumCurves+1); CellIdx++)
		{
			FRichCurve* Curve = Curves[CellIdx-1].CurveToEdit;
			if(Curve != NULL)
			{
				FKeyHandle KeyHandle = Curve->AddKey(Time, FCString::Atof(Cells[CellIdx]));
				Curve->SetKeyInterpMode(KeyHandle, RCIM_Linear);
			}
		}

		// If we get more cells than curves (+1 for time cell)
		if(NumCells > (NumCurves + 1))
		{
			OutProblems.Add(FString::Printf(TEXT("Row '%d' has too many cells for the curve(s)."), RowIdx));
		}
		// If we got too few cells
		else if(NumCells < (NumCurves + 1))
		{
			OutProblems.Add(FString::Printf(TEXT("Row '%d' has too few cells for the curve(s)."), RowIdx));
		}
	}

	Modify(true);
	return OutProblems;
}
Example #22
0
void Walker::Rainy()
{
    
       Modify(12,3,1);
    
    
    
}
Example #23
0
void Walker::Cloudy()
{
    
        Modify(12,-1,2);
    
   
    
}
Example #24
0
class UMovieSceneTrack* UMovieScene::AddMasterTrack( TSubclassOf<UMovieSceneTrack> TrackClass )
{
	UMovieSceneTrack* CreatedType = ConstructObject<UMovieSceneTrack>( TrackClass, this, NAME_None, RF_Transactional );
	Modify();
	MasterTracks.Add( CreatedType );
	
	return CreatedType;
}
/*--------------------------------------------------------------------------------*/
AudioObjectParameters& AudioObjectParameters::Modify(const Modifier::LIST& list, const ADMAudioObject *object)
{
  uint_t i;

  for (i = 0; i < list.size(); i++) Modify(*list[i].Obj(), object);

  return *this;
}
Example #26
0
void UMovieSceneSection::AddKeyToCurve( FRichCurve& InCurve, float Time, float Value )
{
	if(IsTimeWithinSection(Time))
	{
		Modify();
		InCurve.UpdateOrAddKey(Time, Value);
	}
}
void UMaterialGraph::RebuildGraph()
{
	check(Material);

	Modify();

	RemoveAllNodes();

	if (!MaterialFunction)
	{
		// Initialize the material input list.
		MaterialInputs.Add( FMaterialInputInfo( GetBaseColorPinName(), MP_BaseColor, LOCTEXT( "BaseColorToolTip", "Defines the overall color of the Material. Each channel is automatically clamped between 0 and 1" ) ) );
		MaterialInputs.Add( FMaterialInputInfo( GetMetallicPinName(), MP_Metallic, LOCTEXT( "MetallicToolTip", "Controls how \"metal-like\" your surface looks like") ) );
		MaterialInputs.Add( FMaterialInputInfo( LOCTEXT("Specular", "Specular"), MP_Specular, LOCTEXT("SpecularToolTip", "Used to scale the current amount of specularity on non-metallic surfaces and is a value between 0 and 1, default at 0.5") ) );
		MaterialInputs.Add( FMaterialInputInfo( LOCTEXT( "Roughness", "Roughness" ), MP_Roughness, LOCTEXT( "RoughnessToolTip", "Controls how rough the Material is. Roughness of 0 (smooth) is a mirror reflection and 1 (rough) is completely matte or diffuse" ) ) );
		MaterialInputs.Add( FMaterialInputInfo( GetEmissivePinName(), MP_EmissiveColor, LOCTEXT( "EmissiveToolTip", "Controls which parts of your Material will appear to glow" ) ) );
		MaterialInputs.Add( FMaterialInputInfo( LOCTEXT("Opacity", "Opacity"), MP_Opacity, LOCTEXT( "OpacityToolTip", "Controls the transluecency of the Material" ) ) );
		MaterialInputs.Add( FMaterialInputInfo( LOCTEXT("OpacityMask", "Opacity Mask"), MP_OpacityMask, LOCTEXT( "OpacityMaskToolTip", "When in Masked mode, a Material is either completely visible or completely invisible" ) ) );
		MaterialInputs.Add( FMaterialInputInfo( GetNormalPinName(), MP_Normal, LOCTEXT( "NormalToolTip", "Takes the input of a normal map" ) ) );
		MaterialInputs.Add( FMaterialInputInfo( GetWorldPositionOffsetPinName(), MP_WorldPositionOffset, LOCTEXT( "WorldPositionOffsetToolTip", "Allows for the vertices of a mesh to be manipulated in world space by the Material" ) ) );
		MaterialInputs.Add( FMaterialInputInfo( LOCTEXT( "WorldDisplacement", "World Displacement" ), MP_WorldDisplacement, LOCTEXT( "WorldDisplacementToolTip", "Allows for the tessellation vertices to be manipulated in world space by the Material" ) ) );
		MaterialInputs.Add( FMaterialInputInfo( LOCTEXT("TessellationMultiplier", "Tessellation Multiplier"), MP_TessellationMultiplier, LOCTEXT( "TessllationMultiplierToolTip", "Controls the amount tessellation along the surface" ) ) );
		MaterialInputs.Add( FMaterialInputInfo( GetSubsurfacePinName(), MP_SubsurfaceColor, LOCTEXT( "SubsurfaceToolTip", "Allows you to add a color to your Material to simulate shifts in color when light passes through the surface" ) ) );
		MaterialInputs.Add( FMaterialInputInfo( GetCustomDataPinName(0), MP_CustomData0, GetCustomDataPinName( 0 ) ) );
		MaterialInputs.Add( FMaterialInputInfo( GetCustomDataPinName(1), MP_CustomData1, GetCustomDataPinName( 1 ) ) );
		MaterialInputs.Add( FMaterialInputInfo( LOCTEXT("AmbientOcclusion", "Ambient Occlusion"), MP_AmbientOcclusion, LOCTEXT( "AmbientOcclusionToolTip", "Simulate the self-shadowing that happens within crevices of a surface" ) ) );
		MaterialInputs.Add( FMaterialInputInfo( LOCTEXT("Refraction", "Refraction"), MP_Refraction, LOCTEXT( "RefractionToolTip", "Takes in a texture or value that simulates the index of refraction of the surface" ) ) );

		for (int32 UVIndex = 0; UVIndex < ARRAY_COUNT(Material->CustomizedUVs); UVIndex++)
		{
			//@todo - localize
			MaterialInputs.Add( FMaterialInputInfo( FText::FromString(FString::Printf(TEXT("Customized UV%u"), UVIndex)), (EMaterialProperty)(MP_CustomizedUVs0 + UVIndex), FText::FromString(FString::Printf( TEXT( "CustomizedUV%uToolTip" ), UVIndex ) ) ) );
		}

		MaterialInputs.Add(FMaterialInputInfo(LOCTEXT("PixelDepthOffset", "Pixel Depth Offset"), MP_PixelDepthOffset, LOCTEXT( "PixelDepthOffsetToolTip", "Pixel Depth Offset" ) ));

		//^^^ New material properties go above here. ^^^^
		MaterialInputs.Add(FMaterialInputInfo(LOCTEXT("MaterialAttributes", "Material Attributes"), MP_MaterialAttributes, LOCTEXT( "MaterialAttributesToolTip", "Material Attributes" ) ));

		// Add Root Node
		FGraphNodeCreator<UMaterialGraphNode_Root> NodeCreator(*this);
		RootNode = NodeCreator.CreateNode();
		RootNode->Material = Material;
		NodeCreator.Finalize();
	}

	for (int32 Index = 0; Index < Material->Expressions.Num(); Index++)
	{
		AddExpression(Material->Expressions[Index]);
	}

	for (int32 Index = 0; Index < Material->EditorComments.Num(); Index++)
	{
		AddComment(Material->EditorComments[Index]);
	}

	LinkGraphNodesFromMaterial();
}
Example #28
0
void USkeleton::SetPreviewMesh(USkeletalMesh* PreviewMesh, bool bMarkAsDirty/*=true*/)
{
	if (bMarkAsDirty)
	{
		Modify();
	}

	PreviewSkeletalMesh = PreviewMesh;
}
void UEdGraphPin::CopyPersistentDataFromOldPin(const UEdGraphPin& SourcePin)
{
	// The name matches already, doesn't get copied here
	// The PinType, Direction, and bNotConnectable are properties generated from the schema

	// Only move the default value if it was modified; inherit the new default value otherwise
	if (SourcePin.DefaultValue != SourcePin.AutogeneratedDefaultValue || SourcePin.DefaultObject != NULL || SourcePin.DefaultTextValue.ToString() != SourcePin.AutogeneratedDefaultValue)
	{
		DefaultObject = SourcePin.DefaultObject;
		DefaultValue = SourcePin.DefaultValue;
		DefaultTextValue = SourcePin.DefaultTextValue;
	}

	// Copy the links
	for (int32 LinkIndex = 0; LinkIndex < SourcePin.LinkedTo.Num(); ++LinkIndex)
	{
		UEdGraphPin* OtherPin = SourcePin.LinkedTo[LinkIndex];
		check(NULL != OtherPin);

		Modify();
		OtherPin->Modify();

		LinkedTo.Add(OtherPin);

		// Unlike MakeLinkTo(), we attempt to ensure that the new pin (this) is inserted at the same position as the old pin (source)
		// in the OtherPin's LinkedTo array. This is necessary to ensure that the node's position in the execution order will remain
		// unchanged after nodes are reconstructed, because OtherPin may be connected to more than just this node.
		int32 Index = OtherPin->LinkedTo.Find(const_cast<UEdGraphPin*>(&SourcePin));
		if(Index != INDEX_NONE)
		{
			OtherPin->LinkedTo.Insert(this, Index);
		}
		else
		{
			// Fallback to "normal" add, just in case the old pin doesn't exist in the other pin's LinkedTo array for some reason.
			OtherPin->LinkedTo.Add(this);
		}
	}

	// If the source pin is split, then split the new one, but don't split multiple times, typically splitting is done
	// by UK2Node::ReallocatePinsDuringReconstruction or FBlueprintEditor::OnSplitStructPin, but there are several code
	// paths into this, and split state should be persistent:
	if (SourcePin.SubPins.Num() > 0 && SubPins.Num() == 0)
	{
		GetSchema()->SplitPin(this);
	}

#if WITH_EDITORONLY_DATA
	// Copy advanced visibility property, if it can be changed by user.
	// Otherwise we don't want to copy this, or we'd be ignoring new metadata that tries to hide old pins.
	UEdGraphNode* OuterNode = Cast<UEdGraphNode>(GetOuter());
	if (OuterNode != nullptr && OuterNode->CanUserEditPinAdvancedViewFlag())
	{
		bAdvancedView = SourcePin.bAdvancedView;
	}
#endif // WITH_EDITORONLY_DATA
}
Example #30
0
void BTrem::AddLayerElement(LayerElement *element)
{
    assert(dynamic_cast<Note*>(element)
           || dynamic_cast<Chord*>(element)
           || dynamic_cast<EditorialElement*>(element) );
    element->SetParent( this );
    m_children.push_back(element);
    Modify();
}