Wed, Jan 8, 3:09 AM CST

Renderosity Forums / Poser Technical



Welcome to the Poser Technical Forum

Forum Moderators: Staff

Poser Technical F.A.Q (Last Updated: 2024 Dec 04 2:47 am)

Welcome to the Poser Technical Forum.

Where computer nerds can Pull out their slide rules and not get laughed at. Pocket protectors are not required. ;-)

This is the place you come to ask questions and share new ideas about using the internal file structure of Poser to push the program past it's normal limits.

New users are encouraged to read the FAQ sections here and on the Poser forum before asking questions.



Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: Info on OBJ file structure and topology?


Conniekat8 ( ) posted Wed, 27 June 2007 at 2:46 PM · edited Sun, 17 November 2024 at 7:32 AM

I'm searching for online info for obj file structure and geometry topology, something that explains what is what, and how it is stored etc... Tips and tricks...
Aside from what pops up on google, if anyone has some good info links, would you please share?
Things similar to this link: http://www.robthebloke.org/source/obj.html
The kind of info a programmer might wanna use to write obj manipulation utilities.

Hi, my namez: "NO, Bad Kitteh, NO!"  Whaz yurs?
BadKittehCo Store  BadKittehCo Freebies and product support


nruddock ( ) posted Wed, 27 June 2007 at 3:25 PM

Attached Link: http://www.wotsit.org/list.asp?fc=2

There's a pretty much complete reference linked from the attached link, look for "Wavefront Object files (Acrobat)".

Most modelling programs (other than Maya or Wavefront) don't use most (or even any) of the more exotic possibilities (splines and surfaces).


Conniekat8 ( ) posted Wed, 27 June 2007 at 3:59 PM

Neat, thanks nruddock!

I don't know if there's a utility out there that does this...
Grouping an object for Poser import based on a template....

say I have a main object A, ungrouped (Au.obj) and a groupped version (Ag.obj)
Then I have several morphs of the main object (with vertex order intact)... Bu.obj, Cu.obj, Du.obj, Eu.obj...)

I want something that will look at how Au.obj was groupped into Ag.obj, and do the same to Bu.obj, Cu.obj, Du.obj, Eu.obj

I was looking through the obj file itself, and it seems to be the matter of finding the vertex with the right coordinate (and the right face description), and write out a sequence of verteces and faces from the original file. 
Actually, considering that Bu.obj, Cu.obj, Du.obj, Eu.obj will be used as morph targets, I probably don't need faces, but only verteces to create deltas. (I think, but I'm not 100% sure on this one)
That way if I've created 15 different morphs for a piece of clothing, I only need to hand group one of them.

Seems like it wouldn't be a really hard programming exercise, maybe in VBA? (Way over my head of course)

I'm thinking though I may be able to do the same in a semi automatic way with help of excell or access and a text editor...

I'm still hoping someone has already written a utility to do this... At the moment I'm lost trying to figure out which utility does what, and how... (I'm open to pointers)

Hi, my namez: "NO, Bad Kitteh, NO!"  Whaz yurs?
BadKittehCo Store  BadKittehCo Freebies and product support


nruddock ( ) posted Wed, 27 June 2007 at 4:31 PM

I'm fairly sure that UVMapper (either version) will do what you want.

Load the grouped OBJ, then export the UVs (this saves the grouping as well).
You should then be able to load each ugrouped OBJ and used the UVS file you just saved to set the grouping to match the original grouped OBJ.
(This is the basic recipe for creating FBM with a modeller that treats groups as separate meshes)

There are scripts that will then take the grouped morph OBJs and apply them to the figure in Poser.
svdl did a free one (see Python forum), PhilC has something for this stage in his Poser Toolbox, and I think Netherworks also has something available.


Conniekat8 ( ) posted Wed, 27 June 2007 at 5:12 PM

Ah, UV mapper idea may be a good one... going to try it out...

I dl'd netherworks at home yesterday, but didn't get to try it out yet.
Waiting for an answer in Phil C's forum before I decide whether to purchase or not...
Dimension 3D Tool collection does not appear to do the grouping.
I'll look for svdl's pythion script....

Thanks a bunch, this helps me with getting more direction on what to concentrate on first.... :)

