DarioSamo / LibXenoverse

Dragon Ball Xenoverse Modding Tools
44 stars 83 forks source link

Debug Ogre dll and lib #10

Open Olganix opened 9 years ago

Olganix commented 9 years ago

Hi DarioSamo. Could you compile and put the Ogre Debug dll and libs ? I can't use Debug version of Xenoviewer becuse Ogre crash on Root initialisation. To have Ogre work in debug, It's depends a lots between configurations on Ogre (SIMD, ... all CMAKE configuration), and when you take Ogre on mercurial. So I need yours version. Could you give also the preprocessors used in Debug version of OgreMain ? (Root crash on initialisation if there is'nt exactly the same _DEBUG, DEBUG or NDEBUG define on projet witch use OgreMain in Ogre version 2.0, because there is a lot of #ifdefine on that , for memory trace and others things like that).

DarioSamo commented 9 years ago

OgreMain Debug was compiled with the following pre-processor flags: WIN32;_WINDOWS;_DEBUG;DEBUG;OGRE_NONCLIENT_BUILD;FREEIMAGE_LIB;_MT;_USRDLL;CMAKE_INTDIR="Debug";OgreMain_EXPORTS;

The PDBs are far too big for git tho, so it might be a better idea to consider doing some separate binary packages. I haven't really found much use of the Debug version of Ogre so far since only Xenoviewer uses a very small subset of its routines. Also worth mentioning I didn't really configure the Debug version on the sln yet, I don't really use it. (I figure it's better to let something like cmake handle that later if we ever get to using it)

In any case, the files you requested are now on the depends folder.

For reference: The guide I used to compile Ogre 2.0 is this: http://www.ogre3d.org/tikiwiki/tiki-index.php?page=CMake+Quick+Start+Guide. There's no reliance on the certain revision I pulled (just needs to be on the v-2-0 branch) so updating the dependencies should be fine.

Olganix commented 9 years ago

Thank a lot !!!!

My goal is to have a complet FBX file, to have animations and materials/shader on meshes in 3dsmax and Unity. Thinking about doing a personal mini game based on DBX's characteres :) .

I try your xenoviewer, I didn't have Skin on emd, but with emdfbx.exe I have skining on meshes in 3dsmax, So I will search to know why there isn't skin in Xenoviewer. Same : I will try to see where is the link between bones and animations. Note: I use the first charactere. I will also try yours debug function with Goku.

I'm trying yours libs and dll. Thank. See you.

Olganix commented 9 years ago

Ok I have a debug version of XenoViewer. I still have to change configuration of others projets (I have only config LibXenoverse and the viewer). Do you want the changes ? I never used Git before, but I used to SVN.

DarioSamo commented 9 years ago

I'd rather setup a CMake for those configurations to be generated automatically TBH.

As for Xenoviewer, you're supposed to import both the models and the skeleton, and then drag and drop the model into the skeleton. That's how you "skin" the model, it's not an unsupported feature. To preview the animations you just drag and drop the ean file into it and the animation pack should appear to the right. (Double click to play an animation)

Git works with forks and pull requests. You're supposed to make a fork of the repository, commit your changes there, and then do a pull request with your changes to the main repository.

As for your goal however, it doesn't sound like Xenoviewer would be very relevant to your interests other than just looking at how it uses some stuff. If you want more elaborate FBX exporting then I recommend looking into the emdfbx tool and EMDExportFBX.cpp.

Doing animation exporting would require extending the skeleton FBX exporting I imagine, which is in ESKFBX.cpp. The FBX SDK has a few examples on how to export node animation tracks, so it'd be a matter of exporting the data the EAN reads like that. The EAN class has a getInterpolatedFrame function built-in that could be used to export the animation tracks.

Olganix commented 9 years ago

Hi DarioSamo. I have allready look codes of projects to know how it's work. I realize that there is all stuff in XenoViewer : Skeleton, meshes, material, animations. So User could put everythings they want, do links with drag and drop and after just click on Menu->File->Export fbx. I see what you do on emdfbx.exe export, but there isn't material (there is standart one) and animations.

