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

Porting editor to Qt6 #217

Open
algts opened this issue Mar 11, 2023 · 12 comments
Open

Porting editor to Qt6 #217

algts opened this issue Mar 11, 2023 · 12 comments
Milestone

Comments

@algts
Copy link
Collaborator

algts commented Mar 11, 2023

Although editor is not actively developed, it has to be able to compile with modern versions of Qt.
Main issues with porting to Qt6 are:

  • QtOpenGL (and QGLWidget) are deprecated and removed from Qt6. Therefore main gl widget should be ported to QOpenGLWidget or some similar widget.
  • Gizmos are drawn using OpenGL 1. Although we can still work with that, it is probably better to use a more modern approach. Inventing gizmos one more time is imho unneccessary, it is probably better to integrate projects like im3d or imguizmo.
  • Regular expressions

What's done:

  • works fine on Qt6 (tested on Linux)
  • QGLWidget replaced with QOpenGLWindow. I've tried all ways I could imagine to replicate the previous algorithm that reparents the QGLWidget for import dialog, but failed (all types of glitches occur, from crashes to losing gl contexts, black main window and so on). Now it uses a more resource intensive variant that does not reparent gl widget, but dumps its contents as QImage and draws them on a custom widget through QPainter 10 times a second).
  • Regular expressions ported, seem to be working correctly (should be additionally tested)
  • Im3d integrated, gizmos work correctly, old opengl path not used

What's left:

  • transforming objects with im3d gizmos in local coordinates
  • remove legacy opengl path for gizmos and other cleanup - in progress
  • check lua code completion - done
  • test on Windows - done
@algts algts added this to the 2.1.0 milestone Mar 11, 2023
@gwald
Copy link
Contributor

gwald commented May 9, 2023

I would suggest the less dependencies the better, ie using H3D's internal Geometry data, but I'm unfamiliar with that TBH.

@algts
Copy link
Collaborator Author

algts commented May 9, 2023

I have already ported editor to Qt6 and almost integrated im3d. Everything almost works, some issues here and there, but overall its good. You can see the progress in my repo in editor_upgrade branch.

@gwald
Copy link
Contributor

gwald commented May 10, 2023

Cool :)
When it's ready for testing, put up a build 👍
Also, I was wondering about animation, it looks like the scene editor doesn't know about them?
It would be good if anims could be included, like a reference from the model, I'm not talking about a full Unity3d editor, just so the code can be made aware of anim file to model file link.
Oh and I forgot, handling vertex animation, morph targets.

@algts
Copy link
Collaborator Author

algts commented May 10, 2023

@gwald Yes, currently editor knows nothing about animations, but it provides lua bindings, so you can write a mini lua script that will launch the animation for your model (not the best approach, I know :) ).

@gwald
Copy link
Contributor

gwald commented May 11, 2023

I think I like adding extra information using group nodes in the editor :) ie:


 <Group name="anim" tz="12.85820" tx="0.00000" ty="0.00000">
        <Group name="model1" tz="0.00000" tx="0.00000" ty="0.00000">
            <Group name="/animations/model/run.anim" tz="0.00000" tx="0.00000" ty="0.00000"/>
            <Group name="/animations/model/walk.anim" tz="0.00000" tx="0.00000" ty="0.00000"/>
        </Group>
    </Group>

I have to test this approach.

What was the idea behind "Add Attachment"? It crashes for me, maybe remove it if not used.

The lua intellisesne feature isn't working for me 100%, I type Horde3d and the dot, I get all the listing, but it goes away when I type more.

When the mouse pointer is over the coordinate widget, it would be good if the axis arrow could change color (yellow?) or flash?, something that shows that I wont miss when I click on it :)

@algts
Copy link
Collaborator Author

algts commented May 11, 2023

"Add attachment" was used for game engine integration, so that game engine components get used/updated via horde3d.

I'll look into issue with lua code completion.

As for gizmos, axis highlighting would be there in the upgraded version :)

@gwald
Copy link
Contributor

gwald commented May 11, 2023

Cool thanks :)
Happy to test it when it's ready.
We've read the text of the old Horde3D Editor video here, it's not serious, but hopefully it's helpful and brings awareness: https://youtu.be/Sgko0Ak3JrA

@gwald
Copy link
Contributor

gwald commented May 16, 2023

The drag and drop in the scene tree create copies, I was expecting it to be moved, like in a local file browser, but I understand that would be the case most often, so that's okay.

I don't think there's a way of moving items tho?
Maybe add right click to move items?

Edit: cut and paste works as move.

@algts
Copy link
Collaborator Author

algts commented Sep 5, 2023

Porting to Qt6 seems to be done. There may be bugs here and there, but should be working at least.
Here is the windows build: https://www.sendspace.com/file/bkgcki

If you encounter some bugs, please post here, I'm not closing the ticket until all major bugs are gone.
P.S.: Pull request with source code is there: #221

@gwald
Copy link
Contributor

gwald commented Sep 9, 2023

thanks, I dont have a project which uses the editor yet, but I'll give it test.

@gwald
Copy link
Contributor

gwald commented Dec 22, 2023

I've been using it to create a simple scene, it works great.
I really like the extra handles on the objects

@gwald
Copy link
Contributor

gwald commented Dec 23, 2023

I uploaded your QT6 editor here but with the new fixed converter executable, (removes white spaces from the DAE file).
https://archive.org/details/algts-horde3d-editor-win-x64-march-2023

Direct link is: https://archive.org/download/algts-horde3d-editor-win-x64-march-2023/editor-qt6.7z

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

2 participants