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 Rama ,

    Thank you very much for the update!

    In addition, I have a question, please: do you know any way to 'read' strings from a file over the internet (from example: mywebsite.com/myfile.txt)? I have tried some combinations with your 'Load string from file' node (which is incredible for local use!), and with the default 'Download image' node, with no luck. I wouldn't care about reading it directly from the web, or downloading that file to disk, and read from it after being already locally saved. I would be very glad if you would have any idea.

    Thank you very much and best regards!
    RTX RayTracing easy global settings tweaker

    Advanced HDRi background tool + 64 HDR images

    Comment


      Originally posted by Jaytheway View Post

      Nobody AbleChen

      Here's working modified version of that function, add it to your blueprint function library. Check if it works in packaged game.


      Boldened code is what's different from the original.
      I'm trying hard to get this to work, but I get tons of HTML 5 errors when I change the function to what you wrote?? I'm a novice at C++, sorry.. Also, my original code is fairly different than the bolded part you had.. there's lots of other differences. I tried an old version and updating to the latest version. I'm at a loss and I really need this working :/ any suggestions?

      Comment


        Hey Pinworm "A bunch of HTML 5 errors" means nothing without context. I don't think you can get any errors while you're typing code in your IDE.

        - What UE version you're using?
        - Have you tried original function from Rama's plugin before trying to change anything?
        - Are you adding new version of the function to your blueprint library, or are you trying to modify Rama's Plugin code?
        - At what stage do you get the errors: when you try to compile, or when you try using the modified function?
        - If you're on version 4.25, most likely the issue somewhere else. Nobody confirmed it working in 4.25. If you're on 4.26, it is possible that they have yet again changed something in the engine about audio data handling, in which case I could not help you, because I'm not updating until full release.

        Comment


          Hey there!
          amazing plugin, use it in all my project because it have so many use cases! I have a question for you,
          Can you expose the "CrouchedHalfHeight" in a function that can be set? because currently it cant be set through blueprint and i think it might be a good addition? Or a function that automatically offsets the capsule based on the half height instead, so you can change the capsule components half height and it allow it to offset too.
          For now i created my own function but i just thought it might be a good addition to your plugin!
          Anyhow, have a great day/night!
          Last edited by N1LSS0N1; 10-23-2020, 05:00 AM.

          Comment


            Originally posted by Jaytheway View Post
            Hey Pinworm "A bunch of HTML 5 errors" means nothing without context. I don't think you can get any errors while you're typing code in your IDE.

            - What UE version you're using?
            - Have you tried original function from Rama's plugin before trying to change anything?
            - Are you adding new version of the function to your blueprint library, or are you trying to modify Rama's Plugin code?
            - At what stage do you get the errors: when you try to compile, or when you try using the modified function?
            - If you're on version 4.25, most likely the issue somewhere else. Nobody confirmed it working in 4.25. If you're on 4.26, it is possible that they have yet again changed something in the engine about audio data handling, in which case I could not help you, because I'm not updating until full release.
            Hey, sorry about my initial post, I'm still getting the hang of C++ so I was pretty confused. I ended up figuring things out a bit. I needed to add a certain line that the compiler auto added for me.
            That made it so works to import .ogg, with your fix. Thanks a ton of that, and thanks a ton @rama for the plugin as well - sorry if I was unappreciative in my first post, it was a moment of frustration
            Anyway the HTML 5 errors were unrelated, that's just what came up and what confused me, but it was because the function was 'broken' as I needed to add a certain line like I mentioned.

            I just needed to change

            "USoundWave* GetSoundWaveFromFile(const FString& FilePath)" to
            "USoundWave* UVictoryBPFunctionLibrary::GetSoundWaveFromFile(const FString& FilePath)"


            So with your changes and the added change the compiler suggested, .ogg now imports successfully.

            That said;

            - This is UE 4.25.3
            - I did try the original function before changing anything, it did not work
            - I'm modifying Rama's Plugin code, changing the function from what it was to what you quoted. However, you wrote "The bolded part is changed" while I had less lines than just that bolded part, if this matters.
            - I got the errors when compiling, but it was mostly my misunderstanding of C++ and visual studio. The HTML5 errors come up because compiling fails but it's 'irrelevant' or unrelated, basically my misunderstanding.

            Sorry for being a novice, appreciate you all though

            Edit: Initially I had it in my head that this function should properly import .wavs but I might have been wrong about that. Importing .ogg is alright, but should this be able to import .wavs? Sorry, probably a stupid question

            Thanks again though everyone.
            Last edited by Pinworm; 10-23-2020, 03:10 PM.

            Comment


              Pinworm I would suggest against modifying Rama's plugin code and write it in your own BP library function, otherwise you will have to do this modification for each Rama's Plugin update.

              You could import .wav in a similar way, but you'd have to do some modifications to the code. And it would only work with .wave 44.1kHz 16bit, because that's what UE supports. But then you might as well hook up an external library to do decoding and loading files of any audio format.

              Comment


                Originally posted by Jaytheway View Post
                Pinworm I would suggest against modifying Rama's plugin code and write it in your own BP library function, otherwise you will have to do this modification for each Rama's Plugin update.

                You could import .wav in a similar way, but you'd have to do some modifications to the code. And it would only work with .wave 44.1kHz 16bit, because that's what UE supports. But then you might as well hook up an external library to do decoding and loading files of any audio format.
                This is why you should sell that audio plugin you gave me bro. it can import tons of different audio formats. I use it for many different things.
                It is super awesome. It would be great for the community to have access to etc.
                Matt Walton: Programmer and owner of WireLiteSoft Games.

                [Streaming Terrains][WireLiteSoft.us]

                Comment


                  Veexr I tried this today with the 4.24 version and like you couldn't see the VictoryEdEngine. I think the documentation on this feature is just a bit out dated. I can't comment on the vertex snapping but I did manage to combine SM's to 1 ISM at runtime. Once enabling the plugin, here are the steps I used to test it:

                  1. Create an Actor BP using your SM of choice
                  2. Place a bunch of these actors into your level
                  3. Run the 'stat rhi' console command and note down the DrawPrimitives count
                  4. Create a new BP of class 'VictoryISM'
                  5. Right click and place the node 'Victory ISM Convert to Victory ISMActors'
                  6. Link the EventBeginPlay to the node 'Victory ISM Convert to Victory ISMActors'
                  7. Select the BP created in step 1 under 'Actor Class' of the previous node
                  8. Place this BP into your level

                  Now hit Run (stat rhi should still be active) and look at the same statistic. It should be much lower confirming that all the placed actors have been cmobined into a single ISM.

                  Hope that helps.
                  twitter: @NaveedHIQ

                  Comment


                    hi, thanks for the great plugin,

                    i wanted to use getsoundWaveFromFile node but it's not working :/
                    it loads up an instance without any errors, but it has no sound or anything when i try to play the sound instance, what could be the problem?

                    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
                      someone got the plugin, epic slashed the community wiki...

                      Comment


                        one question, is this a source build you have to build for every version or more of a plugin you can enable/disable? I would love to have some nodes here.

                        Comment


                          Hello Rama,
                          Thanks for your awesome plugin!
                          While using Load Texture 2D From File Plugin I am finding that loading a PNG image with alpha gets lost and becomes white. Is this a known issue, or am I doing something wrong. The same images when imported into UE4 retain their alpha.
                          Thanks

                          Comment


                            Originally posted by KurdishSage View Post
                            hi, thanks for the great plugin,

                            i wanted to use getsoundWaveFromFile node but it's not working :/
                            it loads up an instance without any errors, but it has no sound or anything when i try to play the sound instance, what could be the problem?
                            it works with .ogg files only
                            Matt Walton: Programmer and owner of WireLiteSoft Games.

                            [Streaming Terrains][WireLiteSoft.us]

                            Comment


                              Originally posted by frostic View Post
                              Rama I'm trying to compile your plugin but it says there is an error:

                              Code:
                              Error C2664 'bool IImageWrapper::GetRaw(const ERGBFormat,int32,TArray<uint8,FDefaultAllocator> &)': cannot convert argument 3 from 'const TArray<uint8,FDefaultAllocator> *' to 'TArray<uint8,FDefaultAllocator64> &'
                              
                              code where the error shows is here:
                              
                              const TArray<uint8>* UncompressedBGRA = NULL;
                              if (ImageWrapper->GetRaw(ERGBFormat::BGRA, 8, UncompressedBGRA))
                              the function is Victory_LoadTextureFromFile
                              I don't know if you fixed it or still need a fix, but just in case, you should download the engine-appropriate zip (i.e. the 4.24 version for 4.24, the 4.25 version for 4.25) from the first post in this thread, as the the IImageWrapper::GetRaw signature changed in 4.25. So the error comes from the .cpp being made for the wrong signature.

                              Comment

                              Working...
                              X