Unreal.js icon indicating copy to clipboard operation
Unreal.js copied to clipboard

Unreal 5.3 support

Open tvortsa opened this issue 1 year ago • 10 comments

Hello! Is it planned to support version 5.3 ?

tvortsa avatar Oct 22 '23 15:10 tvortsa

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.

stevecox1964 avatar Nov 10 '23 16:11 stevecox1964

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

devttebayo avatar Dec 09 '23 18:12 devttebayo

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.

getnamo avatar Dec 19 '23 21:12 getnamo

Thank you very much. I will take a look.

On Tue, Dec 19, 2023 at 3:01 PM Jan Kaniewski @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/ncsoft/Unreal.js/issues/340#issuecomment-1863466241, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACKS5P2VQ5LGYVJ2P5I2HRTYKH6DNAVCNFSM6AAAAAA6K7FNZGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRTGQ3DMMRUGE . You are receiving this because you commented.Message ID: <ncsoft/Unreal. @.***>

stevecox1964 avatar Dec 20 '23 01:12 stevecox1964

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

dariusznaurecki avatar Dec 23 '23 14:12 dariusznaurecki

How hard would it be or does code already exist for UnrealJS that grabs a camera render target and sends that data to another process. Preferably python and using socket_io

I have done this type of work a few years ago with Unreal/Python plugin/ZeroMQ but was wondering if it's easier in UnrealJS.

The use case is machine learning, think jupiter notebook talking to Unreal using UnrealJS.

Thanks

On Sat, Dec 23, 2023 at 8:59 AM dariusznaurecki @.***> wrote:

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.png (view on web) https://github.com/ncsoft/Unreal.js/assets/139545196/4858c17e-13b5-4d28-8f6b-d6b55616b635

— Reply to this email directly, view it on GitHub https://github.com/ncsoft/Unreal.js/issues/340#issuecomment-1868310852, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACKS5P4ATTPJXBH4TDMR2TDYK3WVVAVCNFSM6AAAAAA6K7FNZGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRYGMYTAOBVGI . You are receiving this because you commented.Message ID: <ncsoft/Unreal. @.***>

stevecox1964 avatar Jan 17 '24 19:01 stevecox1964

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).

getnamo avatar Jan 17 '24 20:01 getnamo

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

stevecox1964 avatar Jan 18 '24 21:01 stevecox1964

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()
}

Yimi81 avatar Mar 07 '24 08:03 Yimi81

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.

getnamo avatar Mar 08 '24 17:03 getnamo