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 11-22-11, 04:49 PM   #241
TheBeast
The Old Man
 
Join Date: Jan 2010
Location: Lynnwood, WA
Posts: 1,533
Downloads: 876
Uploads: 23


Default

Hope you include a Undo button option.
__________________
Fear me! I am, TheBeastBelow

SHIV-MediaFire | SHV-MediaFire
TheBeast is offline   Reply With Quote
Old 11-22-11, 05:06 PM   #242
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by TheBeast View Post
Hope you include a Undo button option.
No I didn't

Make a backup of the file before 'editing' it.

I'll include a way to revert back to as-loaded values in next version
TheDarkWraith is offline   Reply With Quote
Old 11-22-11, 09:48 PM   #243
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

now since we can edit a bone's position, orientation, scale, etc. I should tell you all about the flags property of the bone. The flags property is a bitarray and has (that I know of) 3 bits:

bit 0: defines whether the bone has position data or not
bit 1: defines whether the bone has rotation data or not
bit 2: defines whether the bone has scale/shear data or not

if bit 0 is high (value of 0x1) then the bone will use the position data it has. If it is low then it defaults to 0,0,0 for position. Even if the bone has position data if this bit is low then it will ignore it.

if bit 1 is high (value of 0x2) then the bone will use the rotation data it has. If it is low then it defaults to Quaternion.Identity. Even if the bone has rotation data if this bit is low it will ignore it.

if bit 2 is high (value of 0x4) then the bone will use the scale/shear data is has. If it is low then it defaults to Matrix.Identity. Even if the bone has scale/shear data if this bit is low it will ignore it.

You can 'combine' bits to use more data. i.e: bits 0 and 1 enabled (value of 0x3) will cause the bone to use it's position data and rotation data but ignore it's scale/shear data (scale/shear will be set to Matrix.Identity).

Took me some time to figure this out about the Granny bones.
TheDarkWraith is offline   Reply With Quote
Old 11-23-11, 01:44 AM   #244
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

wrote the mesh 'deformer' code. Now just have to make a UI for it like the bone's have. Also have to make a UI for the model(s) so that they can be edited (position, rotation, and scale/shear data)
Changed the way the mesh's vertex format is defined. I had it locked (hard-coded) at position | normal | texture1 but now it's dynamic (had to do some reading to figure out how I could make it dynamic). A fvf is defined based on the vertex names read in and the mesh is created with that fvf as the vertex type. After the mesh is created I just lock the vertex buffer and fill in the 'missing' data based on the mesh's vertex format which is fvf (GraphicStream objects rock - first time to use that. Because of it I didn't have to define any structures for the fvf ). I've been wanting to make the mesh's vertex format dynamic for a long time but just didn't have the knowledge of how to do it until now.

Now that the mesh's vertex format is defined dynamically I can start coding in shaders.
TheDarkWraith is offline   Reply With Quote
Old 11-23-11, 06:00 AM   #245
Vanilla
Lieutenant
 
Join Date: Nov 2006
Location: St. Petersburg, Russia
Posts: 264
Downloads: 72
Uploads: 0
It's not yet possible to add bones, is it ?
Vanilla is offline   Reply With Quote
Old 11-23-11, 08:11 AM   #246
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Vanilla View Post
It's not yet possible to add bones, is it ?
Not yet. Still working on it.
The problem is the adjusting of all the pointers. I haven't found an algorithm that works 100% of the time on every file. I'll eventually figure out the correct one
TheDarkWraith is offline   Reply With Quote
Old 11-23-11, 08:19 AM   #247
tonschk
Admiral
 
Join Date: Mar 2007
Posts: 2,200
Downloads: 172
Uploads: 0
Default

I think this is one of the most important thread for Silent Hunter 5 , Well done TheDarkWraith
__________________
What we do in life echoes in Eternity
tonschk is offline   Reply With Quote
Old 11-23-11, 08:43 AM   #248
Trevally.
Navy Seal
 
Join Date: Apr 2007
Location: AN1536 (Orkney)
Posts: 5,451
Downloads: 166
Uploads: 28


Default

Quote:
Originally Posted by tonschk View Post
I think this is one of the most important thread for Silent Hunter 5 , Well done TheDarkWraith
I agree - but it is also the one where I don't understand much of what is being said. I have tried Google translate and wiki. Still can't follow it

I just look for these -

and hope not to see many of these

__________________
Trevally Mods for SH5
Trevally. is offline   Reply With Quote
Old 11-23-11, 01:28 PM   #249
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

v1.0.402.0 released. See post #1

