SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 02-23-13, 10:03 AM   #1876
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
The next question is:

if someone used one of the older versions simply for adding bones to an object containing animations/trackgroups, would it corrupt the file anyway?
more than likely yes Try viewing it in Granny Viewer to see if the animations are screwed up or not.
TheDarkWraith is offline   Reply With Quote
Old 02-23-13, 11:03 AM   #1877
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Using the Granny Viewer as my guide I'm going through my trackgroups and animations code to see where I might have screwed up in not reading in all the data. Hope to have it sorted out here soon

The trackgroups and animations code just reads in all the data. I have no clue yet how to assemble that data to view/change the mesh data to make animations possible.
TheDarkWraith is offline   Reply With Quote
Old 02-23-13, 12:17 PM   #1878
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by TheDarkWraith View Post
more than likely yes Try viewing it in Granny Viewer to see if the animations are screwed up or not.
Just opened in Granny Viewer a copy of 37mmTSA.GR2 where I had changed bones hierachy and position using a previous version of your application.

Animations are displayed correctly

Last edited by gap; 02-23-13 at 12:29 PM.
gap is offline   Reply With Quote
Old 02-23-13, 04:10 PM   #1879
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
Just opened in Granny Viewer a copy of 37mmTSA.GR2 where I had changed bones hierachy and position using a previous version of your application.

Animations are displayed correctly
you got lucky. By all accounts it shouldn't work because of what I'm about to explain.

Found the error with the TrackGroups and Animations. The error wasn't actually in any of them per se but actually in my ExtendedData class, specifically the reader function In the TrackGroups they define curve data. Well that curve data has a special type of granny data type, what I call an integer-string layout. It's only found in this curve data (that I've come across so far). That in itself is not the problem. The problem was I set a flag denoting that the reader encountered this so that it knew what to do with the number of items it had to read into for this. I never reset the flag when it was done reading the required number of items This was wreaking havoc on anything read in after that from then on. The fix was easy: reset the flag when done reading the required number of items. Finding the problem was like finding a needle in a haystack though!

I should be lifting the TrackGroups and Animations restrictions with the next version. I also plan on adding an Animations tab to the app. Don't get too excited - I still don't understand how all these TrackGroups make animations possible yet

What I do know: the TrackGroups work on the deformable mesh data (section 3). Each TrackGroup somehow defines how to deform some part of the mesh. What the curve data means in those TrackGroups is still a mystery to me.

TheDarkWraith is offline   Reply With Quote
Old 02-23-13, 09:23 PM   #1880
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

What I said about TrackGroups working on only deformable vertex data just got shot to pieces:



the pericope_ct proved me wrong. It contains nothing but rigid vertex data. It is also a compressed GR2 file but the app had no problem with that

I also had a perfect load of this compressed GR2 file (no broken chains in ANY section!) Looks like I fixed the not reading all the TrackGroups and Animation data finally
TheDarkWraith is offline   Reply With Quote
Old 02-23-13, 10:41 PM   #1881
Targor Avelany
Ace of the Deep
 
Join Date: Jan 2010
Location: Vancouver, BC, Canada
Posts: 1,183
Downloads: 225
Uploads: 0


Default

yayay!!!!

I also will write up my problem with textures. Unfortunately it persists even with the newest version. I'll write up the adding subsets problem too.
Targor Avelany is offline   Reply With Quote
Old 02-24-13, 02:04 AM   #1882
Targor Avelany
Ace of the Deep
 
Join Date: Jan 2010
Location: Vancouver, BC, Canada
Posts: 1,183
Downloads: 225
Uploads: 0


Default

Ok.







1) open stock file
2) select the mesh you want to add the subsets to
3) Go through the menu...
4) select the mesh (in this .obj file there are 4 meshes - so it is possible I have to add one by one, but not sure)
5) get the error

TDW, here's the file that I was attempting to use to add the subsets:
p.s. I deleted the link and file, assuming you grabbed it already.

