OBJ Convertor

Started by bobbystahr, February 27, 2007, 10:45:21 pm

Previous topic - Next topic

bobbystahr

Apologies for double posting this but it seems appropriate here as well as in the thread I posted it in originaklly
As a further exploration on getting .obj into TG2 with textures I found this in the Vue Forum at Renderosity. It's very good at converting .obj but re pathing the textures needs to be done if they're in any folde except the one the final .tgo will live in. I have been importing the .obj and saving as .tgo straight away and then re pathing the textures on the .tgo and re saving it over itself. Here's a render of a model found online. The app is called PoseRay and can be found at:
http://mysite.verizon.net/sfg0000/  It says there that you need POVray installed but others have found that not to be the case. I installed POVray anyway to be certain as ther was a link to it on the same page.
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

bigben

The installation of POV-Ray is probably just for the POV-Ray output.

It's certainly easy to use for just conversion. I've only tried one model which worked nicely apart from being rotated -90° about the X-axis but this was easily fixed in the TG object properties... and I'd had this happen with other models from the same source.

Thanks for the link.

bobbystahr

February 28, 2007, 01:36:57 am #2 Last Edit: February 28, 2007, 01:39:14 am by bobbystahr
"apart from being rotated -90° about the X-axis " ...that could be due to where the model [which app] originally came from as the ones I've tried all came in rotated away from the camera[around the Y], heh heh heh, and you're most welcome. If you are creating your own .obj's that don't import, and can keep the shaders under 16, this is the answer
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

bigben

They're all from different sources, and having played more object now, this tool is providing the most robust versions of these objects that I've used in TG yet. Now I'll just have to read some more docs to sort out some sizing issues (miniature trees and giant grass).

While it's easy enough to scale them in TG it is a bit of a pain.  My saved TGOs retained their corrected rotation but not their scale... although I will try again later to make sure.

bobbystahr

In my limited experience nothing in TG2 retains it's scale,all load in at 1,1,1 and need resizing upon loading, even the XFROG freebies in a population. Just part of the load in I guess and in a way it's good as you can scale stuff to what ever scale your scene is in. Relatively minor and doesn't take much time compared to the render times...LOL
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

joshbakr

Thanks for the lead on the software bobbystahr. I just tried it out and exported an .obj, it exported mtl file and all paths to the mats. I loaded it into TG started a render and of course , POOF! LOL  I restarted TG loaded the obj again, checked the mtl file and everything looked good so I thought I would export it as a TG tgo, which I did. Started another TG scene loaded the tgo that I just exported then went to look at the mtl file and no image maps? Help! What am I doing wrong?

bobbystahr

February 28, 2007, 07:18:30 pm #6 Last Edit: February 28, 2007, 07:21:07 pm by bobbystahr
I've found, using PoseRay for correcting the .obj still doesn't correct the map path in TG2. I always, upon loading the .tgo, go into it's multishader and re-path all the maps and then re- save the .tgo, delete it and re-load it. So far all I've done that way load fine.. ...
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

joshbakr

Quote from: bobbystahr on February 28, 2007, 07:18:30 pm
I've found, using PoseRay for correcting the .obj still doesn't correct the map path in TG2. I always, upon loading the .tgo, go into it's multishader and re-path all the maps and then re- save the .tgo, delete it and re-load it. So far all I've done that way load fine.. ...


OK thanks,  I'll give that a try.

bobbystahr

     I'd just like to say her a thankful "Tip Of The Hat"  to alexcoppo at the Vue Forum at Renderosity for bringing this app to light. I don't know a lot of POV Ray users and may never have tumbled onto it without his posting  about it there.. ...
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Mandrake

I don't know Bobby, Some objects are scalable and others imports are not.
For me anyway..

MooseDog

Quote from: bobbystahr on February 28, 2007, 07:18:30 pm
I've found, using PoseRay for correcting the .obj still doesn't correct the map path in TG2. I always, upon loading the .tgo, go into it's multishader and re-path all the maps and then re- save the .tgo, delete it and re-load it. So far all I've done that way load fine.. ...


did you know that the .mtl file is editable with any text editor?  if i understand what you're saying, just do it in there beforehand.

example .mtl:

newmtl apple_leaf
Kd 0.784314 0.784314 0.784314
Ka 0
Ks 0
Ns 40
d 0
Ni 1
Tf 0
sharpness 0

map_Kd G:\Lightwave9Content\Images\tgo_test_tree\all_leaves_color.tif
map_d -imfchan l G:\Lightwave9Content\Images\tgo_test_tree\apple-leaf_clip.tga

newmtl apple_wood
Kd 0.784314 0.784314 0.784314
Ka 0
Ks 0
Ns 40
d 1
Ni 1
Tf 0
sharpness 0

map_Kd G:\Lightwave9Content\Images\tgo_test_tree\UV_apple_wood_color.tga


note that i then simply changed the map paths to C:\Program Files\TG2\Objects\....tga

bobbystahr

February 28, 2007, 10:10:08 pm #11 Last Edit: February 28, 2007, 10:13:46 pm by bobbystahr

did you know that the .mtl file is editable with any text editor?  if i understand what you're saying, just do it in there beforehand.




No I hadn't thought of that really. Unfamiliar with the .obj format as I am it's the last thing I'd think of. Not really a dab hand at that sorta thing but if it'll save time, guess I'll learn. Just open the .tgo in NotePad or whatever and bash away I guess is the path for me to work on now. Could one just copy and past paths from the .mtl to the .tgo.... that would speed things up as well as it's the .tgo where they don't load properly.. ...
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

MooseDog

Quote....Just open the .tgo in NotePad or whatever and bash away ...


i'm always happy to be proven wrong, but afaik and would presume (with it's attendant dangers ;D ) that the .tgo format is not editable.

proposed workflow (if it helps anyone :D) :

1.)  model and/or whatnot in app xyz as you wish, save both .obj and .mtl

2.)  move/copy both files to appropriate tg2 folder.

3.)  open .mtl and type in appropriate path info for those materials that need it.

4.) NOW open tg2 and do .obj import and .tgo convert thing (for render stability atm).  since tg2 is reading the .mtl file associated with the object, material assignments and paths to images should be all set, having done so before tg2 was opened!

5.) render amazing photo-real landscapes  ;D


bobbystahr

As a general rule I've found that as long as I don't attempt a render the .obj can be edited via the multishader as well and then saved as a .tgo, but I've found that even with this you still have to repath the maps once you load the .tgo so no matter if you pre edit the .mtl you're still going to have to re-path the .tgo...I could be wrong but won't know till I've actually done a virgin .mtl file....will post on this when I've done that but toooooo busy for fun today...off to reherse now...see y'all later
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

SeerBlue

Poseray does agreat job of converting 3ds files to obj, which open and render without crashes, BUT, you have to make 2 changes in Poseray's groups tab, under the faces,vertices and normals tab, first click Drop y = 0, and then to the right of that under scale and rotation reference point click origin, then all that needs to be done is click the green check mark to update the file before exporting as an object.
If you don't do this all the objects, or at least the ones I have experimented with, will be about half submerged in the surface. SeerBlue