MshViewer 2.0 [Version 1.2.1]

Working on a new map? Have a new mod out for swbf2?! Post an announcement of the up-coming release here.

Moderator: Moderators

Master of the Force
User avatar
Posts: 4515
Joined: Sat Sep 19, 2009 11:37 am
Location: Mos Espa (germany)
Projects :: Republic Commando Side Mod
Xfire or Steam user: gtanakin

MshViewer 2.0 [Version 1.2.1]

Postby Anakin » Wed Nov 09, 2016 12:51 pm

Hey,

i'm not sure if this is the right section, but it is WIP and i hope it's about 50% done.

So what is it about?
You may already know that i'm working on an own mesh viewer since the functions of the old one is really limited and there are functions i don't like or i miss.

What is the different to the old MeshViewer?
I don't know what language was used for the old one, but i'm using C++ with OpenGL. The benefit of OpenGL is, that it can be used as game engine, so it's also possible to display render flags, such as bump maps or animations.

Wait, we can view all animations on every unit with this viewer??
Actually it is possible to do this. But i will first concentrate on the basics. Display all mesh correctly.

How can i help?
At the moment i'm working on the basics, but i plan to enable addon support. So you can write your own functions for this viewer. For example addon hex editing.

What is done, what need to be done?
I learned about OpenGL and i already can read in tga files and the mesh file. But at the moment it's limited to triangulated mesh with only one model and texture.

I want to test this awesome project!
I hosted the whole project on gitlab: https://git.rwth-aachen.de/carstenf/OpenGL/tree/master
The 3D Viewer was just for testing OpenGL. If you know how to program you can need to import the MeshViewer Project. It's a Visual Studio 2015 Project.
If you just want to test whether the project is running on your system or not, just download the release folder and run the exe.

If the viewer is not running on your system, please let me know the error message and your system information.


Any help or suggestions are always welcome.

EDIT
i wonder whether the OpenGL project works for you, since i worked on a different pc today and it didn't because there was only OpenGL 2.1 :-/

So please check the release thread:
https://git.rwth-aachen.de/carstenf/OpenGL


How to build the latest version by your own from the source:

================UPDATE================
Go and and download the updater from the release thread.
=====================================

Hidden/Spoiler:
go to https://git-scm.com/download and download git for your system. On my test system i'll use Windows 32 bit.
Image
i use the default settings
Image

all right, now get qt at https://www.qt.io/download-open-source/. Skip the Qt Account window and choose these settings
Image

now you make a new emty qt project. Go to File>new. Choose other projects>empty qmake-project
Image
and save it somewhere on your harddrive. I'll choose C:/Users/Anakin/workspace/
name your project QtMeshViewer
Image
and klick next until you are done.

open QtMeshViewer.pro and add this:
Code: Select all
QT          += core gui opengl
CONFIG += c++11
LIBS += -lopengl32
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = QtMeshViewer
TEMPLATE = app


================UPDATE================
Place the .bat file at
C:\Users\Anakin\workspace (remember your path here)
run the exe with the parameter src the first time.
Skip everything between the "===" lines
=====================================

now open a command promt (cmd) and enter the following lines

