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

    Greetings everyone,
    I have been trying to figure out how to get the vertex snapping and other editor features to work and there is a ton of information that I cannot tell what I need to do. I can see the plugin and blueprints, but I do not see the other features that were described in the wiki, https://wiki.unrealengine.com/Rama%2..._Editor_Plugin.
    Just for clarification as it seems this plugin has been through a lot of iterations.... I need to install the package to the engine directory. Do I also need something per project, or no? I would think not, but I wasn't sure if there is some other piece I need here. I tried to edit the DefaultEngine.ini as described and it causes it to crash on load. Any assistance would be greatly appreciated.
    Thanks!

    Comment


      Hi,I want screenshot with a camera , so i use captureScene2DComponent. But when i use CaptureComponent2d_SaveImage() to Save Image to disk,the image is so dark ,i spend a lot of time but can't resolve it ,can you help me, thank you

      Comment


        Rama~~~ upload 4.23 version sooooooon PLEASE!

        Comment


          Originally posted by syploll View Post
          Rama~~~ upload 4.23 version sooooooon PLEASE!
          https://forums.unrealengine.com/deve...54#post1661754


          Yes, it is missing in the first post
          NodePrefabs | PluginBuilder | NotificationBackbone | WidgetBox | RuntimeMeshImportExport | DebugWidget | SteamWorkshopAccessor

          Comment


            I'd like to report a bug that causes using widget functions to crash android applications. Like Get widget of class , etc.
            (using version for 4.23 on 4.23.1)

            Comment


              Originally posted by Rama View Post
              Rama's ISM Editor is Back! Fully Operational in Plugin! Packages!

              Rama's Instanced Static Mesh Editor

              A while back I added an Instanced Static Mesh Editor feature to my Vertex Snap Editor Plugin, which is now a separate plugin from this Victory BP Library:

              Victory Ed Engine ~ Vertex Snapping and Instanced Static Mesh Editor
              https://wiki.unrealengine.com/Rama%2..._experience.21

              There was a bug in my setup that prevented the Instanced Static Meshes from working in a packaged game, and I've now fixed that bug!

              So now my Victory ISM Editor is fully operational for your level-making needs!

              You can now easily manipulate Instanced Static Mesh instances in the level viewport in world space!

              And it works in a packaged game!

              New Video I Filmed Today!


              Original Video Introducing the Concept of Instanced Static Mesh


              ~~~

              Super-Efficient Way to Render 1000s of Meshes!

              In this video you can see my frame rate go from 9 fps with 1500 static mesh actors in the scene, back to over 100 fps, with the simple press of a key! And all the geometry in the level is preserved!

              You can now easily create a super efficient instanced static mesh from a selection of regular static meshes, and also undo the process to make individual edits!

              I explain everything in the video!

              ~~~

              Installation Instructions

              https://wiki.unrealengine.com/Rama%2...n#Installation

              ~~~

              Enjoy!

              Rama

              Can your "Instanced Static Mesh Editor" or "Vertex Snap Editor" plugin show/manipulate translate/rotate/scale widget in runtime (in game mode)?
              Last edited by Angel Tsvetkov; 10-28-2019, 03:38 AM.
              Luxocraft - [FREE] 3D Ray Tracing Block Construction Builder Game on Steam

              Comment


                Hello Rama,

                I was trying to implement a way for the user to upload images from their drive to a local folder in the contents folder.
                I'm attempting to do this by using 3 functions from your library:
                UVictoryBPFunctionLibrary::Victory_LoadTexture2D_FromFile to
                UVictoryBPFunctionLibrary::Victory_GetPixelFromT2D to
                ​​​​​​​ UVictoryBPFunctionLibrary::Victory_SavePixels

                Here it is in Blueprint:



                Click image for larger version