Sorry , I had too happy when I see Ogre::Root no crashing, but I still crash in debug with file->open operation. May be it's the Qt lib/dll not in debug. I will try to look at this.

Olganix commented 9 years ago

Ok with debug version of lib/dll of QT 5.4.1 all work. I will try to put that on Git.

Olganix commented 9 years ago

There is something strange on Git. I have all file modified. a lot have : "The text is identical, but the files do not match! The following differences were found : Newslines" May be is my visual studio 2013 community. Strange

Olganix commented 9 years ago

Ok after revert all file with "NewLines". Commit was good, but Push give me this error : "git did not exit cleanly (exit code 128) "

Olganix commented 9 years ago

I thinked when you make a clone, you also make a fork, but it's doesn't. So my problem is I couldn't push on "master" : "git.exe push -v --progress "origin" master:master remote: Permission to DarioSamo/LibXenoverse.git denied to Olganix. fatal: unable to access 'https://github.com/DarioSamo/LibXenoverse.git/': The requested URL returned error: 403 Pushing to https://github.com/DarioSamo/LibXenoverse.git git did not exit cleanly (exit code 128) (14118 ms @ 03/05/2015 14:53:44)"

I will try to fork, apply changes and commit and push again.

Sorry, it's the first time I use Git.

DarioSamo commented 9 years ago

I'm fairly new with git as well so I'm not sure where to help there. Maybe look at a few tutorials on how to use git first and try a more basic repository by yourself? You don't need much more than git pull, git push, git add ., git add . -u, git commit -m "commit message here". You can do the fork yourself and the pull request with github's web interface.

"So User could put everythings they want, do links with drag and drop and after just click on Menu->File->Export fbx." That is pretty much the plan yes, implementing the functionality emdfbx.exe does by using the list of files that have already been loaded.

"I see what you do on emdfbx.exe export, but there isn't material (there is standart one) and animations." Correct, the reason behind the lack of support for both of those are:

Materials: The materials in this game are VERY non-standard. They only look right in the previewer because I'm using the game's pixel and vertex shaders. I don't think we can accurately replicate the effect with FBX Materials sadly. We might need to find a way to bake the result into more standard textures somehow. The DYT textures are the ones that basically represent the base color depending on the normal of the polygon against the light direction, and a few of the other colors the shader might need (specularity, falloff, etc.). The index of the color used is determined by the EMM file.

Animations: There's no technical roadblock to implementing these hopefully. We just need to export it in order properly. Basically the nodes created by the ESK (or we can export the ESK that is inside the EAN) need to have track animations added on every frame depending on the result. How to calculate each frame can be seen on the EANOgre class. However, there's something I couldn't figure out yet on how to properly get the face bone animations working consistently.

Olganix commented 9 years ago

"The materials in this game are VERY non-standard. They only look right in the previewer because I'm using the game's pixel and vertex shaders" Yes I see it. "I don't think we can accurately replicate the effect with FBX Materials sadly." I think it"s possible because all material must have shaders now (since DirectX11, there isn't default material pipeline (to not have a shader) anymore like DirectX9, see papers on porting on Directx11). with a little googling : http://download.autodesk.com/us/fbx/20112/FBX_SDK_HELP/index.html?url=WS1a9193826455f5ff-150b16da11960d83164-6909.htm,topicNumber=d0e7849

Another way could be making default 3dsmax material file (not in .3DS or .max). I see you could say "there is that material on this mesh" in FBX, my be if we make and use the 3dsmax's material, we could replace material in 3dsmax. (but I not sur it's will change automatically, may be if you don't create default material in .fbx)

"We might need to find a way to bake the result into more standard textures somehow" dds is a standart for DirectX, and it's could be loaded by openGL. We must see if it's the same for FBX, or 3dsmax and Unity. Sadly I found we need au 3dsmax Nvidia plugins (free) to look at dds file. I think the first step is to use dds in fbx. I have a colleague witch allready have use a nvidia sdk to converte jpg and png in dds (with CUDA), and I think it's could do the same to convert dds in png. May be there a default exe witch could do that.