cd C:\Users\Anakin\workspace (remember your path here)
git init
git remote add origin -f https://git.rwth-aachen.de/carstenf/OpenGL.git
git config core.sparsecheckout true
echo QtMeshViewer/*> .git/info/sparse-checkout
git pull origin master

Image

=====================================

now you go back to Qt Creator, right klick on the project>add existing file (you need to do it multiple times) and choose:
../QtMeshViewer/main.cpp
../QtMeshViewer/Source/* (you can choose all of them at once)
../QtMeshViewer/Header/*
../QtMeshViewer/Form Files/*
../QtMeshViewer/Resources/Resources.qrc

Now you need to go back to the .pro file and change this
Code: Select all
FORMS += \
    Form Files/FileInfoWindow.ui \
    Form Files/MainWindow.ui \
    Form Files/SettingsWindow.ui


to this

Code: Select all
FORMS += \
    "Form Files/FileInfoWindow.ui" \
    "Form Files/MainWindow.ui" \
    "Form Files/SettingsWindow.ui"


finaly press the green run button in the lower left corner.

================UPDATE================
to get the latest build just run the updater. No need to pass
src to it again. You can just double klick it.
=====================================
If you want to get the latest build, go to your console, browse your location and repeat the last command
git pull origin master
=====================================

If i add any new files you need to add them to the project like you did above
Last edited by Anakin on Sun Feb 05, 2017 9:57 am, edited 11 times in total.

Resistance Leader
User avatar
Posts: 4699
Joined: Tue Feb 09, 2010 8:43 pm
Location: Greater Seattle Area
Projects :: Mass Effect Unification
Games I'm Playing :: Warframe+DOOM+MEA
Xfire or Steam user: Marth8880 (both) (AQT is cool)
xbox live or psn: Marth8880

Re: MesViewer 2.0

Postby Marth8880 » Wed Nov 09, 2016 5:21 pm

@Anakin: The repo seems to be private (or just gone).

Hidden/Spoiler:
Image

Image

Master of the Force
User avatar
Posts: 4515
Joined: Sat Sep 19, 2009 11:37 am
Location: Mos Espa (germany)
Projects :: Republic Commando Side Mod
Xfire or Steam user: gtanakin

Re: MesViewer 2.0

Postby Anakin » Wed Nov 09, 2016 6:05 pm

You haven't checked the new link ;)

I'm no longer on github. I moved to gitlab

Resistance Leader
User avatar
Posts: 4699
Joined: Tue Feb 09, 2010 8:43 pm
Location: Greater Seattle Area
Projects :: Mass Effect Unification
Games I'm Playing :: Warframe+DOOM+MEA
Xfire or Steam user: Marth8880 (both) (AQT is cool)
xbox live or psn: Marth8880

Re: MesViewer 2.0

Postby Marth8880 » Wed Nov 09, 2016 6:19 pm

Lolz whoops, my bad.

Alright, so I'm trying it out and it seems to run fine, but is there a way to open a msh file yet? I've tried dragging and dropping one onto it (which I saw is on your to-do list) but it doesn't seem to do anything, so I assume not.

Master of the Force
User avatar
Posts: 4515
Joined: Sat Sep 19, 2009 11:37 am
Location: Mos Espa (germany)
Projects :: Republic Commando Side Mod
Xfire or Steam user: gtanakin

Re: MshViewer 2.0 [Version 0.0.5]

Postby Anakin » Wed Nov 23, 2016 12:42 pm

Ähm, no the user interaction isn't done yet. I'm still working on the import and display function. Need to figure out how to import cluster and their textures. Then I need to go trough the structure and apply the translation matrix of all parents as well.
And then I can think of the user interaction. But if you name your mesh file multipleModTex and replace the one in the release folder you can try to display other mesh.

==EDIT==

you want it? you get it :D

I just updated the release folder. Now you can drag n drop files. I tested a few swbf2 assets but non worked for me. There seams to be lot of untriangulated things. And for now i only support triangulated mesh.


==UPDATE==

new features coming with the next release:
- cluster support (textures are mixed for some reason),
- nulls, bones, shadow mesh and hidden models are no longer displayed,
- reset view when loading a new mesh,
- reset view when pressing space
- faster code (frame update is about 19,6% faster, loading mesh is about 15,1% faster, overall from beginning to the first draw about 8,6% faster )

==NEW VERSION==/carstenf/OpenGL/tree/master

Features:
- reset view before loading new mesh
- reset view when pressing space
- clustered msh can be displayed
- shadow mesh, nulls, bones, hidden things are no longer displayed
- now mulitpolygons can be displayed
- fasten and improved code
Bugs:
- cluster mixed up textures,
- at most mesh only every 2nd triangle is displayed,
- triangulation is not very good (DarthDUCK's Proton charge)

Feel free to test it :D


== BETA RELEASE ==

Download

All right, here you go. It should be stable so far. Just ignore the first error message that says something about missing msh file.
Simple drag and drop a file.
Navigation:
left mouse > rotation
right mouse > move
scroll > zoom
+/- > fasten the movement
space > reset view

Please give feedback about missing features or bugs

Resistance Leader
User avatar
Posts: 4699
Joined: Tue Feb 09, 2010 8:43 pm
Location: Greater Seattle Area
Projects :: Mass Effect Unification
Games I'm Playing :: Warframe+DOOM+MEA
Xfire or Steam user: Marth8880 (both) (AQT is cool)
xbox live or psn: Marth8880

Re: MshViewer 2.0 [Version 0.0.5]

Postby Marth8880 » Wed Nov 23, 2016 8:06 pm

It's definitely improving! Great work so far. :thumbs:

Thoughts for now:
- Camera pivot point should be based on the center of the mesh's bounding box. Currently, it seems to be based on the mesh's center of geometry.
- When the camera is panned around, its pivot point should move with it.
- Application begins to lag when higher-poly meshes (>2,500 triangles) are loaded.
- Models need lighting haha

Master of the Force
User avatar
Posts: 4515
Joined: Sat Sep 19, 2009 11:37 am
Location: Mos Espa (germany)
Projects :: Republic Commando Side Mod
Xfire or Steam user: gtanakin

Re: MshViewer 2.0 [Version 0.0.5]

Postby Anakin » Thu Nov 24, 2016 2:57 pm

Thank you marth :D

You are right i'm using the scene center. But i just looked in the documentation about the bbox and i think, that's easy.
About the lag when loading higher polys, i just changed the texture load function to only give pointer. But i noticed there is data garbage left when closing the software. It's not from my latest changes for the texture loading. So i need to figure out where the garbage is created and where to free it. Then i'll change the object loading itself to use pointer as often as possible too. That way i never need to copy data.

Can you explain the lags a bit? Does it crash, or is it slow? And is it only while loading or after loading, too??

1st Warning
User avatar
Posts: 373
Joined: Mon Jul 04, 2016 10:56 pm
Location: STRAYA MATE
Projects :: Yavin Valley of Ruins
Games I'm Playing :: SWBF1 SWBF2
Xfire or Steam user: SkinnyODST
xbox live or psn: Skinny ODST

Re: MshViewer 2.0 [Version 0.0.5]

Postby SkinnyODST » Sat Nov 26, 2016 12:29 am

Doesn`t work. It says "MSVCP140.dll" is missing from my computer.

Gametoast Staff
User avatar
Posts: 4842
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA
Projects :: Republic Commando - Battlefront

Re: MshViewer 2.0 [Version 0.0.5]

Postby AQT » Sat Nov 26, 2016 1:40 am


Master of the Force
User avatar
Posts: 4515
Joined: Sat Sep 19, 2009 11:37 am
Location: Mos Espa (germany)
Projects :: Republic Commando Side Mod
Xfire or Steam user: gtanakin

Re: MshViewer 2.0 [Version 0.0.6]

Postby Anakin » Fri Dec 02, 2016 8:21 am

Is there someone else, who needs the VS runtime enviroment?? Then i'll include it in the final version.

For now, here is a new release version. Give it a try! it should be much faster then the old version. Opening multiple files should not hurt the performance and even cloth is displayed. Not completely but it is displayed. Furthermore i added some features requested by Marth. For example everything is displayed in the FOV when opening.
Full changelog:

Code: Select all
Features:
- performance improvement,
- code improvement,
- move the model to the center,
- scale everything to 1,
- do not open a default file for release build
Bugs:
- cloth is not displayed correctly,
- turning in the wrong x direction when model is turned 180° in y direction,
- consular class corvette is not displayed,
- rep_weap_LJ-50 is not displayed correctly


For the next version(s) i'm gonna:
- rework my data to improve the loading time and needed memory,
- fix the x rotate direction when turning the model 180° in y direction,
- fixing the cloth problem
- adding some buttons to display some information
- adding light,
- bump/normal/specular map support,

I need to know what kind of information is interesting for you. (texture names?, triangle count?,...) Please let me know what you wanna know.
Do you need a button to open a file? Or do you only need the drag/drop function?


Download

Sergeant Major
User avatar
Posts: 232
Joined: Mon Apr 27, 2015 7:09 pm
Location: New England
Games I'm Playing :: SWBF2

Re: MshViewer 2.0 [Version 0.0.6]

Postby Oceans14 » Sat Dec 03, 2016 2:20 pm

It says my GPU doesn't support Open GL 4.5. (nVidia quadro nvs 4200m, win7 pro x64). I'll look around for driver updates, although I just installed one a few weeks ago.

For features, I use texture names and tri count a lot. Drag n drop is fine for input. I think it would be helpful to have the ability to toggle on/off hidden components like nulls, bones, shadowvolume, collision, etc. Maybe those could be flat shaded in different colors or something? For example, most of the nab2 buildings have collision that extends well above the visible mesh, and it would be cool to be able to see this in the viewer. And being able to quickly get the location of nulls for attaching effects would be extremely useful.

Another feature that may or may not be useful is a grid centered at 0,0,0 like in xsi. Idk how useful it would really be, but I just had the thought and figured I'd share it.

Master of the Force
User avatar
Posts: 4515
Joined: Sat Sep 19, 2009 11:37 am
Location: Mos Espa (germany)
Projects :: Republic Commando Side Mod
Xfire or Steam user: gtanakin

Re: MshViewer 2.0 [Version 0.0.6]

Postby Anakin » Sun Dec 04, 2016 7:05 am

Try to run it from console with the parameters 3 5

so you type
Code: Select all
MshViewer.exe 3 5

Sergeant Major
User avatar
Posts: 232
Joined: Mon Apr 27, 2015 7:09 pm
Location: New England
Games I'm Playing :: SWBF2

Re: MshViewer 2.0 [Version 0.0.6]

Postby Oceans14 » Sun Dec 04, 2016 10:21 pm

Anakin wrote:Try to run it from console with the parameters 3 5

so you type
Code: Select all
MshViewer.exe 3 5

Actually I forgot my laptop has dual graphics, and apparently the low performance intel chip was trying to run it. Switched over to the nVidia and it works like a charm with 4.5

Master of the Force
User avatar
Posts: 4515
Joined: Sat Sep 19, 2009 11:37 am
Location: Mos Espa (germany)
Projects :: Republic Commando Side Mod
Xfire or Steam user: gtanakin

Re: MshViewer 2.0 [Version 0.0.6]

Postby Anakin » Wed Dec 07, 2016 11:53 am

Great :D

And i have good news. I'm gonna switch to Qt library and i hope i get this working with OpenGL ES 2.0. That way it should theoretically work even on your mobile phone :D


Just one question. I'm looking for an program icon. I thought of an Imperial Commando Helmet. Do you prefer the red or blue visor??
displayed in my Mesh Viewer :D (but the red visor is rendered in XSI and photoshoped)

Hidden/Spoiler:
Image

Private Recruit
User avatar
Posts: 17
Joined: Sat Aug 23, 2014 8:09 pm

Re: MshViewer 2.0 [Version 0.0.6]

Postby Troha » Wed Dec 07, 2016 9:42 pm

Blue Visor

Master of the Force
User avatar
Posts: 4515
Joined: Sat Sep 19, 2009 11:37 am
Location: Mos Espa (germany)
Projects :: Republic Commando Side Mod
Xfire or Steam user: gtanakin

Re: MshViewer 2.0 [Version 0.1.0]

Postby Anakin » Tue Jan 03, 2017 9:46 am

Hi,

it's been a while since the last update. The reason for that is, i changed my library from glew to Qt. It's more powerful and allows much more window adjustments.
So this new release does not feel much new to you since most new things are behind the scene in the source code.

Code: Select all
Features:
-changed library,
-new interaction,
-new software icon,
-rotation bug fixed,
-cloth bug fixed,
Bugs:
-rle compressed tga not working.
-old assets are not displayed correctly,


Mainly there is one big problem. Some mesh are not displayed correctly. I don't know why. When i load them into XSI and reexport through ZETools everything is displayed correctly. I'm gonna search that bug and hopefully will fix it in the next release. The other problem is that Qt does not support RLE compressed tga files. So i'd like to ask you to use this new version and check if there are many assets with rle compressed tga files. You can fix it by simply open the tga and save without rle.
If there are many rle conflicts i'll see if i can add the rle support again.

(tipp: to rotate in Z direction hold the mouse and draw circles ;) )

Source
Download

Private Second Class
User avatar
Posts: 66
Joined: Sat Feb 18, 2012 5:36 am
Location: Germany
Projects :: Caron Prime - Liberation Action
Games I'm Playing :: SWBF2 SWRC

Re: MshViewer 2.0 [Version 0.1.0]

Postby Luke » Sat Jan 07, 2017 1:58 pm

I'm not sure, but I think Battlefront also doesn't support RLE compressed .tga files, because if I you compress them you'll get an munge error.
If that's right, you wouldn't need to add the rle support.

Master of the Force
User avatar
Posts: 4515
Joined: Sat Sep 19, 2009 11:37 am
Location: Mos Espa (germany)
Projects :: Republic Commando Side Mod
Xfire or Steam user: gtanakin

Re: MshViewer 2.0 [Version 1.0.1]

Postby Anakin » Tue Jan 17, 2017 1:08 pm

There were textures not working but i noticed that they were not compressed. I simply added my old texture load function if QImage cannot read it my old load will try :D

So and here you go the first full release version:
Features:
- status messages while import,
- fixed triangulation,
- rle and 24 bit image support (normally qt should support 24 bit, too),
- rotation can be limit to the directions,
- added fileinfo,
- performance,
Bugs:
- nothing known

@Marth no there is no light yet

Release thread

==UPDATE==

So since there won't be a new release so fast, i continue here in my WIP thread.

@Marth you are a nettler (i mean this in a friendly way :D) and here you go:

Hidden/Spoiler:
Image


Don't ask me why the wireframe does not work 100%. You can see the problem when you look at a cube:
Hidden/Spoiler:
Image

If the paint function needs the vertice in a different storage i cannot promise that i'll keep this feature. What do you think about the Color? would you prefer solid black or the way it is (from the texture)

So what's new?
- new icons,
- screenshot function with transparent background
- transparent materials are supported
- wireframe paint option (not working very good - see the cube example)
- basic information printed to the scene
- new info window, that always stay on top, can be resized and has scroll area

==EDIT==

fixed wireframe bug


==TEASER==

just hardcoded atm. Need to be user controlled and some more specular (diffuse only atm)
Hidden/Spoiler:
Image


good news @Marth. I think you'll get painted light :D But only after i made a settings window. Btw, what kind of light do you want?? Spot, candle, strait,..??

Resistance Leader
User avatar
Posts: 4699
Joined: Tue Feb 09, 2010 8:43 pm
Location: Greater Seattle Area
Projects :: Mass Effect Unification
Games I'm Playing :: Warframe+DOOM+MEA
Xfire or Steam user: Marth8880 (both) (AQT is cool)
xbox live or psn: Marth8880

Re: MshViewer 2.0 [Version 1.0.1]

Postby Marth8880 » Tue Jan 17, 2017 7:07 pm

Awesome! Great work so far! :thumbs:

Anakin wrote:Btw, what kind of light do you want?? Spot, candle, strait,..??

Just a single directional light.

Master of the Force
User avatar
Posts: 4515
Joined: Sat Sep 19, 2009 11:37 am
Location: Mos Espa (germany)
Projects :: Republic Commando Side Mod
Xfire or Steam user: gtanakin

Re: MshViewer 2.0 [Version 1.0.1]

Postby Anakin » Sat Jan 21, 2017 12:22 pm

You'll be able to change between point and directional, once i added a settings window.

For now take this:
Hidden/Spoiler:
Image


What's new:
- the light now supports ambient and specular,
- gui changes (button hover, checked),
- zoom speed can be adjust,
- a lot of other things, but i'm too lazy to list them all now.


Is there someone who wants to test a few things that i've implemented, but haven't test now?? You'd need to make some test mesh files and test if the tool reads the material properties correctly.

Next

Return to SWBF2 Map/Mod Works In Progress

Who is online

Users browsing this forum: Bing [Bot], clonetrooper163 and 2 guests