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

    Hey Rama,

    Saw that in 4.25 several of the Get Pixel/s from T2D nodes are now deprecated and you recommend voicing any continued need for them in this thread. I'm one of the people who uses those nodes and they've been a critical component of my current project. Not having access to to them is preventing me from moving to 4.25 until a solution is found. I would not have initially said this was an urgent need, but as new issues/lack of a feature in the version I use (4.22) rub up against the needs of the project, I'm finding that upgrading is all but a necessity so having these nodes available has become a far more urgent matter.

    I hope it's possible to find a solution and thank you so much for this plugin. It's enabled me to do things previously out of reach.

    Comment


      Rama Thanks for the plugin!! it's fantastic.
      I just converted a project from 4.24 to 4.25 and replaced the victory plugin with the 4.25 version, all works fine, but a function called "Vicrotry Get Pixel from T2D" is listed as deprecated and doesn't work. The blueprint note said to post something here if it's needed urgently, and it very much is.
      If there anything you can do about this?

      Thanks!

      Comment


        Rama why i can see the Line of node "draw Thick 3Dline" when shipping packages. (development package and standalone can see). i use UE4.19

        Comment


          Hi,

          I've been trying to find a way to sample pixels from Texture2D in 4.25 but I get compiler error C2440: 'static_cast': cannot convert from 'const ElementType *' to 'const FColor *'.
          After some searching, I came across this post https://answers.unrealengine.com/que...7646/view.html.
          The solution is to change static_cast to reinterpret_cast.
          Confirmed working for my Windows shipping build.


          Originally posted by NickGW View Post
          Hey Rama,

          Saw that in 4.25 several of the Get Pixel/s from T2D nodes are now deprecated and you recommend voicing any continued need for them in this thread. I'm one of the people who uses those nodes and they've been a critical component of my current project. Not having access to to them is preventing me from moving to 4.25 until a solution is found. I would not have initially said this was an urgent need, but as new issues/lack of a feature in the version I use (4.22) rub up against the needs of the project, I'm finding that upgrading is all but a necessity so having these nodes available has become a far more urgent matter.

          I hope it's possible to find a solution and thank you so much for this plugin. It's enabled me to do things previously out of reach.
          Hope it helps you.

          Comment


            kevin791129 This unfortunately didn't fix the Victory_GetPixelsArrayFromT2D node on my end, I'm still getting an empty array when I change the cast.

            Comment


              When i package with the custom engine for HTML 4.24, and have builded your plugin into the project, it shows a error message when im using the node "Victory HTML5 set cursor visible"

              The error happends when i try to start the game in a web browser, and it says "Uncaught RuntimeError: function signature mismatch"

              This ONLY happends when i connect the node to execute. When ever that victory node is removed, the package runs fine in the webbrowser.

              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
                Hey Rama frostic Was there any solution to this issue?

                Comment


                  Originally posted by ScitechDev View Post

                  Hey Rama frostic Was there any solution to this issue?
                  no. he never told me a fix for it. but i did try the subsystem launcher version and it works.
                  Matt Walton: Programmer and owner of WireLiteSoft Games.

                  [Streaming Terrains][WireLiteSoft.us]

                  Comment


                    Load Texture 2D from File don't create Mip-Maps. Is there any possibility to implement it or a workaround?

                    Comment


                      I'm using an older version of the Victory plugin, and am using the "Victory Simulate Key Press" but trying to make it so that W, A, S, and D can simulate axis controls, but under the event type, if Axis is selected, there is no way to set what axis to simulate.
                      Is this a feature of the newer version of the plugin at all?

                      Alternatively, does the plugin have a node that assigns the keyboard to a different player index?

                      Thanks for making this awesome plugin by the way, it has saved a lot of time.
                      Developer of the party game "Metal Heads".
                      www.metalheadsgame.com
                      Follow on Twitter @MetalHeadsGame
                      Follow on Facebook www.facebook.com/MetalHeadsGame.

                      Comment



                        Originally posted by himawari1987 View Post
                        Rama why i can see the Line of node "draw Thick 3Dline" when shipping packages. (development package and standalone can see). i use UE4.19
                        The debug draw line functions are not allowed in packaged builds on Epic's end, does anyone know of a way to get around that without requiring a custom engine build?

                        If so please submit the code to my github and I will add it to the plugin!

                        https://github.com/EverNewJoy/VictoryPlugin

                        ~~~

                        Originally posted by VAD Norway View Post
                        When i package with the custom engine for HTML 4.24, and have builded your plugin into the project, it shows a error message when im using the node "Victory HTML5 set cursor visible"

                        The error happends when i try to start the game in a web browser, and it says "Uncaught RuntimeError: function signature mismatch"

                        This ONLY happends when i connect the node to execute. When ever that victory node is removed, the package runs fine in the webbrowser.
                        Sorry, those nodes have not been updated in a while, I've removed them from next version.

                        Hopefully someone who is doing an HTML5 project can update these files:

                        VictoryBPHTML.h
                        VictoryBPHTML.cpp

                        ~~~

                        Originally posted by Otreum View Post
                        I'm using an older version of the Victory plugin, and am using the "Victory Simulate Key Press" but trying to make it so that W, A, S, and D can simulate axis controls, but under the event type, if Axis is selected, there is no way to set what axis to simulate.
                        Is this a feature of the newer version of the plugin at all?

                        Alternatively, does the plugin have a node that assigns the keyboard to a different player index?

                        Thanks for making this awesome plugin by the way, it has saved a lot of time.
                        I looked in 4.25 SlateApplication, I don't see a function that allows you to supply an axis value, only key values

                        I can't easily offer axis option unless SlateApplication or some other part of the Engine supports simulated axis key press

                        The closed thing is raw gamepad analog input:

                        Code:
                        virtual bool OnControllerAnalog( FGamepadKeyNames::Type KeyName, int32 ControllerId, float AnalogValue ) override;
                        ~~~


                        Originally posted by NickGW View Post
                        Hey Rama,

                        Saw that in 4.25 several of the Get Pixel/s from T2D nodes are now deprecated and you recommend voicing any continued need for them in this thread. I'm one of the people who uses those nodes and they've been a critical component of my current project. Not having access to to them is preventing me from moving to 4.25 until a solution is found. I would not have initially said this was an urgent need, but as new issues/lack of a feature in the version I use (4.22) rub up against the needs of the project, I'm finding that upgrading is all but a necessity so having these nodes available has become a far more urgent matter.

                        I hope it's possible to find a solution and thank you so much for this plugin. It's enabled me to do things previously out of reach.
                        Originally posted by himawari1987 View Post
                        Rama why i can see the Line of node "draw Thick 3Dline" when shipping packages. (development package and standalone can see). i use UE4.19
                        "thank you so much for this plugin. It's enabled me to do things previously out of reach."

                        You're welcome!

                        Working on the color issue now



                        Rama



                        Originally posted by Ryan.Gilbert View Post
                        Rama Thanks for the plugin!! it's fantastic.
                        I just converted a project from 4.24 to 4.25 and replaced the victory plugin with the 4.25 version, all works fine, but a function called "Vicrotry Get Pixel from T2D" is listed as deprecated and doesn't work. The blueprint note said to post something here if it's needed urgently, and it very much is.
                        If there anything you can do about this?

                        Thanks!

                        Working on this...
                        Last edited by Rama; 10-05-2020, 09:12 PM.
                        UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                        ♥ Rama

                        Comment


                          GetPixel and GetPixelArray

                          Are Back!




                          Rama

                          ~~~

                          4.25 (win32, win64, editor, dev packaged, and shipping)
                          https://www.mediafire.com/file/pgrps...gin25.zip/file

                          ~~~

                          Usage

                          Please note the implementation has changed for GetPixelArray, I traverse the image row-wise now, please see picture for how to traverse the new returned array!

                          Please note that your texture must be set to compression of VectorDisplacementmap to be used with these nodes! I cancel out with an error if this is not the case.

                          Click image for larger version  Name:	GetPixels.jpg Views:	0 Size:	187.3 KB ID:	1819282

                          ~~~

                          Source Code Explanation

                          I now just use a byte ptr and iterate in sets of 4, which I can do safely because VectorDisplacementmap is the only allowed type (the byte order will always be as expected by my code)

                          Please also note that VectorDisplacementmap is BGRA ordering, not RGBA.

                          Code:
                          uint8* RawByteArray = (uint8*)RawImageData->Lock(LOCK_READ_ONLY);
                          
                          //Get!, converting FColor to FLinearColor
                          FColor ByteColor;
                          ByteColor.B = RawByteArray[Y * TextureWidth * 4 + (X * 4) ];
                          ByteColor.G = RawByteArray[Y * TextureWidth * 4 + (X * 4) + 1];
                          ByteColor.R = RawByteArray[Y * TextureWidth * 4 + (X * 4) + 2];
                          ByteColor.A = RawByteArray[Y * TextureWidth * 4 + (X * 4) + 3];
                          
                          //Set!
                          PixelColor = ByteColor.ReinterpretAsLinear();
                          
                          RawImageData->Unlock();
                          ~~~

                          Full Source Code For Older Versions

                          If you are using an older version, here are the relevant changes!

                          VictoryBPFunctionLibrary.h
                          Code:
                          /** This will modify the original T2D to remove sRGB and change compression to VectorDisplacementMap to ensure accurate pixel reading. -Rama*/
                          UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Load Texture From File",meta=(Keywords="create image png jpg jpeg bmp bitmap ico icon exr icns"))//, DeprecatedFunction, DeprecationMessage="This function will not work until I figure out how to update it to 4.25, if you need it urgently, please post in my ue4 forum thread for this plugin"))
                          static bool Victory_GetPixelFromT2D(UTexture2D* T2D, int32 X, int32 Y, FLinearColor& PixelColor);
                          
                          /** This will modify the original T2D to remove sRGB and change compression to VectorDisplacementMap to ensure accurate pixel reading. -Rama*/
                          UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Load Texture From File",meta=(Keywords="create image png jpg jpeg bmp bitmap ico icon exr icns"))//, DeprecatedFunction, DeprecationMessage="This function will not work until I figure out how to update it to 4.25, if you need it urgently, please post in my ue4 forum thread for this plugin"))
                          static bool Victory_GetPixelsArrayFromT2D(UTexture2D* T2D, int32& TextureWidth, int32& TextureHeight,TArray<FLinearColor>& PixelArray);
                          .cpp
                          Code:
                          bool UVictoryBPFunctionLibrary::Victory_GetPixelFromT2D(UTexture2D* T2D, int32 X, int32 Y, FLinearColor& PixelColor)
                          {
                          if(!T2D)
                          {
                          return false;
                          }
                          
                          if(X <= -1 || Y <= -1)
                          {
                          return false;
                          }
                          
                          
                          //~~~
                          if(T2D->CompressionSettings != TC_VectorDisplacementmap)
                          {
                          #if WITH_EDITOR
                          FMessageLog("PIE").Error(FText::Format(LOCTEXT("Victory_GetPixelFromT2D", "UVictoryBPFunctionLibrary::Victory_GetPixelFromT2D >> Texture Compression must be VectorDisplacementmap <3 Rama: {0}'"), FText::FromString(T2D->GetName())));
                          #endif // WITH_EDITOR
                          return false;
                          }
                          
                          
                          //~~~
                          
                          T2D->SRGB = false;
                          
                          T2D->CompressionSettings = TC_VectorDisplacementmap;
                          
                          //Update settings
                          T2D->UpdateResource();
                          
                          FTexture2DMipMap& MipsMap = T2D->PlatformData->Mips[0];
                          int32 TextureWidth = MipsMap.SizeX;
                          int32 TextureHeight = MipsMap.SizeY;
                          
                          //Safety check!
                          if (X >= TextureWidth || Y >= TextureHeight)
                          {
                          #if WITH_EDITOR
                          FMessageLog("PIE").Error(FText::Format(LOCTEXT("Victory_GetPixelFromT2D", "UVictoryBPFunctionLibrary::Victory_GetPixelFromT2D >> X or Y is outside of texture bounds! <3 Rama: {0}'"), FText::FromString(FString::FromInt(TextureWidth) + " x " + FString::FromInt(TextureHeight) )));
                          #endif // WITH_EDITOR
                          return false;
                          }
                          
                          FByteBulkData* RawImageData = &MipsMap.BulkData;
                          
                          if(!RawImageData)
                          {
                          return false;
                          }
                          
                          int32 TotalCount = RawImageData->GetElementCount();
                          if(TotalCount < 1)
                          {
                          return false;
                          }
                          
                          uint8* RawByteArray = (uint8*)RawImageData->Lock(LOCK_READ_ONLY);
                          
                          //TC_VectorDisplacementmap UMETA(DisplayName="VectorDisplacementmap (RGBA8)"),
                          //! 4 because includes alpha <3 Rama
                          /*
                          for(int32 v = 0; v < TextureWidth * TextureHeight * RawImageData->GetElementSize() * 4; v++)
                          {
                          DebugString += FString::FromInt(RawByteArray[v]) + " ";
                          }
                          */
                          
                          //Texture.cpp
                          /*
                          else if (FormatSettings.CompressionSettings == TC_VectorDisplacementmap)
                          {
                          TextureFormatName = NameBGRA8;
                          }
                          */
                          
                          //Get!, converting FColor to FLinearColor
                          FColor ByteColor;
                          ByteColor.B = RawByteArray[Y * TextureWidth * 4 + (X * 4) ];
                          ByteColor.G = RawByteArray[Y * TextureWidth * 4 + (X * 4) + 1];
                          ByteColor.R = RawByteArray[Y * TextureWidth * 4 + (X * 4) + 2];
                          ByteColor.A = RawByteArray[Y * TextureWidth * 4 + (X * 4) + 3];
                          
                          //Set!
                          PixelColor = ByteColor.ReinterpretAsLinear();
                          
                          RawImageData->Unlock();
                          
                          return true;
                          }
                          
                          
                          bool UVictoryBPFunctionLibrary::Victory_GetPixelsArrayFromT2D(UTexture2D* T2D, int32& TextureWidth, int32& TextureHeight,TArray<FLinearColor>& PixelArray)
                          {
                          
                          if(!T2D)
                          {
                          return false;
                          }
                          
                          if(T2D->CompressionSettings != TC_VectorDisplacementmap)
                          {
                          #if WITH_EDITOR
                          FMessageLog("PIE").Error(FText::Format(LOCTEXT("Victory_GetPixelFromT2D", "UVictoryBPFunctionLibrary::Victory_GetPixelFromT2D >> Texture Compression must be VectorDisplacementmap <3 Rama: {0}'"), FText::FromString(T2D->GetName())));
                          #endif // WITH_EDITOR
                          return false;
                          }
                          
                          //To prevent overflow in BP if used in a loop
                          PixelArray.Empty();
                          
                          T2D->SRGB = false;
                          T2D->CompressionSettings = TC_VectorDisplacementmap;
                          
                          //Update settings
                          T2D->UpdateResource();
                          
                          FTexture2DMipMap& MyMipMap = T2D->PlatformData->Mips[0];
                          TextureWidth = MyMipMap.SizeX;
                          TextureHeight = MyMipMap.SizeY;
                          
                          FByteBulkData* RawImageData = &MyMipMap.BulkData;
                          
                          if(!RawImageData)
                          {
                          return false;
                          }
                          
                          uint8* RawByteArray = (uint8*)RawImageData->Lock(LOCK_READ_ONLY);
                          
                          
                          for(int32 y = 0; y < TextureHeight; y++)
                          {
                          for(int32 x = 0; x < TextureWidth; x++)
                          {
                          FColor ByteColor;
                          ByteColor.B = RawByteArray[y * TextureWidth * 4 + (x * 4) ];
                          ByteColor.G = RawByteArray[y * TextureWidth * 4 + (x * 4) + 1];
                          ByteColor.R = RawByteArray[y * TextureWidth * 4 + (x * 4) + 2];
                          ByteColor.A = RawByteArray[y * TextureWidth * 4 + (x * 4) + 3];
                          
                          PixelArray.Add(ByteColor.ReinterpretAsLinear());
                          }
                          }
                          
                          RawImageData->Unlock();
                          return true;
                          }

                          Enjoy!



                          Rama
                          Last edited by Rama; 10-06-2020, 04:36 PM.
                          UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                          ♥ Rama

                          Comment


                            Heck yeah!!! Thanks for the update Rama!

                            Comment


                              Do the Victory plugins work for iOS ???

                              Comment


                                Originally posted by VKleinMP View Post
                                Do the Victory plugins work for iOS ???
                                Not yet, but if a developer wants to, they could make an iOS port using the VictoryPlugin Github:

                                https://github.com/EverNewJoy/VictoryPlugin



                                ​​​​​​​Rama



                                Originally posted by NickGW View Post
                                Heck yeah!!! Thanks for the update Rama!
                                Hee hee!

                                You're welcome!

                                And welcome to the UE4 Community!



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

                                ♥ Rama

                                Comment

                                Working...
                                X