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:	762
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

                      Working...
                      X