hugoattal / ElectronicNodes

Wiring style for blueprint and material editors in the Unreal Engine
99 stars 10 forks source link

Plugin prevents MetaSound graph animations from playing #71

Closed MekuCube closed 5 months ago

MekuCube commented 1 year ago

Describe the bug MetaSound graph inputs do not show the animated pulse when activated.

To Reproduce Steps to reproduce the behavior:

  1. With plugin enabled, open a MetaSound
  2. Hit Play
  3. Notice no animations
  4. Disable plugin and restart editor.
  5. Open a MetaSound
  6. Hit Play
  7. Notice animations

Expected behavior The MetaSound links should animate while MetaSound is playing.

Screenshots N/A

Environment (please complete the following information):

Additional context I think it is caused by the following code chunk missing from FNodeFactoryPatch::CreateConnectionPolicy_Hook (it is present in FNodeFactory::CreateConnectionPolicy):

// First give a shot to the registered connection factories
if (!ConnectionDrawingPolicy)
{
    for (TSharedPtr<FGraphPanelPinConnectionFactory> FactoryPtr : FEdGraphUtilities::VisualPinConnectionFactories)
    {
        if (FactoryPtr.IsValid())
        {
            ConnectionDrawingPolicy = FactoryPtr->CreateConnectionPolicy(Schema, InBackLayerID, InFrontLayerID, ZoomFactor, InClippingRect, InDrawElements, InGraphObj);
            if (ConnectionDrawingPolicy)
            {
                break;
            }
        }
    }
}
MekuCube commented 1 year ago

From further investigation, it looks like this also causes all links to appear as white, when the color should be different depending on the type.

hugoattal commented 1 year ago

Sorry for this...

I suggest disabling the "Hot Patch" feature if you want to use Meta Sound with their custom features. (You'll need to restart the engine)

image

I'm going to fix this in the meantime, it should be available pretty quickly.

hugoattal commented 1 year ago

Ok, that's far more difficult than I though, as Metasound is a remote plugin. Meaning either:

The second option is what you thought of, it's just that I can't access to FEdGraphUtilities::VisualPinConnectionFactories.

I have a few hack to access private member or private method of a class, but none seems to work for a private static member.

I'll dig a bit more and keep you posted on.

hugoattal commented 1 year ago

I tried doing this

#define private public
#include "EdGraphUtilities.h"
#undef private

(yeah it's ugly, but you have to do what you have to do 😅...)

But it seems that static members are not exported in 5.3, so I get an unresolved external.

Setmaster commented 1 year ago

What is lost if hotpatch is disabled?

hugoattal commented 1 year ago

@Setmaster You lose the ability to use Electronic Nodes in Plugins blueprints (like Niagara or Control Rigs).

But it does not change anything for "common" blueprints like actor logic or material blueprints.