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

    GetPixelFromT2D is broken in 4.24. Crash. Access violation.

    Do not use this plugin if you're not familiar with C++ and don't want to check the code by yourself before using a node!

    I just looked into the UVictoryBPFunctionLibrary::Victory_GetPixelFromT2D function and it

    Code:
    T2D->SRGB = false;
    T2D->CompressionSettings = TC_VectorDisplacementmap;
    changes the texture settings without letting the user know! The texture will have other settings after calling the node.
    Last edited by ThiloN1987; 06-06-2020, 02:50 PM.

    Comment


      Originally posted by unit23 View Post
      When you open the project file with notepad, is the plugin set to 'false'?
      Ah, thank you very much, this seems to help! Finally I was able to remove the plugin by setting it to "false" by hand in the project file. Phew! Thank you!

      Comment


        Just a little warning: This plugin does not seem to be fully compatible with the Oculus Quest. I just spent two hours of debugging trying to figure out why my app kept crashing on me ONLY on the Quest, but nowhere else. Turns out it was the usage of the "Append String" (Or "Append multiple"? Can't recall...) function of the VictoryBP Plugin.
        Since I replayced it with the builtin "Append" function, everything is working smoothly again.

        Comment


          Originally posted by RenaCava View Post
          So I'm working with the Get Sound Wave from File node in 4.24, it creates the USoundWave with the correct duration but no actual audio samples, so there's no sound playing. Same thing happens with the other two nodes (at location and attached). Importing the .ogg file manually, it plays in editor, though this somewhat defeats the point of the nodes. Any ideas?Click image for larger version

Name:	Rama.jpg
Views:	1176
Size:	60.6 KB
ID:	1751837

          Hello, I encountered the same problem. Do you have any solutions?

          Comment


            Yeah Sound Importing is broken for me in 4.25 aswell. Tried modifing the code a bit but as I am not very good in c++ so the only thing I could manage is to get some static noise after a week on working on it.

            Comment


              Originally posted by Nobody View Post
              Yeah Sound Importing is broken for me in 4.25 aswell. Tried modifing the code a bit but as I am not very good in c++ so the only thing I could manage is to get some static noise after a week on working on it.
              Nobody AbleChen

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

              Code:
              USoundWave* GetSoundWaveFromFile(const FString& FilePath)
              {
              
              #if PLATFORM_PS4
              UE_LOG(LogTemp, Error, TEXT("UVictoryBPFunctionLibrary::GetSoundWaveFromFile ~ vorbis-method not supported on PS4. See UVictoryBPFunctionLibrary::fillSoundWaveInfo"));
              return nullptr;
              #else
              USoundWave* sw = NewObject<USoundWave>(USoundWave::StaticClass());
              
              if (!sw)
              return NULL;
              
              //* If true the song was successfully loaded
              bool loaded = false;
              
              //* loaded song file (binary, encoded)
              TArray < uint8 > rawFile;
              
              loaded = FFileHelper::LoadFileToArray(rawFile, FilePath.GetCharArray().GetData());
              
              if (loaded)
              {
              FByteBulkData* bulkData = &sw->CompressedFormatData.GetFormat(TEXT("OGG"));
              
              bulkData->Lock(LOCK_READ_WRITE);
              FMemory::Memcpy(bulkData->Realloc(rawFile.Num()), rawFile.GetData(), rawFile.Num());
              bulkData->Unlock();
              
              //loaded = fillSoundWaveInfo(sw, &rawFile) == 0 ? true : false;
              FSoundQualityInfo info;
              FVorbisAudioInfo vorbis_obj;
              if (!vorbis_obj.ReadCompressedInfo(rawFile.GetData(), rawFile.Num(), &info))
              {
              //Debug("Can't load header");
              loaded = false;
              }
              
              if (!sw) loaded = false;
              sw->SoundGroup = ESoundGroup::SOUNDGROUP_Default;
              sw->NumChannels = info.NumChannels;
              sw->Duration = info.Duration;
              sw->RawPCMDataSize = info.SampleDataSize;
              sw->SetSampleRate(info.SampleRate);
              
              sw->RawPCMData = (uint8*)FMemory::Malloc(sw->RawPCMDataSize);
              vorbis_obj.ExpandFile(sw->RawPCMData, &info);
              
              loaded = true;
              }
              
              if (!loaded)
              return NULL;
              
              return sw;
              #endif
              }
              Boldened code is what's different from the original.

              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.

                Code:
                USoundWave* GetSoundWaveFromFile(const FString& FilePath)
                {
                
                #if PLATFORM_PS4
                UE_LOG(LogTemp, Error, TEXT("UVictoryBPFunctionLibrary::GetSoundWaveFromFile ~ vorbis-method not supported on PS4. See UVictoryBPFunctionLibrary::fillSoundWaveInfo"));
                return nullptr;
                #else
                USoundWave* sw = NewObject<USoundWave>(USoundWave::StaticClass());
                
                if (!sw)
                return NULL;
                
                //* If true the song was successfully loaded
                bool loaded = false;
                
                //* loaded song file (binary, encoded)
                TArray < uint8 > rawFile;
                
                loaded = FFileHelper::LoadFileToArray(rawFile, FilePath.GetCharArray().GetData());
                
                if (loaded)
                {
                FByteBulkData* bulkData = &sw->CompressedFormatData.GetFormat(TEXT("OGG"));
                
                bulkData->Lock(LOCK_READ_WRITE);
                FMemory::Memcpy(bulkData->Realloc(rawFile.Num()), rawFile.GetData(), rawFile.Num());
                bulkData->Unlock();
                
                //loaded = fillSoundWaveInfo(sw, &rawFile) == 0 ? true : false;
                FSoundQualityInfo info;
                FVorbisAudioInfo vorbis_obj;
                if (!vorbis_obj.ReadCompressedInfo(rawFile.GetData(), rawFile.Num(), &info))
                {
                //Debug("Can't load header");
                loaded = false;
                }
                
                if (!sw) loaded = false;
                sw->SoundGroup = ESoundGroup::SOUNDGROUP_Default;
                sw->NumChannels = info.NumChannels;
                sw->Duration = info.Duration;
                sw->RawPCMDataSize = info.SampleDataSize;
                sw->SetSampleRate(info.SampleRate);
                
                sw->RawPCMData = (uint8*)FMemory::Malloc(sw->RawPCMDataSize);
                vorbis_obj.ExpandFile(sw->RawPCMData, &info);
                
                loaded = true;
                }
                
                if (!loaded)
                return NULL;
                
                return sw;
                #endif
                }
                Boldened code is what's different from the original.
                Thanks a lot! I can confirm this works now in 4.25 editor and packaged/shipping build!

                Comment


                  Hey fine people of the forums!

                  I use the .wav file loading code to ...well, load .wav files. Works great. I use a UAudioComponent with the resulting USoundWave like so:
                  Code:
                  AudioComp->SetSound(Sound);
                  AudioComp->Play(0);
                  That works like a charm. EXCEPT when I give the Play function a StartTime like so
                  Code:
                  AudioComp->Play(1.0f);
                  Now nothing plays anymore. I've tried to chase down the rabbit hole of the Unreal engine code to see what is need for the StartTime to work, but I couln't figure it out. Any help/suggestions are greatly appreciated.

                  EDIT:

                  I found my mistake, pretty dumb but I'm leaving it here for completeness:

                  I did this:
                  Code:
                  USoundWave* Sound;
                  Sound->RawData.Lock(LOCK_READ_WRITE);
                  void* LockedData = Sound->RawData.Realloc(RawData.Num());
                  FMemory::Memcpy(LockedData, WaveInfo.SampleDataStart, WaveInfo.SampleDataSize);
                  Sound->RawData.Unlock();
                  instead of this:
                  Code:
                  USoundWave* Sound;
                  Sound->RawData.Lock(LOCK_READ_WRITE);
                  void* LockedData = Sound->RawData.Realloc(RawData.Num());
                  FMemory::Memcpy(LockedData, RawData.GetData(), WaveInfo.SampleDataSize);
                  Sound->RawData.Unlock();
                  and since 'WaveInfo.SampleDataStart' is null, the RawData in the Sound wave was also then a null pointer. Since the Unreal sound processing on relies on the Sound->RawData, this meant Unreal could not do its thing.
                  So, totally my stupidity.

                  Thanks anyway, cheers.
                  Last edited by Infernobirb; 07-25-2020, 11:11 AM.

                  Comment


                    Hello everyone!

                    First of all:
                    Rama thank you for sharing this awesome asset for us!

                    I am using your LoadObjectFromAssetPath BP node, in the editor to load assets into my scene.

                    I am struggling to get it to load stuff runtime, from a folder that has not been packaged with the game...(Content creator's folder for importing clothes as skeletalmeshes and props as staticmeshes)
                    Not sure what kind of path can I feed to the node that works with runtime, non-packaged stuff.

                    Maybe there is another node that I do not know of?

                    Many thanks
                    Janos

                    Comment


                      Hello everyone does anyone happen to seen my post?

                      Comment


                        Originally posted by Kris View Post
                        Hope that the Scene Capture Project functions & CreateTextureRenderTarget2D function are of use to someone.

                        We've been using CreateTextureRenderTarget2D() for our optical sights and UI related elements for quite some time. It allows us to create texture render targets on the fly and not have to worry about creating them manually in the content browser.

                        We use Project() for rendering attachment points for our character and items in the customisation UI.

                        I created a crappy quick mini-map project that uses it as an example.
                        I'll see about getting it online soon.

                        Kris.
                        Do you have any examples of how to implement this for a scope in a dedicated server multiplayer game?

                        Comment


                          It is not something that would be done on a dedicated server - it would be on the clients.
                          There are already a number of tutorials/examples floating around showing how to use a scene capture component to render to textures.
                          A 3d optic is no different to this.
                          Rule#21: Be polite, be professional, but have a plan to kill everyone you meet.

                          Comment


                            I couldn't figure out how to install this.. First off I had a hard time finding the vertex snapper since I thought that VictoryPlugin25 didn't have the instanced mesh thing for static meshes (didn't find it) then when I try to start up the project with the version of the plugin that has "VictoryEdEngine" which I supposedly need for the static mesh stuff (only thing I need from the plugin) it just gives a bunch of errors when I try to compile..

                            So..
                            Does the 4.25 version of the plugin have the 'combine multiple static meshes into an instanced static mesh' stuff? If so, how can I get it to work? I just couldn't figure it out, also I'm tired so that may be a factor in why I couldn't figure this out

                            Comment


                              Hi there,

                              I would like to get the save string array to work frame by frame. So that for example i would directly print multiple position metadata of agents per frame into a file.

                              best Georg

                              Comment


                                Hey there,
                                I wanted to let you know, Rama, that when compiling a game in 4.25, I get some "warnings" for future versions related to your awesome plugin:

                                Code:
                                 X:/Project/Plugins/VictoryBP/Source/VictoryBPLibrary/Private/VictoryBPFunctionLibrary.cpp(4098): warning C4996: 'operator new': Placement new on TIndirectArray has been deprecated - users should call Add() passing a pointer to an object created with new. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
                                X:/Project/Plugins/VictoryBP/Source/VictoryBPLibrary/Private/VictoryBPFunctionLibrary.cpp(5297): warning C4996: 'FindField': FindField will no longer return properties. Use FindProperty instead or FindUField if you want to find functions or enums. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
                                X:/Project/Plugins/VictoryBP/Source/VictoryBPLibrary/Private/VictoryBPFunctionLibrary.cpp(5298): warning C4996: 'FindField': FindField will no longer return properties. Use FindProperty instead or FindUField if you want to find functions or enums. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
                                X:/Project/Plugins/VictoryBP/Source/VictoryBPLibrary/Private/VictoryBPFunctionLibrary.cpp(5319): warning C4996: 'FindField': FindField will no longer return properties. Use FindProperty instead or FindUField if you want to find functions or enums. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
                                Also this warnings have been appearing at least since 4.20, but I've seen no problem with those so far, but just in case you didn't know about them:

                                Code:
                                 LogClass: Warning: FLevelStreamInstanceInfo::Location is not initialized properly
                                LogClass: Warning: FLevelStreamInstanceInfo::Rotation is not initialized properly
                                LogClass: Warning: BoolProperty FLevelStreamInstanceInfo::bShouldBeLoaded is not initialized properly
                                LogClass: Warning: BoolProperty FLevelStreamInstanceInfo::bShouldBeVisible is not initialized properly
                                LogClass: Warning: BoolProperty FLevelStreamInstanceInfo::bShouldBlockOnLoad is not initialized properly
                                LogClass: Warning: FLevelStreamInstanceInfo::LODIndex is not initialized properly
                                LogClass: Warning: BoolProperty FVictoryInput::bShift is not initialized properly
                                LogClass: Warning: BoolProperty FVictoryInput::bCtrl is not initialized properly
                                LogClass: Warning: BoolProperty FVictoryInput::bAlt is not initialized properly
                                LogClass: Warning: BoolProperty FVictoryInput::bCmd is not initialized properly
                                "sic parvis magna"
                                @Meguido

                                Comment

                                Working...
                                X