An idea &/or question related to info in the obj file

Shortline2

Joined: 28th Oct. 2002
Hi all,

Thanks to some work done by a friend of mine I have got a situation where it would been great and quite helpful to me to figure out some stuff I think hide it self in the obj file related to a map/route in Trainz.

Are there anyway to get X, Y & Z and angle (rotated) info for objects (like houses) out from Trainz?

I know it would be only for the rotate point (the zero gmax/modeling program point), but it would been more then enough for me.

The idea is to use this info is as following.

* I have a map where I place stuff in Surveyor (like we all do)
* I then have a way to get the locations of selected stuff (inside a square/rectangle for instance) through a program or something listed as X, Y, Z and angle rotated.
* I use this, together with a exported small X,Y, Z ground info to custom build a scene to be put back into Trainz and fitting the location perfectly. Of course, I can only use houses and stuff I have the source files for inside of gmax.

I guess I'm dreaming here, but I can vision it in my head and I love it. :D :udrool:

The ground part I have, thanks to a friend - real great stuff.
Now, to have it paintable inside Trainz... Auran, help, please LOL

Either way, hope this was the right forum.
Now, back to house building, then landscape rebuilding, road building, town building...

Best wishes all

Linda
 
Last edited:
An interesting idea. I don't know about reading the .obj file, but once you have, you don't need the source GMAX to re-create the file, it can all be done using attached meshes, which can call any scenery item by KUID. All you need is a mesh with a series of attachment points (derived from .obj data or by other means).

This could be very useful if you want to repeat the same collection of buildings several times. It would also be possible to add splines as attached track. As this method does not include any data from the referenced items, it would seem that publication of such an item should not be problematic. Would any creator object to their work being referenced in this way?

Paul
 
Hi,

Thanks for the reply.

My main idea was to better fit houses to the landscape, and as I'm very into mountain type of landscape I tend to have steep slopes and lot of uneven ground.

The idea was to export part of the ground into gmax, to go around the 10m grid limit, use dighole to remove the grid inside of Trainz, and put in a exported mesh from gmax fitting the holes perfectly (till I change the ground inside TRS that is... :)).
So far, so good - I'm there and it works like I want.

But, placing houses inside gmax (from my own "library") turned out to be hard, as I don't get to walk around in gmax as good as I can in Trainz.
Getting a look at the structures from various angles and viewpoints was hard - hence I wanted to use Surveyor and the tools there to place the structure.
Then read the X, Y, Z and angle info (if their are in the obj file) and use that info to place a copy of my gmax source file for that house into the same X, Y, Z and angle spot into my gmax ground mesh.
Then, rework the structure to fit the ground, or rework the ground.
Finally, export back the ground with houses attached to Trainz and voilà - a new scene perfectly fitting a narrow valley with a lovely mining scene and a small town... :)

I love dreaming. LOL

Reminds me I need to write a friend to say how pleased I am with the help I was given.

Best wishes all

Linda
 
Hi, Linda glad to hear the terrain is working out ok. The xyz position of the scenery objects, rotations and tilts are all available in the obs file. I don't have the latest format and my last requests to Auran were put off due to limited staff and their work load. Things are not looking too good at the moment that I'll ever get them now. I'll probably have to resort to a lot of trial and error to work out the new changes.

Basic scenery items though should be readable under the format I have. I have programs that read most of the TRS2004 version. As with most of the utilities I use for my own use they are Python scripts with very little in the way of user interface. Usually editing them for each run. It's possible to skip unknown objects when reading the file so for most kinds of objects the info you're looking for would be possible to extract.

Bob Pearson
 
Hi Linda,

I should be able to "dump" (i.e. analyse and convert into clear text) the contents of an .obs file to a text file. Like Bob I can't guarantee that I will be able to decode all object types to the last detail as I concentrated on the coordinates. In the dump file you can find KUIDs and Trainz world coordinates with position and rotation for each object. It'll be somewhat difficult to read but the information you are looking for would be in it.