" The index of the color used is determined by the EMM file" Yes, I see that. I test \data\chara\APL and xenoviewer didn't see the emm file for APL_000_skirt_scd.emd, it's search about APL_000_skirt_scd.dyt.emb and do not use emd file. But there a APL_000_skirt_scd.emb witch seem to have the right texture. may be there is to take xxx_skirt_scd.emb if there isn't xxx_skirt_scd.dyt.emb.

OOOOKKKKKK, fork is on my GIT account .... not abious at all. Ok. I will clone for the 4e time.

Olganix commented 9 years ago

Ok I think it's good this time.

Olganix commented 9 years ago

There isn't something strange with hair/objects with another skeleton ? I look at GK4, I push all file in xenoviewer, it's look like it miss to attach hair skeleton on body skeleton (or may be it's attached on the root bone, instead the head bone). When I look deeper on that , I see hair moving like the head , but on the ground. may be it's the first offset (on attached bone in 3dsmax) position/orientation/scale witch is not good

There something wrong in debug version, there .h a cpp builded on compilation. So we just have to do release before debug version.

DarioSamo commented 9 years ago

The game manually attaches the hair and other objects to certain bones, so there's nothing "wrong" with the files themselves. That is controlled by the .cus file I believe, which basically says what model is attached to each bone.

That is probably that way because those objects have some sort of "physics" and use their own independent skeletons.

DarioSamo commented 9 years ago

"There something wrong in debug version, there .h a cpp builded on compilation. So we just have to do release before debug version."

That's the Qt auto-generated files. The Custom Build Tool from each .h and .ui file (Right Click > Properties) on the release configuration needs to be copied to the debug configuration. Those are normally only generated on the widget files.

As for the features to implement, I recommend we just create individual issues for them as it's easier to track that way. (Probably with a system like FEATURE | Feature name here or [Feature] Feature name here)

Olganix commented 9 years ago

Hi Dario Samo. Yesterday, I have time to look about to add Materials on Fbx export. What I did for now : -make a fx file which work on DirectX shader with Nitrous DirectX9 in 3dsmax 2015. It's build with asm shader file of APP_000_boots and parameters you use for Ogre material. It's still have a little problem, a inversion on dark part with lighter part, but I could solve it after (some cases 3dsmax inversed RGBA order).

-in exportFbx, I generated all fx file for shader couples "_PS" "_W_VS" as EMMOgre. -in exportFbx, I read EMM file, extract EMB textures files, create Fbx equivalents, and modify shader parameters and textures to custom each material as Ogre material/program. Saddly 3dsmax didn't import well material from FBX ..... It know there is a material, it know it's a DirectX Shader Material but didn't configure the fx file, textures and parameters ... :( Still work if I configure DirectX shader by hand ... May be, I will done a Maxscript which configure materials.

In Unity, when I import Fbx, it import all meshes, skieleton, textures and fx file, but it did'nt know about fx file. I try fastly to export a cgfx file, but still the same. Unity want its own format. I will look deeper on that today, but I did'nt find how to use asm file in theirs format, may be I need to convert in Hlsl which it'snt a easy operation.

Have a good day.

Olganix commented 9 years ago

Hi Dario. I'm working on LibXenoverse. I want people could modify animation with blender (3dsmax for a next time because it import only one animation from fbx (without plugins)). I allready done the rewritting of ESK and EAN file (only 8 octets difference, from an unknow header, but the game don't care). Now I try to reload fbx in LibXenoverse's structures. "EAN -> LibXenoverse -> FBX -> LibXenoverse -> EAN -> XenoViewer " work. but "EAN -> LibXenoverse -> FBX -> Blender -> Fbx -> LibXenoverse -> EAN -> XenoViewer " have a stange behaviour on matrix (but Unity could read this fbx very well).

I allready have add logs in console to look matrix, but it's too long to load fbx file each try, and I need to have directly some visual confirmations. So, today I want to upgrade Xenoviewer to -use yours SkeletonDebug -load fbx, convert it in esk ean and emd elements -look bones hierarchie -have a debug to view relative matrix, absolute matrix and position/rotation/scale equivalent.

