# (39) 's Extra Blueprint Nodes for You as a Plugin, No C++ Required!

**URL:** <https://forums.unrealengine.com/t/39-s-extra-blueprint-nodes-for-you-as-a-plugin-no-c-required/3448>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [April 29, 2014, 1:27am UTC](https://forums.unrealengine.com/t/39-s-extra-blueprint-nodes-for-you-as-a-plugin-no-c-required/3448 "2014-04-29T01:27:59Z")\
**Posts on this page:** 1\
**Showing post:** 414

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [November 14, 2014, 12:17am UTC](https://forums.unrealengine.com/t/39-s-extra-blueprint-nodes-for-you-as-a-plugin-no-c-required/3448/414 "2014-11-14T00:17:21Z")

</div>

\*\*UMG, Get Widgets Of Class

Updated!\*\*

\*\* node will be in a near future engine release! Epic accepted my github pull request!\*\*

You can start playing with it now though, as part of my plugin!

Now you have an optional bool filter to only return widgets that are at the top level, see [Darnell’s comment](https://forums.unrealengine.com/showthread.php?3851-(39)--s-Extra-Blueprint-Nodes-for-You-as-a-Plugin-No-C-Required!&p=172889&viewfull=1#post172889) for more information

````auto

**My C++ Code For Node**

```

void UVictoryBPFunctionLibrary::GetAllWidgetsOfClass(UObject* WorldContextObject, TSubclassOf<UUserWidget> WidgetClass, TArray<UUserWidget*>& FoundWidgets,bool TopLevelOnly)
{
	//Prevent possibility of an ever-growing array if user uses in a loop
	FoundWidgets.Empty();
	// ~~~~~~~~~~~~
	 
	if(!WidgetClass) return;
	if(!WorldContextObject) return;
	 
	UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject);
	if(!World) return;
	// ~~~~~~~~~~~
	
	for(TObjectIterator<UUserWidget> Itr; Itr; ++Itr)
	{
		if(Itr->() != World) continue;
		// ~~~~~~~~~~~~~~~~~~~~~
		
		if( ! Itr->IsA(WidgetClass)) continue;
		// ~~~~~~~~~~~~~~~~~~~
		 
		//Top Level?
		if(TopLevelOnly)
		{
			//only add top level widgets
			if(Itr->GetIsVisible()) //IsInViewport in 4.6
			{
				FoundWidgets.Add(*Itr);
			}
		}
		else
		{
			//add internal widgets
			FoundWidgets.Add(*Itr);
		}
	}
}

```

````

Pic

 ![GetAllWidgetsOfClass.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/8/c/8c8f3de7d4fe41068d7aa8db3da31224ff4682f1.jpeg)

 ![71009bd806383a480cc409a36e116fe857cc7fd1.jpeg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/0/71009bd806383a480cc409a36e116fe857cc7fd1.jpeg)

❤

---

_[View the full topic](https://forums.unrealengine.com/t/39-s-extra-blueprint-nodes-for-you-as-a-plugin-no-c-required/3448)._