geophil
 
Hi Bob, and geophil,

Thank you both for the replies.

Bob, I wanted to write and thank you, but it drowned in so many non computer stuff that I feel a little bad for it.
I love the little program, it was worth the trouble getting it to run, find and install Python and all that - I've used it for a couple of projects (meaning at least 8 runs of the program) and I just love the little program and what it helped me getting starting!
The fact I tend to wish for more is a way to show how I like it. LOL Dreaming about how it can be used for even greater stuff is a way I tend to be about programs I have - that is why i love Trainz it self, the way it can be used to so many stuff. :)
Having the export of a part of the ground was a big step forward to creating parts of a better looking scene - and it was when I get to my little canyon and mine scene I learned how the X,Y, Z and angle info of objects also could become very useful.

I envy in many ways you, and geophil, and other's that understand how programming works, because you have the opportunity to help your self expanding on how you can use a program like for instance Trainz way beyond d what the makers of it had in mind.
I have so many dreams and idea's on how I could have used Trainz, that I only can get a part of done as I need to relay on great people like you two - and I'm for ever thankful for each time I get that help, and I feel sort of in debt to you both for the great stuff I have been able to use for my own enjoyment!

Now, back to my thread and post. :)

I'm sad to learn/hear that Auran now may not ever get into sharing the details, and that you both need to spend lot of time with trial & error to read the file and understand it correctly (in all it's info about all stuff that is :)).
For my use, right now I would be more then happy with just a way to get file I could read - even if I need to spend time digging through it and find the info I wanted.
Right now, I can't even get that as I can't open the obs file and see anything of use - a dump of it is way better then the strange looking text I see in notepad now I would guess. :)

Thank you both again for replying - my dream program would be a combination of TransDEM and the export gnd file with a text file holding the info from same area from the obs file into one program.
But, that is only because I bought TransDEM and loved it. :)

OK, I have more dreams related to TransDEM, and tweaking of the gnd file for Trainz - but that is for another time and year. ;)
For now, I will use the gnd2dxf program to create small scenes in gmax, help create custom bridges for a canyon and so on.
And, if there will surface a small program to get a dump or something for the obs file for a map - I will jump on the chance to play with that and use that too for whatever it can help me with.

Thanks all!!

Now, CSI time :)

Linda
 
Linda,

As being able to help you, I am sorry but I am clueless !
Why post then you ask ?
I know you are a member of TPR, and I also know that there are members there that have cracked several Trainz codes recently. Have you posted at TPR the same request ?
Just a thought ---

Good luck in your quest for this info ---,dave
 
Hi Dave,

Not 100% sure what you saying, but I got my question answered in the form that I got it confirmed that the info I would like to get is in the file I thought it was in.
The part where I can get hold of the info is a little bit trickier, but as my interest into Trainz and creating is like a railroad going into the mountains (up and down, inside and outside... LOL) I haven't really been into a biggest hurry.

My thread was based on the idea I had in my mind at that time, and while I would love to see the info from the obs file right now, I also know it would take some time to get hold of a program that can repeat a read of the file as I know a one time read of it would be not to helpful as I tend to change the objects in a route often as I go alone modeling stuff I have a need for.

Yes, I'm a member of TPR, and I sometimes have used that forum to seek help too, and I'm sure I be back there too and put ideas into people. ;)

For now, I know it is in the file, I have better understanding it can be found by at least two people in some way or another - and that makes me hope that one day in the future there will be a way for me too to get to it, as often as I need/want.

Right now I'm into a "don't feel for gmaxing" period again - but things like that change real fast.

Thanks for commenting, and hope I haven't misunderstood something.

Best wishes

Linda
 
Linda,

it may be worth a try. My dump utility doesn't have a user interface but I only need to change very few lines of code to be able to process a particular .obs file. A couple of minutes. And simple building-type objects should reveal their placement attributes without any modifications to the code.

geophil
 
Back
Top