Announcement

Collapse
No announcement yet.

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

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Rama - you probably want to add a call to GetIsVisible (which is being renamed to IsInViewport in 4.6), to limit returned widgets to only the top level viewport widgets, otherwise you'll get all the nested ones too.

    Comment


      Originally posted by NickDarnell View Post
      Rama - you probably want to add a call to GetIsVisible (which is being renamed to IsInViewport in 4.6), to limit returned widgets to only the top level viewport widgets, otherwise you'll get all the nested ones too.
      Great idea Nick, thanks for the info!

      I will add a bool option to only retrieve top level widgets.

      I actually intended that my node have the power to iterate over internal widgets in case that was something the BP user wanted to do deliberately

      But having an optional top level filter is a great idea!

      ~~~

      UMG, Get All Widgets Of Class

      Updated!



      Now you have an optional bool filter to only return widgets that are at the top level, see Nick Darnell's comment for more information

      ~~~

      My C++ Code For this Node

      Code:
      void UVictoryBPFunctionLibrary::GetAllWidgetsOfClass(UObject* WorldContextObject, TSubclassOf<UUserWidget> WidgetClass, TArray<UUserWidget*>& FoundWidgets,bool TopLevelOnly)
      {
      	//Prevent possibility of an ever-growing array if user uses this 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->GetWorld() != 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 all internal widgets
      			FoundWidgets.Add(*Itr);
      		}
      	}
      }
      ~~~

      Pic

      Click image for larger version

Name:	GetAllWidgetsOfClass2.jpg
Views:	2
Size:	136.9 KB
ID:	1060474


      Rama
      Last edited by Rama; 11-01-2014, 06:30 PM.
      100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

      UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

      Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

      Comment


        Rama , really need that you become a Epic developer and do it in the official release
        I would be not suprised

        Comment


          Hi Rama,

          Does your "Get Static Mesh Vertex Locations" node gather vertex information for skeletal meshes? I noticed my scene doesn't work with meshes with morph targets. For example, I have a blanket that has a morph target (before & after burning). I am unable to propagate fire on that. Vertex highlights do not appear over that morph target mesh while appearing on other normal static meshes. Is there a work around this?

          Thanks,
          CatchPhyre

          Comment


            Originally posted by CatchPhyre View Post
            Hi Rama,

            Does your "Get Static Mesh Vertex Locations" node gather vertex information for skeletal meshes? I noticed my scene doesn't work with meshes with morph targets. For example, I have a blanket that has a morph target (before & after burning). I am unable to propagate fire on that. Vertex highlights do not appear over that morph target mesh while appearing on other normal static meshes. Is there a work around this?

            Thanks,
            CatchPhyre
            I have to make that node for skeletal mesh vertex access at some point, will let you know when I do

            Rama
            Last edited by Rama; 11-02-2014, 03:29 AM.
            100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

            UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

            Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

            Comment


              Originally posted by ChrisTm View Post
              Rama , really need that you become a Epic developer and do it in the official release
              I would be not suprised
              That's a great idea Chris!

              Get All Widgets of Class Pull Request To Epic

              I've submitted my Get All Widgets of Class node to Epic!

              Vote for Get All Widgets Of Class On Github!

              You can vote for it here!

              (you must be logged into your github to access this link)
              https://github.com/EpicGames/UnrealEngine/pull/569

              Rama
              100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

              UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

              Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

              Comment


                Rama, the get all supported screen resolution node is a highly useful one as well that'd be great to be part of the official release... and probably many others.

                Big thanks for sharing these!

                Comment


                  Originally posted by Rama View Post
                  I have to make that node for skeletal mesh vertex access at some point, will let you know when I do

                  Rama
                  Thanks Rama! Will await your update!

                  Comment


                    Originally posted by RumbleMonk View Post
                    Rama, the get all supported screen resolution node is a highly useful one as well that'd be great to be part of the official release... and probably many others.

                    Big thanks for sharing these!
                    ooh that's another great pull request idea, RumbleMonk! Do remind me if I've not done that in a week or two

                    Rama
                    100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                    UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                    Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                    Comment


                      Featured BP Nodes

                      Trace Data


                      I've designed several BP nodes to make doing traces easier!

                      Again you can download and use these nodes as a plugin, even in non-C++ project!

                      Get Trace Data From Skeletal Mesh Socket
                      Click image for larger version

