Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unreal 5.3 support #340

Open
tvortsa opened this issue Oct 22, 2023 · 10 comments
Open

Unreal 5.3 support #340

tvortsa opened this issue Oct 22, 2023 · 10 comments

Comments

@tvortsa
Copy link

tvortsa commented Oct 22, 2023

Hello!
Is it planned to support version 5.3 ?

@stevecox1964
Copy link

What would it take to get 5.2/5.3 upgrades moving ? If someone on the team could go over the process upgrading I would be glad to help.

@devttebayo
Copy link

+1 - is this a situation where maintaining a community fork would be reasonable if the team isn't able to maintain support for upgrades?

@getnamo
Copy link

getnamo commented Dec 19, 2023

I generally casually maintain my opinionated UnrealJs fork (https://github.com/getnamo/UnrealJs), you can find a working 5.3 win64 release here: https://github.com/getnamo/UnrealJs/releases/tag/v0.9.1. Not all upstream changes are guaranteed, but it generally has very similar API apart from fork specific features (instances & async js).

Can probably look at diffs to apply similar changes to mainline to update it to 5.3. Hope it helps.

@stevecox1964
Copy link

stevecox1964 commented Dec 20, 2023 via email

@dariusznaurecki
Copy link

i have modified sources using diffs from getnamo and it works for me in unreal engine 5.3 on linux. you can check it out here https://github.com/dariusznaurecki/Unrealjs
unrealjs

@stevecox1964
Copy link

stevecox1964 commented Jan 17, 2024 via email

@getnamo
Copy link

getnamo commented Jan 17, 2024

You wouldn't need unreal.js for this, just a texture2d copy to buffer (c++ code) (optionally convert to png if bandwidth is problem), then e.g. emit buffer using socket.io plugin and handle incoming buffer.

Edit:
Something like: https://github.com/getnamo/SocketIOClient-Unreal/blob/master/Source/CoreUtility/Public/CUBlueprintLibrary.h#L131 would work. Which is blueprint exposed in the socket.io plugin. Get the texture from render target (example code is found here: https://github.com/getnamo/TensorFlow-Unreal/blob/master/Source/TensorFlow/Private/TensorFlowBlueprintLibrary.cpp#L141).

@stevecox1964
Copy link

I will take a look at your links. Thanks for your effort.

@Yimi81
Copy link

Yimi81 commented Mar 7, 2024

Does anyone know how to establish a connection between UMG and JS? #342 I hope the design of the UMG interface is completed in the blueprint, but the corresponding logic is written in the JS layer. I refer to https://github.com/ncsoft/Unreal.js/wiki/Override-Blueprint-Function, The function in the blueprint cannot be override in the JavaScript layer through the following code

class MyTestWidget extends WidgetBlueprint.Load('/Game/Test/MyWidget').GeneratedClass{
    // MyWidget is a UMG inherited from JavascriptWidget, Create in editor
    // Override, but no effect
    Test() {
        console.log("Press Button From Javascript")
    }
}

function main()
{
    let widget = GWorld.CreateWidget(JavascriptWidget, PC)
    widget.JavascriptContext = Context
    widget.bSupportsKeyboardFocus = true
    widget.bIsFocusable = true

    let Test = new MyTestWidget()
    widget.SetRootWidget(Test)
    widget.AddToViewport()
}

The following method is even more incorrect, and UMG will not display properly:

class MyTestWidget extends WidgetBlueprint.Load('/Game/Test/MyWidget').GeneratedClass{

    // Override an event which was declared in Blueprint
    Test() {
        console.log("Press Button From Javascript")
    }

}

function main()
{
    let PC = GetPC()

    let TestWidget_C = require('uclass')()(global, MyTestWidget)
    let widget = GWorld.CreateWidget(TestWidget_C, PC)
    console.log(JSON.stringify(widget))
    widget.AddToViewport()
}

@getnamo
Copy link

getnamo commented Mar 8, 2024

In the hierarchy it's usually c++ > blueprint -> Javascript so blueprints can inherit and override c++ classes and JavaScript can inherit blueprints and c++ classes, but it doesn't go the other way.

If you want to call a function implemented in JavaScript from blueprint use inheritance to make a base function that the js layer implements in it's subclass. You can't inherit from Js defined class in blueprints but you can build common API via interfaces or inheritance that you can call.

JavaScript overrides do work, just make sure WidgetBlueprint.Load('/Game/Test/MyWidget').GeneratedClass resolves to a valid class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants