当前位置: 首页>>代码示例>>C++>>正文


C++ UMovieScene::GetPossessable方法代码示例

本文整理汇总了C++中UMovieScene::GetPossessable方法的典型用法代码示例。如果您正苦于以下问题:C++ UMovieScene::GetPossessable方法的具体用法?C++ UMovieScene::GetPossessable怎么用?C++ UMovieScene::GetPossessable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UMovieScene的用法示例。


在下文中一共展示了UMovieScene::GetPossessable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PinSubCategory

void UK2Node_PlayMovieScene::CreatePinForBoundObject( FMovieSceneBoundObject& BoundObject )
{
	const UEdGraphSchema_K2* K2Schema = GetDefault<UEdGraphSchema_K2>();

	// We use the GUID as the pin name as this uniquely identifies it
	const FString PinName = BoundObject.GetPossessableGuid().ToString( EGuidFormats::DigitsWithHyphens );

	// For the friendly name, we use the possessable name from the MovieScene asset that is associated with this node
	FText PinFriendlyName = FText::FromString(PinName);
	{
		UMovieScene* MovieScene = GetMovieScene();
		if( MovieScene != NULL )		// @todo sequencer: Need to refresh the PinFriendlyName if the MovieScene asset changes, or if the possessable slot is renamed within Sequencer
		{
			for( auto PossessableIndex = 0; PossessableIndex < MovieScene->GetPossessableCount(); ++PossessableIndex )
			{
				auto& Possessable = MovieScene->GetPossessable( PossessableIndex );
				if( Possessable.GetGuid() == BoundObject.GetPossessableGuid() )
				{
					// Found a name for this possessable
					PinFriendlyName = FText::FromString(Possessable.GetName());
					break;
				}
			}
		}
	}

	const FString PinSubCategory(TEXT(""));
	UObject* PinSubCategoryObject = AActor::StaticClass();
	const bool bIsArray = false;
	const bool bIsReference = false;
	UEdGraphPin* NewPin = CreatePin( EGPD_Input, K2Schema->PC_Object, PinSubCategory, PinSubCategoryObject, bIsArray, bIsReference, PinName );
	check( NewPin != NULL );

	// Set the friendly name for this pin
	NewPin->PinFriendlyName = PinFriendlyName;

	// Place a literal for the bound object and hook it up to the pin
	// @todo sequencer: Should we instead set the default on the pin to the object instead?
	const TArray< UObject* >& Objects = BoundObject.GetObjects();
	if( Objects.Num() > 0 )
	{
		for( auto ObjectIter( Objects.CreateConstIterator() ); ObjectIter; ++ObjectIter )
		{
			auto* Object = *ObjectIter;
			if( ensure( Object != NULL ) )
			{
				// Check to see if we have a literal for this object already
				UK2Node_Literal* LiteralNode = NULL;
				{
					TArray< UK2Node_Literal* > LiteralNodes;
					GetGraph()->GetNodesOfClass( LiteralNodes );
					for( auto NodeIt( LiteralNodes.CreateConstIterator() ); NodeIt; ++NodeIt )
					{
						const auto CurLiteralNode = *NodeIt;

						if( CurLiteralNode->GetObjectRef() == Object )
						{
							// Found one!
							LiteralNode = CurLiteralNode;
							break;
						}
					}
				}

				if( LiteralNode == NULL )
				{
					// No literal for this object yet, so we'll make one now.
					UK2Node_Literal* LiteralNodeTemplate = NewObject<UK2Node_Literal>();
					LiteralNodeTemplate->SetObjectRef( Object );

					// Figure out a decent place to stick the node
					// @todo sequencer: The placement of these is really unacceptable.  We should setup new logic specific for moviescene pin objects.
					const FVector2D NewNodePos = GetGraph()->GetGoodPlaceForNewNode();
					LiteralNode = FEdGraphSchemaAction_K2NewNode::SpawnNodeFromTemplate<UK2Node_Literal>(GetGraph(), LiteralNodeTemplate, NewNodePos);
				}

				// Hook up the object reference literal to our pin
				LiteralNode->GetValuePin()->MakeLinkTo( NewPin );
			}
		}
	}
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:82,代码来源:K2Node_PlayMovieScene.cpp


注:本文中的UMovieScene::GetPossessable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。