I'm pretty sure that is the fbx skeleton matrix witch fail. Animation need good first position to create a good keyframe, at the right place.

So, i have lots of problem than I didn't understand : -first I don't understand why but I can't see any ManualObject. So I didn't see yours Grid (but I replace it by a mesh), I didn't see your axes and bones of SkeletonDebug. it's strange and very frustrating.

-I add some Signal and slot, and it just don't work , same if some of them, made by you, work !!!! . So there is a hided compilation for Qt signal some where ? before the c++ compilation ? I talk about : "connect(ClearFileTreeButton, SIGNAL(released()), this, SLOT(clearFileTree()));" => it's work "connect(PlayButton, SIGNAL(released()), this, SLOT(playAnimation()));" => it doesn't work. function are in the same place, buttons exists on MainViewer.ui, .... , it's make me crazy ^^'

So if you could help me a litlle, it will be cool.

Olganix commented 9 years ago

Oki, for Qt Signal , I see in external files : moc_MainViewer.cpp. I think I could deal with. But for ManualObject, and TagPoint how could do have something working with ?

Olganix commented 9 years ago

can you give me the complete synthaxe for qmake on this project please ? The hazard does I have the same version of QT.

DarioSamo commented 9 years ago

Hey there, I have a few very busy weeks so I won't be able to help too much for now. However, I can answer the Qt question pretty quickly.

Xenoviewer doesn't use QtCreator or qmake for code related to Qt, it just uses the MSVC2013 Solution. The Release version of Xenoviewer has configurations for all files related to Qt with Properties > Custom Build Tool. There the RCC, MOC, and UIC tools are called accordingly for all files as needed. All those moc, ui, and rcc files are autogenerated by these tools and don't need to be modified manually.

If you're having trouble with getting these files up to date, make sure to verify all these commands are there on each file that needs it.

I'm having trouble understanding most of the issues you described due to the sheer volume of the report, so asking more specific questions on individual issues would be preferred.

Olganix commented 9 years ago

Hi Dario. "Qt with Properties > Custom Build Tool." => Ok I had read Release's configs, but I didn't see it. I will try to look deeeper on that. Thank you. I will need it to add action/slot for animation's buttons and adding some interface after.

I still can't see Ogre ManualObject and TagPoints, But I can deal with, I replace them by meshes. So I could move on about visualisation of Bones. I also add contextMenu on Viewer to turn On/Off the display of the Grid, of geometries, of skeleton (skeletonDebug), and when the skeletonDebug is on, the axes and "bones" (system crash when I try to uses yours "names", because Overlay crash, same if I have correct ressources specifiied, but I didn't see why I crash because I don't have Pdb files of Ogre).

I also add the possiblity to Hide some part of geometry. When I will found how to regenerate moc_ files, I will add bones hierarchy in Skeleton Tree, add the possiblity to Hide selection to hide debug, and after on double click , add a new panel to have all matrix informations : Relative matrix, absolute matrix, equivalent in position.rotation, scale.

That to help me to understand what is going on fbx -> blender -> blender exported fbx, and find the way to cancel the transformation done by blender. (normally I allreday solve the axis orientation, but still have strange values, i need debug visualisation, and hide some part of skeleton).

Olganix commented 9 years ago

Hi Dario. I was also busy this last week and weekend. ""Qt with Properties > Custom Build Tool." => Ok I had read Release's configs, but I didn't see it. I will try to look deeeper on that." => OK. I found on QT_OBJECT files , i had look at solutions, that I didn't see that. I need to compile each files separatly, but !t's Ok,

Now I can move on on interface. Thank you fot you help. I will continue tomorrow. I think I have a part of the problem for passing by blender import and export. I will confirm that with debug in xenoviewer.

Have a good day.

Olganix commented 8 years ago

Hi Dario. Just to say I have a first version of emdFbx.exe and fbxEmd.exe witch make fbx file with animations, and alow modification with blender, and remade game's file after.

http://xenoversemods.com/forums/topic/modify-animations-in-blender/#post-163715 I will commit this version of LibXenoverse in few days, after clean the code a little.

Have a good day.