SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SH5 Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=249)
-   -   GR2 Editor/Viewer/Extractor/Importer (https://www.subsim.com/radioroom/showthread.php?t=188290)

TheDarkWraith 03-03-14 12:06 PM

v1.1.451.1 released. See post #1

Fixes the problems exposed by gap's bunker

TheDarkWraith 03-03-14 12:09 PM

Quote:

Originally Posted by privateer (Post 2180912)
Still not Universal import for obj files.

I need to know which files you were using, link to all the files, and a procedure of what you did so that I can watch in Visual Studio debugger and try to see what the problem is.

gap 03-03-14 12:31 PM

Quote:

Originally Posted by TheDarkWraith (Post 2181095)
The problem with broken chains when importing a mesh with different number of subsets and/or vertices and/or indices is fixed in upcoming version.

Excellent! I need for that version in order to finish the bunker coastal defence unit with all the goodies in :up:

Quote:

Originally Posted by TheDarkWraith (Post 2181095)
Being able to remove items from the vertex declaration isn't finished yet. I've been working on this for some time.

Roger that :up:

Quote:

Originally Posted by TheDarkWraith (Post 2181095)
Even though you set all the flags of all it's bones to 0 you're forgetting one important one: the model! It has influence on everything :) You need to adjust the model's position as it has some HUGE offsets for X and Z. With these HUGE offsets all bones are offset by this same amount.

I had totally forgot about model's trasform data :oops:
I have finally set model's TD flag to 0 and said 'no' when I was aked if I wanted mesh position/rotation to be updated, and now bounding spheres/boxes are centered on the meshes I had previously imported.

By the way, are bounding spheres and boxes used along with collision model and collision spheres for collision detection? This could explain why the mine unit that Targor was working on until recently, failed to explode every so often. This is supposing that he had imported his meshes in a GR2 file with similar huge model/bone position offsets, and he didn't reset them to 0 :hmm2:

Quote:

Originally Posted by TheDarkWraith (Post 2181095)
I got all the problems fixed that your bunker exposed. I rendered everything just to ensure the app did everything it was supposed to do on import. I had to manually adjust the bone to the correct position.

Quote:

Originally Posted by TheDarkWraith (Post 2181119)
v1.1.451.1 released. See post #1

Fixes the problems exposed by gap's bunker

Awesome! Thank you TDW :woot:

TheDarkWraith 03-03-14 12:47 PM

Quote:

Originally Posted by gap (Post 2181144)
By the way, are bounding spheres and boxes used along with collision model and collision spheres for collision detection? This could explain why the mine unit that Targor was working on until recently, failed to explode every so often. This is supposing that he had imported his meshes in a GR2 file with similar huge model/bone position offsets, and he didn't reset them to 0 :hmm2:

The bounding spheres are more for visual reference. The Granny system doesn't use them. The Granny system does use the bounding boxes though so they are very important. Granny stores the mesh's bounding box info in the mesh's BoneBindings. A mesh CAN have more than one bounding box. It all depends on how many BoneBindings are defined.

SH5 uses the bounding boxes for broad collision detection (first pass test). If that test passes then it goes to the Dmg_Col mesh and tests for intersection with it. If that test passes then it checks all the collision spheres defined to see which zones (boxes) were hit.

After you import anything or make drastic changes you should enable the bounding boxes render to ensure they are where they are supposed to be AND are sized correctly.

tonschk 03-03-14 01:09 PM

Thank you a Lot :yeah:TDW :sunny:

Quote:

Originally Posted by TheDarkWraith (Post 2181119)
v1.1.451.1 released. See post #1

Fixes the problems exposed by gap's bunker


Madox58 03-03-14 08:38 PM

Quote:

Originally Posted by TheDarkWraith (Post 2181121)
I need to know which files you were using, link to all the files, and a procedure of what you did so that I can watch in Visual Studio debugger and try to see what the problem is.

Here's 2 example obj files of my SH4 Life boat.
https://www.mediafire.com/?cmc5rgp7bifvefz
One is an export from 3DConverter 4.8
The other from MeshLab 1.3.2

Both use a slightly different way to write the obj files.
Both open in nearly every 3D Modeling program.

I included the sort program I threw together that sorts the files so GR2 editor can read them.

TheDarkWraith 03-04-14 01:03 PM

Quote:

Originally Posted by privateer (Post 2181381)
Here's 2 example obj files of my SH4 Life boat.
https://www.mediafire.com/?cmc5rgp7bifvefz
One is an export from 3DConverter 4.8
The other from MeshLab 1.3.2

Both use a slightly different way to write the obj files.
Both open in nearly every 3D Modeling program.

I included the sort program I threw together that sorts the files so GR2 editor can read them.

Instead of re-inventing the wheel how would you feel about making that sorter app a DLL and exposing a function that I can call that will take a .NET List<String> object that contains the contents of the OBJ file and the function sorts it and then returns a .NET List<String> object that contains the contents of the OBJ file sorted by your app?

That .NET List<String> object that I would pass would be a list of all the lines in the file with all white space removed (so no \r\n at the end of each line). Any 'blank lines' in the file would be removed also and not included in this list.

