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)
-   -   [TEC] How to use: TheDarkWraith .GR2 Editor (https://www.subsim.com/radioroom/showthread.php?t=198840)

gap 02-16-13 01:07 PM

Problem editing vegetation.GR2 meshes
 
I am currently trying to change tree sizes by scaling their meshes, rather than by reducing the size of their texture's visible part, as done by Echolot for his Smaller Trees Mod.
As long as texture sizes remain unchanged, this method would ensure better tree resolution with no increase of memory usage (Smaller Tree's transparent pixels are anyway loaded in memory).

Silent hunter trees are simple "billboard" meshes, composed by 8 vertices and 4 faces in 1 subset; basically 2 rectangles intersecting each other at 90 deg, roughly along their respective axes of symmetry:

http://img546.imageshack.us/img546/4371/treedn.jpg

SH5 trees are untypical objects. As far as I can understand, they have no material nor texture assigned in their GR2 files. Their textures, as well as vegetation.GR2's to be used for each ecoregion and each season, are found in a set of ini files in dat/Terrain/Textures_and_Vegetation.

On opening any of the vegetation.GR2 files, the program prompts us as follows:

http://img203.imageshack.us/img203/4462/dialogs.jpg

On TDW's suggestion, during my past attempts I confirmed that I wanted the missing 'essential' strings to be added, and shortly after I received this message:

http://img842.imageshack.us/img842/7315/dialogr.jpg

After saving, closing and reopening the same file, I selected a mesh and exported its Vertex data (no other Export checkbox selected).
Here's the content ot the generated obj file for Tree2 of 1.Small Vegetation and Temperate Alpina/vegetation.GR2:

Code:

# Exported by GR2Editor/Viewer v1.1.285.1
# Exported from GR2 file C:\Users\Gabriele\Desktop\Dynamic Environment SH5-V2.2\MODS\DynEnv v2.2 - 12.a Smaller Trees - 75%\data\Terrain\Textures_and_Vegetation\1.Small Vegetation and Temperate Alpina\vegetation.GR2
#
mtllib Tree2.mtl
o Tree2
# 1 subsets, 8 vertices, 4 faces
v -29,466270000 2,492133000 1,440153000
v -31,541330000 2,492133000 -1,151663000
v -31,541330000 0,053065750 -1,151663000
v -29,466270000 0,053065750 1,440153000
v -31,854800000 2,492132000 1,176825000
v -29,280560000 2,492132000 -0,884170500
v -29,280560000 0,053065750 -0,884170500
v -31,854800000 0,053065750 1,176825000
#
#
g Tree2_subset0
usemtl Tree2_subset0
# 12 vertices, 4 faces
f 8 7 5
f 7 6 5
f 4 3 1
f 3 2 1

...and this is the mtl file:

Code:

newmtl Tree2_subset0
Ns 0,000000000
Ka 0,588235300 0,588235300 0,588235300
Kd 0,588235300 0,588235300 0,588235300
Ks 0,900000000 0,900000000 0,900000000
Ke 0,000000000 0,000000000 0,000000000
map_Ka Tree2.Tga
map_Kd Tree2.Tga
map_Ks Tree2.Tga

In order to make sure that everything was okay, I imported back the exported mesh (again, only 'Vertex Data' checked), and I got confirmation that...

http://img827.imageshack.us/img827/111/dialogx.jpg

...and that...

http://img546.imageshack.us/img546/7596/dialog.jpg

Encouraged by these first results, I discarded the changes and I imported the obj file generated by GR2 editor into Wings 3D 1.4.1, where I made the following changes:
  • split one of the basal edges in two segments, thus generating a median vertex.
  • scaled down the object using the new vertex as pivotting point
  • removed the new vertex

I exported then the modified meshes. The new obj file looked like this:

Code:

# Exported from Wings 3D 1.4.1
mtllib Tree2scaled.mtl
o Tree2
#8 vertices, 4 faces
v -29.72565250 1.88236619 1.11617600
v -31.28194750 1.88236619 -0.82768600
v -31.28194750 5.3065750e-2 -0.82768600
v -29.72565250 5.3065750e-2 1.11617600
v -31.51705000 1.88236544 0.91868000
v -29.58637000 1.88236544 -0.62706663
v -29.58637000 5.3065750e-2 -0.62706663
v -31.51705000 5.3065750e-2 0.91868000
vn 0.78063262 0.0000000e+0 -0.62499017
vn 0.78063262 0.0000000e+0 -0.62499017
vn 0.78063262 0.0000000e+0 -0.62499017
vn 0.78063262 0.0000000e+0 -0.62499017
vn 0.62499150 0.0000000e+0 0.78063155
vn 0.62499150 0.0000000e+0 0.78063155
vn 0.62499150 0.0000000e+0 0.78063155
vn 0.62499150 0.0000000e+0 0.78063155
g Tree2_Tree2_subset0
usemtl Tree2_subset0
s 1
f 1//1 3//3 2//2
f 1//1 4//4 3//3
f 5//5 7//7 6//6
f 5//5 8//8 7//7

mtl file:

Code:

# Exported from Wings 3D 1.4.1
newmtl Tree2_subset0
Ns 100.0
d 1.0
illum 2
Kd 0.5882353 0.5882353 0.5882353
Ka 0.5882353 0.5882353 0.5882353
Ks 0.9 0.9 0.9
Ke 0.0 0.0 0.0

They don't resemple the original files :hmmm:

When I try to import vertex data of the modified object into the vegetation GR2 file, GR2 Editor becomes unresponsive.
I have also tried pasting the modified vertices coordinates into the obj file generated by GR2 Editor:

Code:

mtllib Tree2.mtl
o Tree2
# 1 subsets, 8 vertices, 4 faces
v -29.72565250 1.88236619 1.11617600
v -31.28194750 1.88236619 -0.82768600
v -31.28194750 5.3065750e-2 -0.82768600
v -29.72565250 5.3065750e-2 1.11617600
v -31.51705000 1.88236544 0.91868000
v -29.58637000 1.88236544 -0.62706663
v -29.58637000 5.3065750e-2 -0.62706663
v -31.51705000 5.3065750e-2 0.91868000
#
#
g Tree2_subset0
usemtl Tree2_subset0
# 12 vertices, 4 faces
f 8 7 5
f 7 6 5
f 4 3 1
f 3 2 1

This hybrid file is read correctly by Wings 3D, but again, when I try importing it into GR2 Editor, nothing happens :wah:

Any idea guys?

TheDarkWraith 02-16-13 02:41 PM

Quote:

Originally Posted by gap (Post 2010717)
Code:

# Exported from Wings 3D 1.4.1
mtllib Tree2scaled.mtl
o Tree2
#8 vertices, 4 faces
v -29.72565250 1.88236619 1.11617600
v -31.28194750 1.88236619 -0.82768600
v -31.28194750 5.3065750e-2 -0.82768600
v -29.72565250 5.3065750e-2 1.11617600
v -31.51705000 1.88236544 0.91868000
v -29.58637000 1.88236544 -0.62706663
v -29.58637000 5.3065750e-2 -0.62706663
v -31.51705000 5.3065750e-2 0.91868000
vn 0.78063262 0.0000000e+0 -0.62499017
vn 0.78063262 0.0000000e+0 -0.62499017
vn 0.78063262 0.0000000e+0 -0.62499017
vn 0.78063262 0.0000000e+0 -0.62499017
vn 0.62499150 0.0000000e+0 0.78063155
vn 0.62499150 0.0000000e+0 0.78063155
vn 0.62499150 0.0000000e+0 0.78063155
vn 0.62499150 0.0000000e+0 0.78063155
g Tree2_Tree2_subset0
usemtl Tree2_subset0
s 1
f 1//1 3//3 2//2
f 1//1 4//4 3//3
f 5//5 7//7 6//6
f 5//5 8//8 7//7

mtl file:

Code:

# Exported from Wings 3D 1.4.1
newmtl Tree2_subset0
Ns 100.0
d 1.0
illum 2
Kd 0.5882353 0.5882353 0.5882353
Ka 0.5882353 0.5882353 0.5882353
Ks 0.9 0.9 0.9
Ke 0.0 0.0 0.0

They don't resemple the original files :hmmm:

Any idea guys?

The app will complain about those face definitions (f 1//1 3//3 2//2). How do you read that? :hmmm: I don't know and if I don't know the app doesn't know :yep:

EDIT:

nevermind. I know how to read that. It's vertice / texture coordinate / normal. I see the problem in the app now.

V13dweller 05-26-13 09:37 AM

I'm trying to create more bones for a ship, but when I create the node I get a Pointer is null error.

I am finding it very difficult to use this program, I am getting errors very, very frequently.

And mixed value errors when accessing all non ship files.

It is also hideously time consuming and annoying to use this program.

Goblin Editor is much easier to use but it has limitations such as creating bones.

Targor Avelany 05-26-13 10:35 AM

Quote:

Originally Posted by V13dweller (Post 2062980)
I'm trying to create more bones for a ship, but when I create the node I get a Pointer is null error.

I am finding it very difficult to use this program, I am getting errors very, very frequently.

And mixed value errors when accessing all non ship files.

It is also hideously time consuming and annoying to use this program.

Goblin Editor is much easier to use but it has limitations such as creating bones.

all I can say is - if it frustrates you so much: don't use it. Use HEX editors to edit GR2 Files. I'm also not sure why have you decided to spam a very useful and not particularly related to your problem thread: post in the GR2 Editor thread, where TDW will certanly see your complaint.

V13dweller 05-26-13 06:17 PM

I am unable to find any other programs to edit/add bones to ship.

And because this is a [TEC] I thought I could get some help on using this program better.

Trevally. 05-27-13 06:30 AM

Quote:

Originally Posted by Targor Avelany (Post 2063015)
all I can say is - if it frustrates you so much: don't use it. Use HEX editors to edit GR2 Files. I'm also not sure why have you decided to spam a very useful and not particularly related to your problem thread: post in the GR2 Editor thread, where TDW will certanly see your complaint.

Well said

V13dweller 05-27-13 07:07 AM

Quote:

Originally Posted by Trevally. (Post 2063425)
Well said

This was not necessary.

Where can I find said hex editors?

And I only use the editor available because there are no alternatives (That I can find)

Trevally. 05-27-13 07:20 AM

Quote:

It is also hideously time consuming and annoying to use this program.
this is the part that I though was not necessary
TDW has spent a lot of time working on that app and it is not finished yet.
Report bugs by all means but the above statment - really.....


Now I am spamming this post grrr.....

Targor Avelany 05-27-13 09:04 AM

Quote:

Originally Posted by V13dweller (Post 2063225)
I am unable to find any other programs to edit/add bones to ship.

And because this is a [TEC] I thought I could get some help on using this program better.

I'm sorry, but I find your statements of the above sort insulting to the community of modders, who work very hard on every piece of improvement to this game.
gap has told you many times that if you would like to copy bones - use an older version of the GR2Editor - as long as the model has no animation (and sometimes even with animation) works just fine.

In regards to hex editors: by the way you say that you can't find any, only one thought comes to mind: you have not looked. Like, at all. There is one editor offered right here, on subsum, in a download section.

Quote:

Originally Posted by Trevally. (Post 2063425)
Well said

Thank you.
Quote:

Originally Posted by V13dweller (Post 2063439)
This was not necessary.

Where can I find said hex editors?

And I only use the editor available because there are no alternatives (That I can find)

I'm not sure if you are reading what you are writing.

Quote:

Originally Posted by Trevally. (Post 2063443)
this is the part that I though was not necessary
TDW has spent a lot of time working on that app and it is not finished yet.
Report bugs by all means but the above statment - really.....


Now I am spamming this post grrr.....

:yeah: and lol at spamming :)

V13dweller 05-27-13 09:48 AM

I'm sorry I don't have much time to spare looking around for these things, that does not give you the right to jump to the conclusion of that I have not looked, because I have.

And please don't say that I have not read what I have wrote, because If I had not read it, I would have either been not conscious or not actively writing and I know this was not the case.

And it is not spam, if it is not numerous.

I made a single post before you said I was spamming.
If you need the dictionary meaning for spam, here you go "Send the same message indiscriminately to (large numbers of recipients) on the Internet"

gap 05-27-13 10:12 AM

V13, don't take it personal.
Targor and Trevally addressed to you as they did, because your comment sounded a bit rough:

Quote:

Originally Posted by V13dweller (Post 2062980)
I'm trying to create more bones for a ship, but when I create the node I get a Pointer is null error.

I am finding it very difficult to use this program, I am getting errors very, very frequently.

And mixed value errors when accessing all non ship files.

It is also hideously time consuming and annoying to use this program.

Goblin Editor is much easier to use but it has limitations such as creating bones.

answering your questions:

- you cannot compare GR2 Editor and Goblin Editor: they are completely different programs. TDW could have coded a tool two times as good as Goblin in half a week. But dealing with 3D obects is a totally different matter. This is especially true talking about GR2 format, which being a "closed" format is not fully studied yet. That said, TDW's tool is experiemntal and some flaws are normal :yep:

- TDW's editor is unique. Provided that you will find any other GR2 Editor on the web (I doubt it), it won't be better than the one by TDW.

- There are many good hex editors on the web, and many of them are for free. This following wikipedia rticle compares the most popular of them:
http://en.wikipedia.org/wiki/Comparison_of_hex_editors

- Unless you know what you are doing, I would recommend you to edit your GR2 files with any hex editor anyway. Too complex. :doh:

Targor Avelany 05-27-13 12:33 PM

Quote:

Originally Posted by gap (Post 2063551)
V13, don't take it personal.
Targor and Trevally addressed to you as they did, because your comment sounded a bit rough:



answering your questions:

- you cannot compare GR2 Editor and Goblin Editor: they are completely different programs. TDW could have coded a tool two times as good as Goblin in half a week. But dealing with 3D obects is a totally different matter. This is especially true talking about GR2 format, which being a "closed" format is not fully studied yet. That said, TDW's tool is experiemntal and some flaws are normal :yep:

- TDW's editor is unique. Provided that you will find any other GR2 Editor on the web (I doubt it), it won't be better than the one by TDW.

- There are many good hex editors on the web, and many of them are for free. This following wikipedia rticle compares the most popular of them:
http://en.wikipedia.org/wiki/Comparison_of_hex_editors

- Unless you know what you are doing, I would recommend you to edit your GR2 files with any hex editor anyway. Too complex. :doh:

Thank you, gap. You put it right as usual. :up:

@V13: the problem that I have with your comments is simple - you demand a tool that will do what you want it to exactly how you want it to and prefferably in 1 click (and it seems by reading your mind too :haha:). You "don't have time" to search, try, or figure things out.
Well, all of us have real life outside of this forum too: congratulations, you at least not a forum bot :D.

I'll give you an example of something and hope instead of getting upset, you think a little bit:
When I was cloning a uboat ai unit, it took me over a month to do so. Just to clone, no texture changes, no model imports - nothing except renaming. Little mistakes, wrong clicks, absolutely bogus out of nowhere errors and at least 5 different versions of GR2 editor and a hex editor - and every mistake or error causes you to start from scratch.
It is not "1-click-modding", accept it. As much as I would love to have a fully, 100% functional GR2 Editor - that is not the case at this time. TDW has done an amazing job with what he had for information to start with, there aren't many people out there who could have done anything even close to it, so it feels unfair when your comments bash his work (probably none of my business and he can speak for himself, but I'm a "loud Russian" and can't keep my tong in check).

divingbluefrog 05-27-13 05:13 PM

Quote:

Originally Posted by gap (Post 2010717)
Encouraged by these first results, I discarded the changes and I imported the obj file generated by GR2 editor into Wings 3D 1.4.1, where I made the following changes:
  • split one of the basal edges in two segments, thus generating a median vertex.
  • scaled down the object using the new vertex as pivotting point
  • removed the new vertex

I think it's here that you made a mistake, doing so, you modified the structure of the faces, when you delete it later, Wings generates a new face, but not with the same vertives order.
Try to put a dummy in the same place, and then scale down, acting like this you will keep the faces structure intact.
Hope it will do the trick...

Giant trees exasperate me since the very begining. I had to wait for s3d to solve the problem in 5 mn.

gap 05-27-13 06:17 PM

Quote:

Originally Posted by divingbluefrog (Post 2063791)
I think it's here that you made a mistake, doing so, you modified the structure of the faces, when you delete it later, Wings generates a new face, but not with the same vertives order.
Try to put a dummy in the same place, and then scale down, acting like this you will keep the faces structure intact.
Hope it will do the trick...

Giant trees exasperate me since the very begining. I had to wait for s3d to solve the problem in 5 mn.

Thank you for your suggestion divingbluefrog. At the end I discovered that using Wings 3d I could select the two basal segments of each tree, and use their intersection as pivot point for scaling down the meshes, without need to change object's geometry.

The problem is that there is a sort of minimum size for GR2 trees, below which the size of rendered trees doesn't change, no matter how small are their meshes. On the contrary, their size can be increased at wish. Result: the only way to reduce tree size in SH5 is by reducing their relative size within the 256 x 256 px frame of their texture, as done by echolot :-?

V13dweller 05-27-13 08:28 PM

I am sorry that I am getting frustrated.

I have been trying to workout and use this program for quite some time.

But placing and adding nodes usually create and error, and when even just opening airplanes I get a mixed values error, I get a similar error when opening the AI_Sensors.GR2 and the Guns and radars GR2.

Sorry for expressing how I feel.

(I have reported the errors to TDW already_


All times are GMT -5. The time now is 06:57 AM.

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