You can now double click a mesh in the Mesh tab to edit it. When you do it will bring up a new window that will let you specify position, rotation, and scale/shear. You can also edit it's extended data. Realize that meshes don't have this position, rotation, and scale/shear data in GR2 files. I 'gave' them this so that we can reposition, scale, and rotate them. This would be why when you first go to edit a mesh you'll see values that don't appear correct.

When you change the mesh's position, rotation, or scale/shear the mesh will be 'deformed' by my deformer code and you'll be able to instantly see the change on screen. As the meshes in SH5 are pre-positioned this is the only way we can 'move' meshes around in the SH5 GR2 files. The value last input by user will be shown when you go to edit it again (so you can use the inverse of the value to move it back to it's original position). The mesh changes are currently not written to the file, the extended data for it is though. Reason for this is I want people to test it to ensure it's working correctly before committing the mesh changes to the file.

For a little fun open up the King George V GR2 file. Go to the Mesh tab and double click King George V hull. Double click the scale property. For M11 change the value to 2.0. Now that's how the King George V hull should look like (a REAL battleship!)

I'm going to add something to the effect of a global change to allow you to 'edit' all meshes at once (say you want to move/reposition/scale the entire model at once)

Last edited by TheDarkWraith; 11-23-11 at 01:46 PM.
TheDarkWraith is offline   Reply With Quote
Old 11-23-11, 02:03 PM   #250
tonschk
Admiral
 
Join Date: Mar 2007
Posts: 2,200
Downloads: 172
Uploads: 0
Default

Hello, can you tell me please where to click to see the King George V ?, I click on the mesh tab but nothing is there , thank you

__________________
What we do in life echoes in Eternity
tonschk is offline   Reply With Quote
Old 11-23-11, 02:33 PM   #251
THE_MASK
Ace of the deep .
 
THE_MASK's Avatar
 
Join Date: Jan 2006
Posts: 9,226
Downloads: 901
Uploads: 73


Default

Nice work
I downloaded GR2EditorViewer_v1_0_402_0
Dont know really what i am doing .
I opened the undersea GR2 and edited the meshes scale for the rocks to 3 . I can see the larger rocks in the viewer ok . When i exit out of the viewer and then open up undersea again the GR2 file is the vanilla size again .

1.5 looks nice for the KGV hull .

If i try to open NBB_Nelson the message says Name was not found for mesh in pointers .
THE_MASK is offline   Reply With Quote
Old 11-23-11, 06:01 PM   #252
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
The mesh changes are currently not written to the file
2 posts up from yours Mate.
  Reply With Quote
Old 11-23-11, 06:01 PM   #253
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by sober View Post
Nice work
I downloaded GR2EditorViewer_v1_0_402_0
Dont know really what i am doing .
I opened the undersea GR2 and edited the meshes scale for the rocks to 3 . I can see the larger rocks in the viewer ok . When i exit out of the viewer and then open up undersea again the GR2 file is the vanilla size again .

1.5 looks nice for the KGV hull .

If i try to open NBB_Nelson the message says Name was not found for mesh in pointers .
Yes they will be vanilla size again. Reason is because I'm currently not letting the app write the mesh changes to the file. Once I get a little feedback from everyone that nothing strange is happening (weird colors or shapes) after editing meshes I'll enable the writing of changes to file
Right now you get to safely 'play' and experiment with them
I am going to change the way you input rotations. Most, if not all, don't know what a quaternion is or how to specify rotations with it. I'm going to make it the standard pitch, yaw, and roll so it will be much easier to rotate meshes and bones.

I'll look into the NBB_Nelson and see what's going on.
TheDarkWraith is offline   Reply With Quote
Old 11-23-11, 06:42 PM   #254
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by sober View Post
If i try to open NBB_Nelson the message says Name was not found for mesh in pointers .
This was a good find My parser set the pointer type for strings with the first character of '_' as the wrong pointer type. It has been corrected and the NBB_Nelson now loads correctly without error Will be available in next version.
TheDarkWraith is offline   Reply With Quote
Old 11-23-11, 06:53 PM   #255
THE_MASK
Ace of the deep .
 
THE_MASK's Avatar
 
Join Date: Jan 2006
Posts: 9,226
Downloads: 901
Uploads: 73


Default

I opened up C:\Ubisoft\Silent Hunter 5\data\Terrain\Textures_and_Vegetation\0.Taigas and Dry Lands\vegetation GR2 .
I was looking at the Tree 1 Mesh extended data .
Displacement Max Triangles .
Tried changing this value from 10000 to 5000 but ctd .
THE_MASK 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 12:48 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.