There are two benefits to this:
1) I don't have to re-invent the wheel
2) you can update the DLL at anytime with new features (able to support more formats) and all I have to do is include it with the app.

gap 03-04-14 01:43 PM

coast defense bunker unit almost finished...
 
...in GR2 Editor:

http://i519.photobucket.com/albums/u...o/bunker-2.jpg

and in Goblin:

http://i519.photobucket.com/albums/u...o/bunker-3.jpg

Well done TheDarkWraith!

things still to do:
  • general file clean-up (there are a lot of unused materials, leftover from the previous meshes);
  • material properties fine tuning;
  • sim and zon files (respectively with unit cmdr controller, and collision/damage/radio controllers);
  • customized visual and "loop" sensors for usage on the unit (the latter optional: I hope to create a better suited model for usage as loop station unit);
  • last touch-ups to the character I have assembled (for usafe as lookout inside the bunker).

stay tuned :salute:

gap 03-04-14 01:45 PM

Quote:

Originally Posted by TheDarkWraith (Post 2181592)
all I have to do is include it with the app.

That would be great :up:

TheDarkWraith 03-04-14 01:58 PM

Quote:

Originally Posted by gap (Post 2181597)
things still to do:
  • general file clean-up (there are a lot of unused materials, leftover from the previous meshes);
  • material properties fine tuning;
  • sim and zon files (respectively with unit cmdr controller, and collision/damage/radio controllers);
  • customized visual and "loop" sensors for usage on the unit (the latter optional: I hope to create a better suited model for usage as loop station unit);
  • last touch-ups to the character I have assembled (for usafe as lookout inside the bunker).

stay tuned :salute:

Looks good :up:
Glad someone is putting the app to use and through it's paces :yeah:

gap 03-04-14 02:24 PM

Quote:

Originally Posted by TheDarkWraith (Post 2181605)
Looks good :up:
Glad someone is putting the app to use and through it's paces :yeah:

That's nothing compared to the work you are doing :yep:

On a slightly unrelated note, I am a bit worried about how the billboarded shrub will look in game. Have you noticed how (the reason is obvious) in the Goblin render one of the shrub faces is much darker than the other?. I had a look into stock tree meshes, and they have only position, texture and normal coordinates defined (no binormls/tangents). I am waiting to see if you can implement the 'delete vertex declaration' thing :03:

On a different note, deleting materials is still problematic (i.e. materials still being listed in the materials tree after being deleted, or exceptions being called during the deletion process).

TheDarkWraith 03-04-14 02:50 PM

Quote:

Originally Posted by gap (Post 2181622)
On a slightly unrelated note, I am a bit worried about how the billboarded shrub will look in game. Have you noticed how (the reason is obvious) in the Goblin render one of the shrub faces is much darker than the other?. I had a look into stock tree meshes, and they have only position, texture and normal coordinates defined (no binormls/tangents). I am waiting to see if you can implement the 'delete vertex declaration' thing :03:

The reason one side is darker is probably because the ExtendedData for the mesh and/or bone is not correct. Compare it to the ExtendedData of the mesh/bone you extracted it from.

On a different note, deleting materials is still problematic (i.e. materials still being listed in the materials tree after being deleted, or exceptions being called during the deletion process).

Give me link to files and what you did so I can try and reproduce and figure out why


Also don't forget to render your new creation with lighting in the app to ensure all your material properties are correct.

TheDarkWraith 03-04-14 02:55 PM

I'm assuming you're adding a character to the bunker no? In case it hasn't hit you you can take one of the existing character waypoint GR2 files (\data\Library\Patch_1x1_V02 for example) and make a new one out of it. Add some new bones to it and you can create a custom 'path' that your character will follow in and/or around the bunker :D

tonschk 03-04-14 02:57 PM

:yeah:

Quote:

Originally Posted by TheDarkWraith (Post 2181605)
Looks good :up:


gap 03-04-14 05:11 PM

Quote:

Originally Posted by TheDarkWraith (Post 2181637)
Give me link to files and what you did so I can try and reproduce and figure out why

I will. I am now seeing if I can reproduce the problem :up:

Quote:

Originally Posted by TheDarkWraith (Post 2181637)
Also don't forget to render your new creation with lighting in the app to ensure all your material properties are correct.

I did it. Everything looks fine except maybe for the radio: it currently looks a bit too bright for being located inside the bunker, but I hope that once in game it will receive the shadow cast by bunker's roof and walls. :hmm2:

Quote:

Originally Posted by TheDarkWraith (Post 2181639)
I'm assuming you're adding a character to the bunker no? In case it hasn't hit you you can take one of the existing character waypoint GR2 files (\data\Library\Patch_1x1_V02 for example) and make a new one out of it. Add some new bones to it and you can create a custom 'path' that your character will follow in and/or around the bunker :D

yep, this is exactly what I had planned. I want the character to go back and forth from the loophole to the radio station, acting appropriately to each station. I also want him to use different objects while at the radio than he is using while on watch. Do you know if the SetBodyPartVisibility command used in u-boat crew scripts also works with secondary characters?


All times are GMT -5. The time now is 09:36 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.