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

    Hi all!
    Rama thank you for that great plugin!
    I have a question. How to unload the textures loaded by the function "LoadTexture2D_FromFileByExtension" ?

    Comment


      Originally posted by Rama View Post
      New Node: Load Texture 2D From File!

      JPG, PNG, BMP, ICO, EXR, and ICNS are Supported File Formats !


      With this node you can load a Texture 2D from a file during runtime!

      I output for you the width and height of the loaded image!

      Now you can easily create Texture 2D's from image files in Blueprints, during runtime!

      Enjoy!

      Rama

      PS: Make sure to include the file extension when you use this node!

      [ATTACH=CONFIG]23283[/ATTACH]

      [ATTACH=CONFIG]23284[/ATTACH]

      ~~~

      C++ Code For You

      Here is the core C++ function involved, entire source is in the download! I wrote my own Enum for the file formats.

      Code:
      UTexture2D* UVictoryBPFunctionLibrary::Victory_LoadTexture2D_FromFile(const FString& FullFilePath,EJoyImageFormats ImageFormat, bool& IsValid,int32& Width, int32& Height)
      {
      IsValid = false;
      UTexture2D* LoadedT2D = NULL;
      
      IImageWrapperModule& ImageWrapperModule = FModuleManager::LoadModuleChecked<IImageWrapperModule>(FName("ImageWrapper"));
      
      IImageWrapperPtr ImageWrapper = ImageWrapperModule.CreateImageWrapper(GetJoyImageFormat(ImageFormat));
      
      //Load From File
      TArray<uint8> RawFileData;
      if (!FFileHelper::LoadFileToArray(RawFileData, * FullFilePath))
      {
      return NULL;
      }
      
      
      //Create T2D!
      if (ImageWrapper.IsValid() && ImageWrapper->SetCompressed(RawFileData.GetData(), RawFileData.Num()))
      {
      const TArray<uint8>* UncompressedBGRA = NULL;
      if (ImageWrapper->GetRaw(ERGBFormat::BGRA, 8, UncompressedBGRA))
      {
      LoadedT2D = UTexture2D::CreateTransient(ImageWrapper->GetWidth(), ImageWrapper->GetHeight(), PF_B8G8R8A8);
      
      //Valid?
      if (!LoadedT2D)
      {
      return NULL;
      }
      
      //Out!
      Width = ImageWrapper->GetWidth();
      Height = ImageWrapper->GetHeight();
      
      //Copy!
      void* TextureData = LoadedT2D->PlatformData->Mips[0].BulkData.Lock(LOCK_READ_WRITE);
      FMemory::Memcpy(TextureData, UncompressedBGRA->GetData(), UncompressedBGRA->Num());
      LoadedT2D->PlatformData->Mips[0].BulkData.Unlock();
      
      //Update!
      LoadedT2D->UpdateResource();
      }
      }
      
      // Success!
      IsValid = true;
      return LoadedT2D;
      }
      ~~~

      Download Link (6.5mb)

      UE4 Wiki, Plugin Download Page
      https://wiki.unrealengine.com/File:VictoryPlugin.zip
      Hey Rama, I heard a lot about you
      Thanks for the stuff you are creating for the community!
      Is there a way to choose the texture from an open-file-dialog? I want enable users to use their custom images
      Last edited by Vodka Industries; 04-25-2018, 12:44 AM.

      Comment


        pls help. i don't understand how to convert into Instanced Static Mesh by pressing "i" my own mesh. meshes by RAMA are convert but my dont convert. UE4.16

        Comment


          Originally posted by Kris View Post

          Or, more specifically, if the IGenericTeamAgentInterface part of it :P

          For those who aren't sure what that is, it is the interface that AIController uses by default to determine the controllers 'team'.
          By implementing the same interface on other classes (e.g. a custom player controller), you allow AI to quickly determine if another class/actor is considered hostile or not.

          It can also be used to make team specific doors, items, vehicles etc.

          UT4 uses a similar interface for its team handling.
          I am attempting to work with this right now. I added the interface to two actors, set the teams to 1 and 2 with set Generic Team ID, and I have ai perception and stimulus set up. If I set the ai perception to find enemies, neutrals, and friendlies my actor is found. If it is set to just enemies the actor is not found. Am I missing a step?

          Click image for larger version

Name:	ai.PNG
Views:	1
Size:	316.5 KB
ID:	1468349Click image for larger version

