-
Notifications
You must be signed in to change notification settings - Fork 102
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
Animcomposer and external change refactor #316
Conversation
Since I don't know how to make a checklist option, I added an option to either apply all data or only the mesh data (or none). Should satisfy most needs. I don't like that it loses the option to select whether to only apply mesh and animation data (like before) |
Not sure what happened here, I must have missed adding a couple of files before committing, then made a hard reset of the branch because they were missing locally too. The dangers of context switching I guess. |
Pause this for a bit. I found an issue while testing. |
I hadn't checked before that animations actually worked, just that they had been updated. I've fixed that now, however, they don't work in the scenecomposer (without reloading the j3o). My guess is that the JmeAnimComposer needs to be updated with the cloned AnimComposer. Since you're the author, @MeFisto94, is there a convenient method of doing such things? Edit: I've sort of semi-verified that it's something like that, by not deleting the old AnimComposer and just cloning the fields unto it. That could be a work-around, but I'm unsure if it could cause other issues, since the old code relies on deleting all controls for the node tree. |
I don't remember too much of it, just that the So instead of trying to change stuff in there, I guess the official way would be to kinda reload the node tree in some way (but I don't remember API specifics there) |
I did look for a way to refresh the node tree. I assumed there would be a
similar problem with other things, but didn't find it. I'll give it another
try, though.
…On Sun, 1 May 2022, 20:23 MeFisto94, ***@***.***> wrote:
I don't remember *too much* of it, just that the JmeXyz are counterpart
to engine Xyz classes and basically are mostly there for having Java Bean
Properties and a tree structure. We had this refreshChildren thing on
JmeNodes or something, but I don't know if it fixes that. Technically, the
cloned AnimComposer is a new AnimComposer that should have a new
JmeAnimComposer that is then put into this tree hierarchy and refreshed, I
think.
So instead of trying to change stuff in there, I guess the official way
would be to kinda reload the node tree in some way (but I don't remember
API specifics there)
—
Reply to this email directly, view it on GitHub
<#316 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB46MQWMAVTU5HPOQ4Q43CTVH24YRANCNFSM5RUTRLKA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Looking at #83 this should be possible. |
Fixing a couple of codacy issues, but probably introducing more.
I think this is finally done. It's not an elegant solution, but at lest it seems to work. If someone wants to test it:
|
I'd love if someone would help in testing this PR :) I'll still need to review it, but since it's rather large, I probably need to schedule some time for it |
It may not be as big as it looks. Most of the code for Mesh and Animation transfer is taken from SpatialUtil, only broken out into separate classes, and Material and Transform transfer is built on the same "pipeline". |
jme3-core/src/com/jme3/gde/core/util/datatransfer/MeshDataFromOriginal.java
Outdated
Show resolved
Hide resolved
@MeFisto94 If you want to, we could try scheduling an hour and do the review together. Regarding testing, perhaps we can push out a beta to let others try it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, there are just a few things that need fixing and those mostly apply to all classes from the datatransfer packet: Wrong LogLevel Imports and maybe considering giving them a different name. They may not come from your PR directly, but I guess we can fix them easily anyway
jme3-core/src/com/jme3/gde/core/util/datatransfer/TransformDataFromOriginal.java
Outdated
Show resolved
Hide resolved
jme3-core/src/com/jme3/gde/core/util/datatransfer/TransformDataFromOriginal.java
Outdated
Show resolved
Hide resolved
jme3-core/src/com/jme3/gde/core/util/datatransfer/MeshDataFromOriginal.java
Outdated
Show resolved
Hide resolved
jme3-core/src/com/jme3/gde/core/util/datatransfer/MeshDataFromOriginal.java
Outdated
Show resolved
Hide resolved
if (animComposer != null) { | ||
final Spatial mySpatial = finder.find(root, spatial); | ||
if (mySpatial != null) { | ||
//TODO: move attachments: have to scan through all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we create an issue for that and maybe mention that in the TODO comment and vice versa?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is an old comment, but I think it's still valid. But it's probably a rare use case.
I'd like some opinions on this. Primary goal is to replace AnimComposer when updating the gltf, which it seems to do, although you need to reopen the .j3o to see it.
But mostly I'd like to know your thoughts on the refactoring. I'm thinking it can be taken further and maybe have a selectable list of transfers the user might want to do, rather than automating everything. It's out of scope for now though.