[OPTing] OPTech v2

Want to edit the game, build your own craft and missions? Here you'll find help, tools, guides and people to discuss with.
Post Reply

Re: [OPTing] OPTech v2

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 13746
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Mon Jan 03, 2022 8:36 am

Great work, Jeremy! All seems to work well now, thank you!

The idea of adding a confirmation dialog to the Reset functions is ingenious! Simple but effective!
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 13746
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Fri Jan 07, 2022 8:01 am

Hmm, there's one issue remaining:
The Visibility checkbox works now, however, it functions very slow. If you try to hide or show a large number of meshes, the program stalls for several seconds.

One more thing, though I'm not sure if and how it can be fixed:
How is the zoom factor calculated in the various model views? It seems in some views(top/Bottom) the model properly fills the screen while in others I still have to manually zoom in
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 13746
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Sun Jan 16, 2022 7:00 pm

@JeremyaFr could you take another look at this, if you get the chance? The latest changes work well but I think the performance has taken a serious hit. Along with the issue mentioned above, also the preview window is very slow to react, especially with more complex models. Maybe a case of memory leak?

Edit: OK after working with it over a longer time, I'm sorry to say but the selection box is still bugged. If you select several meshes with CTRL then use the Hide checkbox, it will affect other meshes further up the list as well. Also there are instances where I cannot unhide a specific mesh via its individual checkbox.
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

User avatar
JeremyaFr
XWAU Member
Posts: 3289
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Jan 30, 2022 7:38 pm

UPDATE

Hello,
I've updated OPTech.

I've improved the performance of the mesh visible checkbox.

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 13746
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Sun Jan 30, 2022 10:12 pm

Thank you Jeremy! I've been working with the new version for a few hours now and everything seems to work fine now!
Sorry for being a pain :)
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

Rookie_One1
Rebel Alliance
Posts: 1599
Joined: Thu Feb 26, 2004 12:01 am

Post by Rookie_One1 » Sun Mar 27, 2022 2:05 am

Have a weird bug, i'm trying to do a simple rotation of a cockpit opt (the family transport gunner one, for underneath), and i'm ending with the view as thrash (i'm using optech because it's permit moving the whole assembly instead of having to rotate individual parts and move them in position)

Anyone have an idea on what could cause that ?

Here what happens :
https://imgur.com/dLpGORq

For the record, the problem look like it lie with the MainHull mesh, but i'm not sure about what could cause that issue
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 13746
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Sun Mar 27, 2022 10:56 am

Did you make sure the coordinates are correct, i.e. the meshes are in the right spot?

Also, if you rotate one or more meshes, I think it will use the last mesh selected as the center of the rotation.
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

Rookie_One1
Rebel Alliance
Posts: 1599
Joined: Thu Feb 26, 2004 12:01 am

Post by Rookie_One1 » Sun Mar 27, 2022 6:37 pm

meshes are in the right spot, but the last mesh selected is mesh 4, i'll try to select mesh 1 and see what happens
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death

User avatar
JeremyaFr
XWAU Member
Posts: 3289
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat May 07, 2022 3:53 pm

UPDATE

Hello,
I've added 2 tools to XwaToolsDownloader:
- XwaOptFlatTexturesFixer
- XwaOpzTrianglesFixer

The source code of these tools is on GitHub.

XwaOptFlatTexturesFixer is a tool to fix flat textures in opt files.
XwaOpzTrianglesFixer is a tool to fix triangles in OPTech opz files.

These tools were created while developping OPTech.

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 13746
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Sat May 07, 2022 8:29 pm

Interesting.
Exactly what do these tools do? Are those OPTech functions which you "exported" into standalone programs?

- I'm guessing FlatTexturesFixer resets the texture coordinates on faces with flat textures to 0,0,1,1?
- TIs the TrianglesFixer the same as the tools in OPTech used to convert tris to quads and vice versa? Or does it fix Tris with 4 vertices which is a common issue with models coming from certain 3d programs like Rhino 3D?
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

User avatar
JeremyaFr
XWAU Member
Posts: 3289
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun May 08, 2022 7:14 am

FlatTexturesFixer removes faces with flat textures. It's a feature that has then been included into OPTech.

Code: Select all

        static bool HasFaceFlatTexture(Face face)
        {
            Indices tex = face.TextureCoordinatesIndex;

            if (tex.A == tex.B || tex.B == tex.C || tex.A == tex.C)
            {
                return true;
            }

            if (tex.D >= 0)
            {
                if (tex.A == tex.D || tex.B == tex.D || tex.C == tex.D)
                {
                    return true;
                }
            }

            return false;
        }
TrianglesFixer fixes triangles with 4 vertices.

Code: Select all

        static bool IsFaceTri(OpzFace face)
        {
            if (OpzVector3.Equals(face.VertexCoord0, face.VertexCoord3))
            {
                return true;
            }

            if (OpzVector3.Equals(face.VertexCoord1, face.VertexCoord3))
            {
                return true;
            }

            if (OpzVector3.Equals(face.VertexCoord2, face.VertexCoord3))
            {
                return true;
            }

            return false;
        }

Post Reply