Name:	interface.PNG
Views:	1
Size:	193.5 KB
ID:	1468350
          Last edited by Starkium; 04-28-2018, 10:58 PM.
          Consider supporting me on patreon

          Weapon Master and VRE Merge TUT

          Life Art Studios | Discord | End of Days - VR Zombie Survival

          Comment


            Not that I am aware of.
            Unfortunately the AI perception/stimulus system has various issues, some of which are related to the way it uses / doesn't use the IGenericTeamAgentInterface.

            We have various comments and fixes in our source relating to these, along with some colourful language :|
            Rule#21: Be polite, be professional, but have a plan to kill everyone you meet.

            Comment


              Hi Rama
              Glad to see your plugin is alive and become a really indispensable thing for such amount of UE4 users.

              But I have a next question.
              There is a thing we, BP only users, still don't have even as affordable paid plugin.
              I'm about a custom AI tick based pathing with jumping logic like you've described in wiki

              there's a lot of BP only users like me, who can, in the best case, copypaste some code and even modify it a little,
              but who are completely helpless when something goes wrong during compilation.

              So.
              Maybe we can somehow motivate you to build it as a plugin?
              I'm not speaking about free one like Victory, but a paid marketplace one,
              or maybe we could organize some crowdfunding to compensate time and efforts

              Everything have it's price in money and time, so please, tell us, if there is a possibility you can spend your time for such a plugin, and if yes, what's the price.



              Final Protection the game
              Final Protection RU VK group

              Comment


                Hi, is it possible to load an image from a web server by adding the URL adress in the "Full File Path" in the "Victory Load Texture 2D from file"?
                Thanks

                Comment


                  Originally posted by Kidox18 View Post
                  Hi, is it possible to load an image from a web server by adding the URL adress in the "Full File Path" in the "Victory Load Texture 2D from file"?
                  Thanks
                  No, it will only load off the local computer.
                  Rule#21: Be polite, be professional, but have a plan to kill everyone you meet.

                  Comment


                    So, I'm having this weird issue where:
                    In editor when we try to call to load a string from our Engine.ini https://gyazo.com/f3d2e423949f98bf0b93d831f8e9d5f2
                    It works in editor and standalone mode. But when I attempt to do it when we package the game for distribution, it doesn't work. Like, the node gets fired off because the Test.txt file appears ( https://gyazo.com/c47db4c7a2b8ac96932577ae6a959f65 and it makes that save text appear, but it just doesn't work for what we need it to.
                    "Let's see if your bite is as big as your bark" -Mark Welch, Lurking in the Shadows.

                    Comment


                      Has anyone managed to use the "Capture 2D Save Image" successfully? I've managed to get the load 2d texture node to work but with this one havent had any success, I've tried various setups and file types but it never appears to save anything. Wondering if anyone knows a work around?

                      Thanks!

                      Comment


                        Originally posted by Voradori View Post
                        Hi Rama
                        Glad to see your plugin is alive and become a really indispensable thing for such amount of UE4 users.

                        But I have a next question.
                        There is a thing we, BP only users, still don't have even as affordable paid plugin.
                        I'm about a custom AI tick based pathing with jumping logic like you've described in wiki

                        there's a lot of BP only users like me, who can, in the best case, copypaste some code and even modify it a little,
                        but who are completely helpless when something goes wrong during compilation.

                        So.
                        Maybe we can somehow motivate you to build it as a plugin?
                        I'm not speaking about free one like Victory, but a paid marketplace one,
                        or maybe we could organize some crowdfunding to compensate time and efforts

                        Everything have it's price in money and time, so please, tell us, if there is a possibility you can spend your time for such a plugin, and if yes, what's the price.
                        Hi there! I wanted to make sure to acknowledge your request

                        Currently I don't have the time to update the multi-threaded AI Jumping logic to 4.19 and also make it BP-accessible.


                        A very exciting starting point though would be exposing more of the Nav Mesh core functions that would allow you to do your own calculations.

                        I will work on this at my next opportunity.

                        Special thanks to Kris for stopping by in this thread!



                        Rama
                        Last edited by Rama; 05-08-2018, 07:23 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


                          WooooT.... thanks Rama.. I was writing a small bit for creating a proc in BPs... but you already have it here.. Thanks a bunch! I can't wait to try out some of those other goodies too. Thanks to the other contributers as well.

                          You don't have something in here that can log a WAN address and/or port do you? lol.. Edit: Found on page 89 usage for the send/request node! Hells yeah Rama! I've been putting these two things off forever... and here I find you've done it for us. Thank you sooooo much.

                          keep up the good stuff..
                          Last edited by 6gg Studios; 05-19-2018, 04:31 PM.

                          Comment


                            Yeah, just confirming. I've implemented both and they work flawlessly. I am in your debt. Thank you!

                            Comment


                              I have problem white IO reading file text "LogStreaming: Warning: Failed to open ANSI TEXT file KeyboardConfig.ini" I use UE4.19

                              Ok i resolved

                              Thanks Rama
                              Last edited by Orion_Omega; 05-30-2018, 09:40 PM.

                              Comment


                                Rama Would there be any way for the Read Pixels From File to support 16 or 24 bit integer colors? Additionally, a new function designed specifically for reading these color formats wouldn't even need to generate an accurate Texture2D, just write the uncompressed pixel data to an array without generating an actual Texture. Thanks.

                                Comment

                                Working...
                                X