Last edited by Targor Avelany; 02-24-13 at 05:50 PM.
Targor Avelany is offline   Reply With Quote
Old 02-24-13, 02:15 AM   #1883
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

What all did you have checked for import (ao, normals, etc.)? Strict or loose import?
TheDarkWraith is offline   Reply With Quote
Old 02-24-13, 02:53 AM   #1884
Targor Avelany
Ace of the Deep
 
Join Date: Jan 2010
Location: Vancouver, BC, Canada
Posts: 1,183
Downloads: 225
Uploads: 0


Default

Quote:
Originally Posted by TheDarkWraith View Post
What all did you have checked for import (ao, normals, etc.)? Strict or loose import?
Selections: default as they come up. There is no selection for strict or loose, as I went through "Add Subsets" menu.

p.s. the second error reproduction, with textures, will write up tomorrow.
But one interesting point there: the way I get all the subsets into the GR2 is actual regular import of a mesh (loose, selecting everything). It imports all of the subsets and arranges them perfectly:


Reason mentioning it is in regards to the above problem.
Targor Avelany is offline   Reply With Quote
Old 02-24-13, 11:49 PM   #1885
Targor Avelany
Ace of the Deep
 
Join Date: Jan 2010
Location: Vancouver, BC, Canada
Posts: 1,183
Downloads: 225
Uploads: 0


Default

So, problem with textures:











1) so, as I mentioned in my last post, I'm not able to add meshes. But, replacing the mesh altogether, works extremely well: it replaces the mesh, arranging the subsets in perfect order (see pic. 1)
2) now, for the textures. Currently, with materials import/textures import locked out, have to go through it manually. First: add all the textures.
3) Now, need to add 1st layer of material. It doesn't work if you finish here - need to go through the second layer of materials. First layer is just adding materials with 0 maps with existing textures.
4) Now, need to go through and define maps. This is the second layer
5) The next step is to add all the maps to material bindings of the mesh.
6) Fix all the materials for each subset, hull for hull, floor for floor. Etc.
7) Save, reload, look pretty!
8) Load in Goblin Editor - not so much fun.
Targor Avelany is offline   Reply With Quote
Old 02-26-13, 02:00 PM   #1886
Targor Avelany
Ace of the Deep
 
Join Date: Jan 2010
Location: Vancouver, BC, Canada
Posts: 1,183
Downloads: 225
Uploads: 0


Default

Found another little problem with materials/textures. This also has been tested on a stock file of Uboat_7b_AI.gr2





The error appears when you attempt to save the edited gr2.

Process:
1) add new texture
2) add new material with no maps for the above texture
3) add a materials with above texture as diffuse (or any other) map
Targor Avelany is offline   Reply With Quote
Old 03-03-13, 01:17 PM   #1887
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Targor Avelany View Post
1) open stock file
2) select the mesh you want to add the subsets to
3) Go through the menu...
4) select the mesh (in this .obj file there are 4 meshes - so it is possible I have to add one by one, but not sure)
5) get the error

TDW, here's the file that I was attempting to use to add the subsets:
p.s. I deleted the link and file, assuming you grabbed it already.
The error was on my part. I retrieved the current number of vertices AFTER allocating space for more vertices. Which will throw an error because index is quite out of range. I now read the number of current verices before allocating space for more of them. That problem fixed.

That also exposed a bug in my function that calculates tangents and binormals (if the user decided to have them calculated). I forgot to pass an offset to this function to account for the current vertices. That problem has also been fixed.

I was finally able to import your OBJ file into the lifeboat:



I hope that is what your file was supposed to add to the lifeboat. Looks very strange to me. I viewed it in Wings3D and I see the same thing (minus the original lifeboat).

Yes the materials are messed up because I never coded that in. I currently set all new subsets to default to the first material binding of the mesh. Why? Well because I haven't decided how to best implement the correct way to do this yet. Same thing applies for importing a mesh. Once I have finally decided on the correct way to implement adding the materials defined in the mtllib I'll implement it.