Name:	RamaQuestionCapture.PNG
Views:	521
Size:	360.8 KB
ID:	1679333

                And here are the code snippets:
                My implementation of UVictoryBPFunctionLibrary::Victory_LoadTexture2D_FromFile:
                Code:
                UTexture2D * ULSI_FilePickerLibrary::LSI_LoadTextureFromFilePixels(const FString & FullFilePath, EJoyImageFormats ImageFormat, bool & IsValid, int32 & Width, int32 & Height, TArray<FLinearColor>& OutPixels)
                {
                    OutPixels.Empty();
                
                    IsValid = false;
                    UTexture2D* LoadedTexture = nullptr;
                
                    IImageWrapperModule& ImageWrapperModule = FModuleManager::LoadModuleChecked<IImageWrapperModule>(FName("ImageWrapper"));
                    TSharedPtr<IImageWrapper> ImageWrapper = ImageWrapperModule.CreateImageWrapper(GetImageFormat(ImageFormat));
                
                
                    TArray<uint8> RawFileData;
                
                    if (!FFileHelper::LoadFileToArray(RawFileData, *FullFilePath))
                    {
                        return nullptr;
                    }
                
                    if (ImageWrapper.IsValid() && ImageWrapper->SetCompressed(RawFileData.GetData(), RawFileData.Num()))
                    {
                        const TArray<uint8>* UncompressedBGRA = nullptr;
                        if (ImageWrapper->GetRaw(ERGBFormat::BGRA, 8, UncompressedBGRA))
                        {
                            LoadedTexture = UTexture2D::CreateTransient(ImageWrapper->GetWidth(), ImageWrapper->GetHeight(), PF_B8G8R8A8);
                
                            if (!LoadedTexture)
                            {
                                return nullptr;
                            }
                
                            Width = ImageWrapper->GetWidth();
                            Height = ImageWrapper->GetHeight();
                
                            void* TextureData = LoadedTexture->PlatformData->Mips[0].BulkData.Lock(LOCK_READ_WRITE);
                            FMemory::Memcpy(TextureData, UncompressedBGRA->GetData(), UncompressedBGRA->Num());
                            LoadedTexture->PlatformData->Mips[0].BulkData.Unlock();
                
                            LoadedTexture->UpdateResource();
                        }
                    }
                
                    IsValid = true;
                    return LoadedTexture;
                
                }

                My implementation of UVictoryBPFunctionLibrary::Victory_GetPixelFromT2D:
                Code:
                bool ULSI_FilePickerLibrary::LSI_GetPixelsFromText2D(UTexture2D * T2D, int32 & TextWidth, int32 & TextHeight, TArray<FLinearColor>& PixelArray)
                {
                    if (!T2D)
                    {
                        return false;
                    }
                
                    PixelArray.Empty();
                
                    T2D->SRGB = false;
                    T2D->CompressionSettings = TC_VectorDisplacementmap;
                
                    T2D->UpdateResource();
                
                    FTexture2DMipMap& MyMipMap = T2D->PlatformData->Mips[0];
                    TextWidth = MyMipMap.SizeX;
                    TextHeight = MyMipMap.SizeY;
                
                    FByteBulkData* RawImageData = &MyMipMap.BulkData;
                
                    if (!RawImageData)
                    {
                        return false;
                    }
                
                    FColor* RawColorArray = static_cast<FColor*>(RawImageData->Lock(LOCK_READ_ONLY));
                
                    for (int32 x = 0; x < TextWidth; x++)
                    {
                        for (int32 y = 0; y < TextHeight; y++)
                        {
                            PixelArray.Add(RawColorArray[x* TextWidth + y]);
                        }
                    }
                
                    RawImageData->Unlock();
                    return true;
                
                }
                My implementation of UVictoryBPFunctionLibrary::Victory_SavePixels:
                Code:
                bool ULSI_FilePickerLibrary::LSI_SavePNGtoFile(const FString & FullFilePath, int32 Width, int32 Height, const TArray<FLinearColor>& ImagePixels, bool sRGB, FString & ErrorString)
                {
                    if (FullFilePath.Len() < 1)
                    {
                        ErrorString = "No File Path";
                        return false;
                    }
                
                    FString NewAbsoluteFolderPath = FPaths::GetPath(FullFilePath);
                    FPaths::NormalizeDirectoryName(NewAbsoluteFolderPath);
                    if (!CreateDirectory(NewAbsoluteFolderPath))
                    {
                        ErrorString = "Folder could not be created, cheack read/write permissions-: " + NewAbsoluteFolderPath;
                        return false;
                    }
                
                    TArray<FColor> ColorArray;
                
                    for (const FLinearColor& Each : ImagePixels)
                    {
                        ColorArray.Add(Each.ToFColor(sRGB));
                    }
                
                    if (ColorArray.Num() != Width * Height)
                    {
                        ErrorString = "Error: height x width is not equal to the total pixel array length.";
                        return false;
                    }
                
                    FString FinalFileName = FPaths::GetBaseFilename(FullFilePath, false);
                    FinalFileName += ".png";
                
                    TArray<uint8> CompressedPNG;
                    FImageUtils::CompressImageArray(Width, Height, ColorArray, CompressedPNG);
                
                    return FFileHelper::SaveArrayToFile(CompressedPNG, *FinalFileName);
                
                
                }

                However after testing these, all of my tests say nothing is going wrong, it makes it through the blueprint without error, and through the code as well, and everything appears to be working correctly, but there is no new .png file created in the directory. Upon further inspection of your source code I found that you have a comment that says that at some point these functions did not work for unknown reasons. Are they still not working or have you fixed that issue? If so, what have I done wrong?

                ​​​​​​​All credit for this implementation will go to you of course.

                Comment


                  Originally posted by NMiksaGolden View Post
                  Hello Rama,

                  I was trying to implement a way for the user to upload images from their drive to a local folder in the contents folder.
                  I'm attempting to do this by using 3 functions from your library:
                  UVictoryBPFunctionLibrary::Victory_LoadTexture2D_FromFile to
                  UVictoryBPFunctionLibrary::Victory_GetPixelFromT2D to
                  UVictoryBPFunctionLibrary::Victory_SavePixels

                  Here it is in Blueprint:



                  Click image for larger version