Name:	traceforcharactermeshsocket.jpg
Views:	3
Size:	297.8 KB
ID:	1060549



                      Rama
                      100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                      UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                      Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                      Comment


                        Jeez Rama.. You're on fire And for sure, I'll remind ya!

                        Speaking of tracing - One of the things that's been bugging me lately is that if you don't want to use physics but still want interaction between actors you have to use overlaps (as event hits don't fire without physics). A shortcoming of that is you end up having to trace between the overlapping actors and as such will end up tracing between the pivot of the actors/components giving you inaccurate overlap point normals (not to mention no impact point).

                        If you ever come across that problem feel free to write a better overlapper that returns more data . I'm ok-ish with my current hacky solution, it's nasty and restrictive but works well enough. Sort of.

                        There's gold in dem here parts of the woods anyway. Good luck with Solus!

                        Comment


                          Originally posted by RumbleMonk View Post
                          (as event hits don't fire without physics). A shortcoming of that is you end up having to trace between the overlapping actors
                          Hi there!

                          I actually have had success getting hit events between characters and static mesh actors, using a custom static mesh actor class.

                          You have to cause an impact, by jumping and then falling, or bumping into the wall, but I can actually get the hit event to fire even without physics involved.

                          If character is just standing on the floor it wont fire hit events constantly though, you do have to jump and then land.

                          What is your actual use case for which you are finding non-physics hit events are not firing?

                          Rama
                          100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                          UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                          Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                          Comment


                            Click image for larger version

Name:	CreateObject.jpg
Views:	7
Size:	264.5 KB
ID:	1060630

                            ~~

                            2 New Nodes For You

                            Create UObject

                            Create Primitive Component, Added to Scene at Location!


                            These two nodes let you create UObjects at runtime!


                            Please note you absolutely must save off the return value to a variable or UE4 will Garbage Collect your new UObject within a short time!


                            Please especially note that if you create a Primitive Component, I actually add it to the world for you so it is visible and has collision!

                            ~~~

                            C++ Code For You

                            Here's the code!

                            Code:
                            UObject* UVictoryBPFunctionLibrary::CreateObject(UObject* WorldContextObject,UClass* TheObjectClass, FName Name)
                            {
                            	if(!TheObjectClass) return NULL;
                            	//~~~~~~~~~~~~~~~~~
                            	
                            	//using a context object to get the world!
                                UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject);
                            	if(!World) return NULL;
                            	//~~~~~~~~~~~
                            	 
                            	return StaticConstructObject( TheObjectClass, World, Name);
                            }
                            Code:
                            UPrimitiveComponent* UVictoryBPFunctionLibrary::CreatePrimitiveComponent(
                            	UObject* WorldContextObject, 
                            	TSubclassOf<UPrimitiveComponent> CompClass, 
                            	FName Name,
                            	FVector Location, 
                            	FRotator Rotation
                            ){
                            	if(!CompClass) return NULL;
                            	//~~~~~~~~~~~~~~~~~
                            	
                            	//using a context object to get the world!
                                UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject);
                            	if(!World) return NULL;
                            	//~~~~~~~~~~~
                            	 
                            	UPrimitiveComponent* NewComp = ConstructObject<UPrimitiveComponent>( CompClass, World, Name);
                            	if(!NewComp) return NULL;
                            	//~~~~~~~~~~~~~
                            	 
                            	NewComp->SetWorldLocation(Location);
                            	NewComp->SetWorldRotation(Rotation);
                            	NewComp->RegisterComponentWithWorld(World);
                            	
                            	return NewComp;
                            }


                            Rama
                            100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                            UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                            Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                            Comment


                              New Node

                              Get Static Mesh Vertex Locations!


                              Dear CatchPhyre,

                              As per your request I have now made a node to get the rotated,scaled,translated positions of all vertices of a static mesh!

                              This node is live in the current most recent plugin version!

                              https://wiki.unrealengine.com/File:VictoryPlugin.zip

                              Please refer carefully to my picture of how to set up this node correctly!

                              ~~~

                              Pictures

                              Click image for larger version

Name:	VertexPositions.jpg
Views:	15
Size:	176.5 KB
ID:	1060670

                              Click image for larger version

Name:	VertexPositions2.jpg
Views:	5
Size:	262.2 KB
ID:	1060671

                              Enjoy!

                              Rama

                              PS



                              You're welcome!

                              Congrats on your first post, welcome to the forums!

                              100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                              UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                              Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                              Comment


                                Hi Rama,

                                Thanks for the updated nodes. You did mention earlier about the challenges in returning vertex color information of vertices. Please bear with my ignorance ...Still new to a lot of things here. I have made a Master Material with lots of procedural controls to allow material transitioning. But they are not giving me the aesthetic appeal I am trying to achieve.

                                If you are able to gather vertex positions and transformation information, why do you suggest it is difficult to set & get vertex color information in runtime? You also mentioned dynamic vs static mesh. By making a static mesh "Moveable" doesn't it become dynamic? Also, in the Blueprint Communication content example, there is an Ice Sphere that will melt when player fires fireballs at it. Using World Position Offsets, the ice actually morphs away to little droplets. Isn't that modifying a static mesh dynamically at runtime?

                                I need to tie in Dynamic Material Instancing to dynamic vertex color info. I am trying to transition material from where I click on the mesh. So for example, if I click on a spot, I will set that vertex color as red and each closest vertex to it will turn red as the fire propagates. This will reveal the underlying material.

                                If you can clarify my doubts further, I would deeply appreciate it. I am not able to fully understand the technical difficulties here.

                                Thanks,
                                CatchPhyre

                                Comment

                                Working...
                                X