I finally figured out what the mixed values for section 0 were for. I have that coded in and working correctly also now Now I'm just looking for a GR2 file that has mixed values for section 2 and/or 4. Those mixed values are probably defining Int16 indices vice Int32 indices but won't know for sure till I can look at one.


Last edited by TheDarkWraith; 03-03-13 at 01:30 PM.
TheDarkWraith is offline   Reply With Quote
Old 03-03-13, 01:19 PM   #1888
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Targor Avelany View Post
Found another little problem with materials/textures. This also has been tested on a stock file of Uboat_7b_AI.gr2

The error appears when you attempt to save the edited gr2.

Process:
1) add new texture
2) add new material with no maps for the above texture
3) add a materials with above texture as diffuse (or any other) map
I'll look into this now
TheDarkWraith is offline   Reply With Quote
Old 03-03-13, 01:20 PM   #1889
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Targor Avelany View Post
So, problem with textures:

1) so, as I mentioned in my last post, I'm not able to add meshes. But, replacing the mesh altogether, works extremely well: it replaces the mesh, arranging the subsets in perfect order (see pic. 1)
2) now, for the textures. Currently, with materials import/textures import locked out, have to go through it manually. First: add all the textures.
3) Now, need to add 1st layer of material. It doesn't work if you finish here - need to go through the second layer of materials. First layer is just adding materials with 0 maps with existing textures.
4) Now, need to go through and define maps. This is the second layer
5) The next step is to add all the maps to material bindings of the mesh.
6) Fix all the materials for each subset, hull for hull, floor for floor. Etc.
7) Save, reload, look pretty!
8) Load in Goblin Editor - not so much fun.
What does it look like in Goblin? What is it supposed to look like?
TheDarkWraith is offline   Reply With Quote
Old 03-03-13, 02:41 PM   #1890
Targor Avelany
Ace of the Deep
 
Join Date: Jan 2010
Location: Vancouver, BC, Canada
Posts: 1,183
Downloads: 225
Uploads: 0


Default

Quote:
Originally Posted by TheDarkWraith View Post
What does it look like in Goblin? What is it supposed to look like?
The main hull texture is correct. The rest are very replaced; it seems like the textures/maps are assigned to wrong subsets. If you look close at the pics from GR2 Editor and Goblin you will see that the floor, the benches, the mid-section and the board/railing of the boat are messed up.

Quote:
Originally Posted by TheDarkWraith View Post
The error was on my part. I retrieved the current number of vertices AFTER allocating space for more vertices. Which will throw an error because index is quite out of range. I now read the number of current verices before allocating space for more of them. That problem fixed.

That also exposed a bug in my function that calculates tangents and binormals (if the user decided to have them calculated). I forgot to pass an offset to this function to account for the current vertices. That problem has also been fixed.

I was finally able to import your OBJ file into the lifeboat:



I hope that is what your file was supposed to add to the lifeboat. Looks very strange to me. I viewed it in Wings3D and I see the same thing (minus the original lifeboat).

Yes the materials are messed up because I never coded that in. I currently set all new subsets to default to the first material binding of the mesh. Why? Well because I haven't decided how to best implement the correct way to do this yet. Same thing applies for importing a mesh. Once I have finally decided on the correct way to implement adding the materials defined in the mtllib I'll implement it.

I finally figured out what the mixed values for section 0 were for. I have that coded in and working correctly also now Now I'm just looking for a GR2 file that has mixed values for section 2 and/or 4. Those mixed values are probably defining Int16 indices vice Int32 indices but won't know for sure till I can look at one.

The weirdness comes from missing a hull. Since I needed to add meshes, I didn't want too many meshes So, in the file that I have sent you, there are just meshes of the rest of the boat, but the hull. :P
Targor Avelany is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:13 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.