Code Monkey home page Code Monkey logo

Comments (14)

chexiongsheng avatar chexiongsheng commented on May 24, 2024 1

我在5.2重现了,确实很奇怪的现象。都重新调用回c++了,参数却不对。

from puerts.

chexiongsheng avatar chexiongsheng commented on May 24, 2024

可以基于这个:https://github.com/chexiongsheng/puerts_unreal_demo
搞个可重现的例子吗?

from puerts.

slowmna avatar slowmna commented on May 24, 2024

chexiongsheng/puerts_unreal_demo@master...slowmna:puerts_unreal_demo:master
@chexiongsheng 提交了一个示例,把TS_Player拖到场景,TestMyActor拖到场景,运行后TestMyActor有个立方体。运行三次,分别不注释-注释-不注释,第一三次运行效果不一样
(开启这行后就不转了)
image

from puerts.

chexiongsheng avatar chexiongsheng commented on May 24, 2024

chexiongsheng/[email protected]:puerts_unreal_demo:master @chexiongsheng 提交了一个示例,把TS_Player拖到场景,TestMyActor拖到场景,运行后TestMyActor有个立方体。运行三次,分别不注释-注释-不注释,第一三次运行效果不一样 (开启这行后就不转了) image

好的,谢谢。
顺便问下,你这工程不删ReactUMG在ue 5.3能编译得过吗?我这会报引擎里的Widget.h有语法错误。

from puerts.

slowmna avatar slowmna commented on May 24, 2024

chexiongsheng/[email protected]:puerts_unreal_demo:master @chexiongsheng 提交了一个示例,把TS_Player拖到场景,TestMyActor拖到场景,运行后TestMyActor有个立方体。运行三次,分别不注释-注释-不注释,第一三次运行效果不一样 (开启这行后就不转了) image

好的,谢谢。 顺便问下,你这工程不删ReactUMG在ue 5.3能编译得过吗?我这会报引擎里的Widget.h有语法错误。

可以编过,不知道你报的什么错?

from puerts.

chexiongsheng avatar chexiongsheng commented on May 24, 2024

报的错误和这个一样:https://forums.unrealengine.com/t/is-including-widgetcomponent-h-no-longer-possible-in-5-3/1388339

你是自己编译的ue还是官方下载的?我是官方下载的5.3.2版本。

from puerts.

chexiongsheng avatar chexiongsheng commented on May 24, 2024

还有个区别是你的工程在我这里编译还会报错找不到UStaticMeshComponent和UStaticMesh,得加相关的头文件。
这个可能和你那能编译有点关联,感觉是你那自动include了很多文件。
Widget.h报错可能缺了某个头文件。

from puerts.

chexiongsheng avatar chexiongsheng commented on May 24, 2024

我用的是vs2022

from puerts.

chexiongsheng avatar chexiongsheng commented on May 24, 2024

另外,我跑你那demo好像也没看到立方体,更没看到转。

from puerts.

slowmna avatar slowmna commented on May 24, 2024

另外,我跑你那demo好像也没看到立方体,更没看到转。

你已经解决了报错对吗?我首次出现是在官方Lyra工程,使用编译的5.3官方引擎。 后续这个demo复现用的是5.1官方安装版引擎,都未出现include报错。
立方体需要手动将Content/Blueprints/TestMyActor拖到你的场景中,我没有提交场景。启动后F8脱离控制双击大纲中TestMyActor定位查看
image
然后将Content/Blueprints/TypeScript/下的TS_Player拖到场景中,参照我前面说的修改TS_Player脚本测试。

from puerts.

chexiongsheng avatar chexiongsheng commented on May 24, 2024

Widget.h的报错只在5.3有,而且删了reactumg就可以了。这个报错我试过起一个新的空工程,搞个类继承UUserWidget就会有同样的报错。
比5.3低的都不会报错。

from puerts.

chexiongsheng avatar chexiongsheng commented on May 24, 2024

另外,我跑你那demo好像也没看到立方体,更没看到转。

你已经解决了报错对吗?我首次出现是在官方Lyra工程,使用编译的5.3官方引擎。 后续这个demo复现用的是5.1官方安装版引擎,都未出现include报错。 立方体需要手动将Content/Blueprints/TestMyActor拖到你的场景中,我没有提交场景。启动后F8脱离控制双击大纲中TestMyActor定位查看 image 然后将Content/Blueprints/TypeScript/下的TS_Player拖到场景中,参照我前面说的修改TS_Player脚本测试。

我是拖到场景了,没看到立方体,可能是我用5.3打开不兼容吧。也没看到转,我也没看到你哪里写逻辑让它转呀。是不是漏提交东西了?

from puerts.

slowmna avatar slowmna commented on May 24, 2024

最新的提交里有这个啊, 我昨天还特意检查了下,MyActor.cpp,
chexiongsheng/puerts_unreal_demo@master...slowmna:puerts_unreal_demo:master
image

from puerts.

chexiongsheng avatar chexiongsheng commented on May 24, 2024

你试试,我这里测试没问题了。

这问题是ue我认为不合理的一些设计导致的。

首先参数读取调用FFrame::StepCompiledIn,如果FFrame::Code不为空就执行(蓝图)指令,空就就通过反射获取。没mixin前是后者(原生实现也会用反射读参数?性能不太好)。

FFrame::Code是来自UFunction::Script.GetData(),比较坑的来自这里,Script是一个TArray,mixin的时候我把它保存,unmixin的时候我恢复到原来的UFunction里头,逻辑上没错。但一个空TArray没插入过任何数据GetData()返回为nullptr,但如果这个空TArray用另外一个空TArray赋值后,GetData()就不为nullptr了。也就是同样是元素为0,GetData()返回是不确定的,但FFrame::StepCompiledIn却依赖了这不确定。
如果是我,至少FFrame::Code的初始化应该改为Code = Scripts.Num() ? Scripts.GetData() : nullptr;

from puerts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.