xantor opened this issue on Apr 22, 2008 · 7 posts
Conniekat8 posted Wed, 23 April 2008 at 12:15 AM
when you save an OBJ with UV mapper, it places both, Group and Material assignment codes in the facest section of the file (as opposed in the vertex section). This is why it's important to first open your OBJ in UV mapper, then save it. Changes the internal order of things a little bit.
I grabbed one of my objs... this one has only one group, but that doesn't really matter.
The begining of the facet section looks like this:
g !00Body
usemtl Suit
f 1/10/1 2/1/2 3/2/3 4/5/4
f 1/10/1 5/4556/5 6/4590/6 2/1/2
f 7/6/7 4/5/4 3/2/3 8/15/8
f 7/6/7 8/15/8 9/16/9 10/7/10
f 11/3/11 12/4/12 4/5/4 7/6/7
etc etc...
g !00Body stands for (g)=tells ptograms it's a begining of a group section (!00Body) = name of the group - I assign the name*
*Next line:
usemtl Suit stands for (usemtl)=tells ptograms it's a begining of a material section, in this case and UV mappers obj file structure it happens to coincide with group section, which is just what you can take advantage of! (Suit) = name of the material, as I assigned.
Note theese things ARE case sensitive!
Now, you can do search and replace, and either add a line:
Search would be: *usemtl Suit(wildcards for the word)
*Replace with: *usemtl Suit (new line) g Suit
*(more advanced text editor needed for this, where you can add new paragraphs and wildcards)
Or if you don't care about losing material zones, you can do this:
Search would be: *usemtl
*Replace with: g
3. in a simpler editor you can duplicate the lines with a bit of hand copy and pasting, and have two:
*usemtl Suit
usemtl Suit
*Then run a search and replace as described in #2, but don't hit replace all, but alternate replace, don't replace, replace, don't replace. (usually goes quickly with ynynyny strokes on the keyboard Yes, Next, Yes, Next in wordpad or notepad)
You'll end up with:
usemtl Suit
g Suit
*f 7/6/7 8/15/8 9/16/9 10/7/10
f 11/3/11 12/4/12 4/5/4 7/6/7
*etc etc...
usemtl arm
g arm
*f 7/6/7 8/15/8 9/16/9 10/7/10
f 11/3/11 12/4/12 4/5/4 7/6/7
etc etc...
usemtl leg
g leg
**f 7/6/7 8/15/8 9/16/9 10/7/10
f 11/3/11 12/4/12 4/5/4 7/6/7
*etc etc...
ALWAYS save this obj with a different name, in case you goofed up and need to revert. That kind of goes without saying, but I'm saying it anyway :)
Hi, my namez: "NO, Bad Kitteh, NO!" Whaz
yurs?
BadKittehCo
Store BadKittehCo Freebies
and product support