Name:	RamaQuestionCapture.PNG
Views:	521
Size:	360.8 KB
ID:	1679333

                  And here are the code snippets:
                  My implementation of UVictoryBPFunctionLibrary::Victory_LoadTexture2D_FromFile:
                  Code:
                  UTexture2D * ULSI_FilePickerLibrary::LSI_LoadTextureFromFilePixels(const FString & FullFilePath, EJoyImageFormats ImageFormat, bool & IsValid, int32 & Width, int32 & Height, TArray<FLinearColor>& OutPixels)
                  {
                  OutPixels.Empty();
                  
                  IsValid = false;
                  UTexture2D* LoadedTexture = nullptr;
                  
                  IImageWrapperModule& ImageWrapperModule = FModuleManager::LoadModuleChecked<IImageWrapperModule>(FName("ImageWrapper"));
                  TSharedPtr<IImageWrapper> ImageWrapper = ImageWrapperModule.CreateImageWrapper(GetImageFormat(ImageFormat));
                  
                  
                  TArray<uint8> RawFileData;
                  
                  if (!FFileHelper::LoadFileToArray(RawFileData, *FullFilePath))
                  {
                  return nullptr;
                  }
                  
                  if (ImageWrapper.IsValid() && ImageWrapper->SetCompressed(RawFileData.GetData(), RawFileData.Num()))
                  {
                  const TArray<uint8>* UncompressedBGRA = nullptr;
                  if (ImageWrapper->GetRaw(ERGBFormat::BGRA, 8, UncompressedBGRA))
                  {
                  LoadedTexture = UTexture2D::CreateTransient(ImageWrapper->GetWidth(), ImageWrapper->GetHeight(), PF_B8G8R8A8);
                  
                  if (!LoadedTexture)
                  {
                  return nullptr;
                  }
                  
                  Width = ImageWrapper->GetWidth();
                  Height = ImageWrapper->GetHeight();
                  
                  void* TextureData = LoadedTexture->PlatformData->Mips[0].BulkData.Lock(LOCK_READ_WRITE);
                  FMemory::Memcpy(TextureData, UncompressedBGRA->GetData(), UncompressedBGRA->Num());
                  LoadedTexture->PlatformData->Mips[0].BulkData.Unlock();
                  
                  LoadedTexture->UpdateResource();
                  }
                  }
                  
                  IsValid = true;
                  return LoadedTexture;
                  
                  }

                  My implementation of UVictoryBPFunctionLibrary::Victory_GetPixelFromT2D:
                  Code:
                  bool ULSI_FilePickerLibrary::LSI_GetPixelsFromText2D(UTexture2D * T2D, int32 & TextWidth, int32 & TextHeight, TArray<FLinearColor>& PixelArray)
                  {
                  if (!T2D)
                  {
                  return false;
                  }
                  
                  PixelArray.Empty();
                  
                  T2D->SRGB = false;
                  T2D->CompressionSettings = TC_VectorDisplacementmap;
                  
                  T2D->UpdateResource();
                  
                  FTexture2DMipMap& MyMipMap = T2D->PlatformData->Mips[0];
                  TextWidth = MyMipMap.SizeX;
                  TextHeight = MyMipMap.SizeY;
                  
                  FByteBulkData* RawImageData = &MyMipMap.BulkData;
                  
                  if (!RawImageData)
                  {
                  return false;
                  }
                  
                  FColor* RawColorArray = static_cast<FColor*>(RawImageData->Lock(LOCK_READ_ONLY));
                  
                  for (int32 x = 0; x < TextWidth; x++)
                  {
                  for (int32 y = 0; y < TextHeight; y++)
                  {
                  PixelArray.Add(RawColorArray[x* TextWidth + y]);
                  }
                  }
                  
                  RawImageData->Unlock();
                  return true;
                  
                  }
                  My implementation of UVictoryBPFunctionLibrary::Victory_SavePixels:
                  Code:
                  bool ULSI_FilePickerLibrary::LSI_SavePNGtoFile(const FString & FullFilePath, int32 Width, int32 Height, const TArray<FLinearColor>& ImagePixels, bool sRGB, FString & ErrorString)
                  {
                  if (FullFilePath.Len() < 1)
                  {
                  ErrorString = "No File Path";
                  return false;
                  }
                  
                  FString NewAbsoluteFolderPath = FPaths::GetPath(FullFilePath);
                  FPaths::NormalizeDirectoryName(NewAbsoluteFolderPath);
                  if (!CreateDirectory(NewAbsoluteFolderPath))
                  {
                  ErrorString = "Folder could not be created, cheack read/write permissions-: " + NewAbsoluteFolderPath;
                  return false;
                  }
                  
                  TArray<FColor> ColorArray;
                  
                  for (const FLinearColor& Each : ImagePixels)
                  {
                  ColorArray.Add(Each.ToFColor(sRGB));
                  }
                  
                  if (ColorArray.Num() != Width * Height)
                  {
                  ErrorString = "Error: height x width is not equal to the total pixel array length.";
                  return false;
                  }
                  
                  FString FinalFileName = FPaths::GetBaseFilename(FullFilePath, false);
                  FinalFileName += ".png";
                  
                  TArray<uint8> CompressedPNG;
                  FImageUtils::CompressImageArray(Width, Height, ColorArray, CompressedPNG);
                  
                  return FFileHelper::SaveArrayToFile(CompressedPNG, *FinalFileName);
                  
                  
                  }

                  However after testing these, all of my tests say nothing is going wrong, it makes it through the blueprint without error, and through the code as well, and everything appears to be working correctly, but there is no new .png file created in the directory. Upon further inspection of your source code I found that you have a comment that says that at some point these functions did not work for unknown reasons. Are they still not working or have you fixed that issue? If so, what have I done wrong?

                  ​​​​​​​All credit for this implementation will go to you of course.
                  if you just want to move a file into the content folder of the project, why not use a file copy on the system? As of what your code does it is overcomplicated and slow compared to just a file copy
                  NodePrefabs | PluginBuilder | NotificationBackbone | WidgetBox | RuntimeMeshImportExport | DebugWidget | SteamWorkshopAccessor

                  Comment


                    Originally posted by Rumbleball View Post

                    if you just want to move a file into the content folder of the project, why not use a file copy on the system? As of what your code does it is overcomplicated and slow compared to just a file copy
                    Didn't realize I could do that, I'll give that a shot
                    Last edited by NMiksaGolden; 10-29-2019, 09:36 AM.

                    Comment


                      Originally posted by Rumbleball View Post

                      if you just want to move a file into the content folder of the project, why not use a file copy on the system? As of what your code does it is overcomplicated and slow compared to just a file copy
                      Is there a way to do that without source control? This is a local project and I'm the only one working on it.

                      Comment


                        Originally posted by NMiksaGolden View Post

                        Didn't realize I could do that, I'll give that a shot
                        https://docs.unrealengine.com/en-US/...ger/index.html

                        I don't know why Unreal does not expose file operations to Blueprint, but might have reasons, eg. that Mods created with Blueprint are not able to damage the filesystem.

                        As of Unreal 4.23 Unreal has exposed SourceControl functionality to Blueprint. MAYBE that works for you. Not sure what a Copy File would actually do in this case.

                        Click image for larger version  Name:	Unbenannt.png Views:	0 Size:	55.3 KB ID:	1679380
                        NodePrefabs | PluginBuilder | NotificationBackbone | WidgetBox | RuntimeMeshImportExport | DebugWidget | SteamWorkshopAccessor

                        Comment


                          Originally posted by Rumbleball View Post

                          https://docs.unrealengine.com/en-US/...ger/index.html

                          I don't know why Unreal does not expose file operations to Blueprint, but might have reasons, eg. that Mods created with Blueprint are not able to damage the filesystem.

                          As of Unreal 4.23 Unreal has exposed SourceControl functionality to Blueprint. MAYBE that works for you. Not sure what a Copy File would actually do in this case.

                          Click image for larger version Name:	Unbenannt.png Views:	0 Size:	55.3 KB ID:	1679380
                          Yes I found those, but I'm not using any source control on this project as I am the only one working on it. So it is local. Do you know of anyway to do this with all local files, so I don't have to enable source control for this.

                          Comment


                            Originally posted by NMiksaGolden View Post

                            Yes I found those, but I'm not using any source control on this project as I am the only one working on it. So it is local. Do you know of anyway to do this with all local files, so I don't have to enable source control for this.
                            https://docs.unrealengine.com/en-US/...ger/index.html

                            ALWAYS USE SOURCE CONTROL! Also when working solo
                            https://softwareengineering.stackexc...ersion-control

                            Perforce is free for 5 User and 20 Workspaces when working locally.
                            Last edited by Rumbleball; 10-29-2019, 10:26 AM.
                            NodePrefabs | PluginBuilder | NotificationBackbone | WidgetBox | RuntimeMeshImportExport | DebugWidget | SteamWorkshopAccessor

                            Comment


                              no. i dont thing so

                              Comment


                                Is LoadStringToFile broken in 4.23? It always return blank. My file is "e:\myfile.txt".
                                Checkout Project "TwinBlaster" my current game in progress.
                                [FREE] - 2D ROPE! Find out more here!
                                Forgive my username... It's an old game name and wrote it down as a habit.

                                Comment

                                Working...
                                X