Hi, my namez: "NO, Bad Kitteh, NO!"  Whaz yurs?
BadKittehCo Store  BadKittehCo Freebies and product support


Conniekat8 ( ) posted Wed, 27 June 2007 at 5:52 PM

UV mapper didn't work...
I loaded the grouped model, exported UV's (it does export the group info)
When I loaded the morphed mesh and tried to reload UV's, it said incompatible facet structure.

I can pick faces one at the time and create groups (on the original modeling ap, or in UV Mapper), but that's what I'm trying to avoid.

Hi, my namez: "NO, Bad Kitteh, NO!"  Whaz yurs?
BadKittehCo Store  BadKittehCo Freebies and product support


nruddock ( ) posted Wed, 27 June 2007 at 6:29 PM

Quote - UV mapper didn't work...
I loaded the grouped model, exported UV's (it does export the group info)
When I loaded the morphed mesh and tried to reload UV's, it said incompatible facet structure.

What you can try is saving the grouped OBJ from your modeller before saving the UVs in the hope that it changes the face structure to be the same as the morph OBJs.
If that doesn't work, I'd need to know more details like which modeller your using, and the steps you've used to produce the various OBJ files.


Conniekat8 ( ) posted Wed, 27 June 2007 at 6:53 PM

I'm using hexagon.

here's what I was looking at in the OBJ files...
File Au  (unmorphed, UV Mapped)
begining of the file:

#Wavefront OBJ file created by Hexagon 2
mtllib apron-zero-uv.mtl
g Apron

4572

v -0.06199 0.43279 -0.01487
v -0.06185 0.43237 -0.01504
             ...etc
             ...then switch from v to vt.. 
v -0.04615 0.58628 0.04128

4709 1

vt 0.61878 0.922992
vt 0.618964 0.936212
             ...skipping normals...then switch from vn to f..
vn -0.167595 0.598853 -0.783127
vn -0.167595 0.598853 -0.783127
f 323/325/352 324/326/353 303/314/330 302/310/329
f 323/325/352 302/310/329 300/306/327 321/324/350

I see the in my grouped file, the grouped vertices start with a particular coordinate v, and continue in the same order as they did in the other file. Let's say group 'neck' started at vertex 62 of the original file Au, and continued for 125 vertices (obj file text lines)... in this file.  I'm seeing that in my files Bu, Cu.. the same thing happens. The neck vertices always start at vertex 62, and go for 125 lines.  Same for other groups, 126+62nd line always gives me a vertex that starts a chest group. In each of the files.

This leads me to believe that one can write a utility that does the following:
Compare grouped and ungrouped object Au and Ag, and determine that...
Vertex 1-325=neck group *(I'm making up the numbers here, for illustration, the program would determine the real numbers by searching for mesh coordinate identical to the begining of each group)*Vertex 326-1487=chest group
Vertex 1488-2579=skirt group
Vertex 2580-3711=hip group etc...

now, take one of the morphed objects (with identical vertex order) and chop up the text.
Take verteces 1-325, and re-write them in a new obj file with it's relative group heading,
take the next set of vertices, and write out the next group..... 

And one ends up with a regrouped obj file, based on a grouped template.

I'm talking about vertices only here. To create morphing delta's for inj, or for inclusion in cr2, I only need xyz information for vertices. 
I bet same, or similar thing could be done for facets too, as I understand that facets depend on a particular order too, but I didn't analyze it on an actual sample yet. 

If you're interested in getting the copy of the obj files I'm talking about, please email me at conniekat8@yahoo.com, and I'll be happy to send them.

Hi, my namez: "NO, Bad Kitteh, NO!"  Whaz yurs?
BadKittehCo Store  BadKittehCo Freebies and product support


Conniekat8 ( ) posted Wed, 27 June 2007 at 8:35 PM

Addition...
As I was driving home amd mulling over how to do this it occured to me that I neglected to consider vertices along shared edges.

I expect that those would follow some sort of a pattern that would be identical in all of the ungrouped obj's, and could be transposed into grouped obj's.

Hi, my namez: "NO, Bad Kitteh, NO!"  Whaz yurs?
BadKittehCo Store  BadKittehCo Freebies and product support


Conniekat8 ( ) posted Thu, 28 June 2007 at 10:13 AM

I experimented more last night and noticed that hexagon separates vertices (v's) into groups, where UV mapper separates facets (f's) into groups.

With UV mapper resaved obj I was able to copy the facet section out of a grouped file, and paste it into an ungrouped file...  without messing with the vertices section.

Hi, my namez: "NO, Bad Kitteh, NO!"  Whaz yurs?
BadKittehCo Store  BadKittehCo Freebies and product support


kuroyume0161 ( ) posted Thu, 28 June 2007 at 10:30 AM · edited Thu, 28 June 2007 at 10:31 AM

Hexagon may be doing what some other 3D apps' default OBJ import do: treating groups as separate objects.  In reality, Poser does the same thing for figures when it creates body parts, but it isn't something you need to consider.  When this happens, shared vertices are duplicated and usually vertex order is lost.

Think of a Wavefront OBJ file as two basic areas: a vertex list (this includes UV texture vertices (vt) and normals (vn)) and a facet list (polygons (f)).  Groups (g) and materials (usemtl) only group facets (no matter where these are defined) and vertices are assigned by index to the facets.

You are correct that morphs are only interested in the vertices and nothing else.  The most important part here is that vertex ordering and count should be maintained.

C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, you blow your whole leg off.

 -- Bjarne Stroustrup

Contact Me | Kuroyume's DevelopmentZone


Conniekat8 ( ) posted Thu, 28 June 2007 at 11:04 AM

kuroyume, thanks for clarifying that :)

I was wrong on my earlier post... the number of vertices changes, so the facet definition is no longer correct = jumble of facets.  I thought I opened one of the files I grouped in this fashion yesterday and seen it work... but it was late evening, who knows what I did.

Need to find which vertices have been duplicated along group seams, and pluf them in the same location. With a grouped template file that should not be hard to find.

I'm still convinced this can be programmed. I need to find someone who can program things. I'm only three pages into VBA for dummies.

Hi, my namez: "NO, Bad Kitteh, NO!"  Whaz yurs?
BadKittehCo Store  BadKittehCo Freebies and product support


nruddock ( ) posted Thu, 28 June 2007 at 1:19 PM

Quote - I'm still convinced this can be programmed.

It'll take a little time to work out how Hex2 is rearranging things.


Conniekat8 ( ) posted Fri, 29 June 2007 at 11:04 AM

Yea... that's what I'm trying to decipher, what happens to the OBJ files exported from hex, UV mapper etc...
I'm not sure where that'll lead me, because even when I figure that out, I still can't create a program to manipulate them :(

Hi, my namez: "NO, Bad Kitteh, NO!"  Whaz yurs?
BadKittehCo Store  BadKittehCo Freebies and product support


Conniekat8 ( ) posted Fri, 29 June 2007 at 5:32 PM

AHA! 
I found a UV Mapper workaround! happy dance 
this has been driving me batty for a week now.

You can use an obj that has been grouped in UV mapper as a template, but you can NOT use an object that has been grouped in hexagon as a uv mapper grouping template!

Hi, my namez: "NO, Bad Kitteh, NO!"  Whaz yurs?
BadKittehCo Store  BadKittehCo Freebies and product support


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.