Separating Head and Body UVs

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

Separating Head and Body UVs // Archive: Tech Forum

1  |  

Post by Kilo // Jun 13, 2006, 5:55am

Kilo
Total Posts: 10
Hello all -


I posted this in the RealmCrafter forums, but as this is really a gameSpace/trueSpace question, I thought I'd cross-post here (I cross-posted on the gameSpace forums as well, but my understanding is that they don't get read very often).


I have a player character (actor) model created and ready to go, and I have created a UV map in gameSpace for it. I'm running into a bit of a conceptual roadblock, however. Right now, the only way I can see to make this work is to include the head texture in the same JPG as the body texture. In RC, so long as I select "none" for the head and my JPG for the body, the entire model looks fine -- head and body are textured correctly. It doesn't matter if you use RealmCrafter, I say the above only to let you know that I have verified that the model is textured correctly when the entire texture is in one JPG.


Of course, RC allows players to select different head and body textures for the same model at character creation. It is able to do this because the head and body textures are separate JPGs. I would like to do the same thing with my model, but I'm not able to wrap my mind around the process. Can someone post an idiot's step-by-step to doing that?



Here's what I've accomplished so far:


I selected all of the head UVs and moved them out of the visible portion of the UV editor (so that they would not be in the grey square). When I load the model into RC, the body maps correctly (as you'd expect), but I still can't figure out any way to texture the head separately -- loading a JPG that contains the head texture (which lines up with the head UVs) seems to have no effect. Exporting a bitmap of the UVs from gameSpace shows that only the body shows up, even if I pan over so that the head UVs are in their correct position in the grey window and export that. While I grok UV mapping an entire object, it's the separation of the UVs into two files that I'm not getting, and I can't seem to find any tutorials that show how to do this. Any advice would be greatly appreciated!


Many thanks,

Kilo


P.S. If the gameSpace UV tutorial video covers putting UV coordinates for different parts of the same mesh into two files, I'd be happy to buy it, but I'm not certain it conatins anything I don't already know...

Post by TomG // Jun 13, 2006, 3:31pm

TomG
Total Posts: 3397
There are two ways to do this.


1. Assign each their own UV space

To do this, select all the polys that make up the head, and then select a new UV space (so Point Edit, select all polys for the head using the Rectangle select tool say, then apply Cubic or Spherical UV mapping).


Now you have two UV spaces. When you open the UV editor, you can use the controls to show one UV space or the other. The head will now have its own space that can have its own texture, mapped in its own way.


(Conceptually you could select the body and assign it a new UV Space, but given that the body is a more complex shape, it would be harder to redo the mapping :) )



2. Use the same UV space but a different texture

Select all polys as above, and then use the Paint Face tool in the Material Editor to paint a new texture onto the head.


Now, this new texture will be mapped in the same way as the body texture - that is, only the small area of that texture assigned to the head will be used, and the rest will be wasted space.


Since both head and body share the same UV space, there is no getting away from that.


You can of course use as many textures as you like within the same UV space, eg you could paint just one polygon with a different texture. The area of that other texture used by that polygon will be the same relative area as in the original texture.


Most likely you will want to use option 1, as I assume you want to open up the ability to paint in more detail for the head than just using part of the texture applied to the whole figure :)


HTH!

Tom

Post by Kilo // Jun 13, 2006, 8:18pm

Kilo
Total Posts: 10
Hi Tom -


Thanks for the reply! I'm afraid I'm still a bit confused, though. Maybe some pictures would help. Here is what I have to start off with (the model is not mine, btw, but I figured it was better to use one that had a good UV map to start off with -- I've had no better luck even when using a "character" as simple as a sphere attached to a cylinder!):


http://www.exodusproject.com/1.jpg


I highlighted the faces in the head, as you suggested:


http://www.exodusproject.com/2.jpg


... and pressed the "spherical UV map" button. I adjusted the resulting sphere to match the size of the head, and I did indeed get a different UV area, superimposed on the original area:


http://www.exodusproject.com/3.jpg


I believe that the old head UVs are gone, though it's a bit of mess (that can be cleaned up later -- not what I'm worried about).


Here I moved the new head UVs away from the old UVs so we can see the difference a little more clearly:


http://www.exodusproject.com/4.jpg


It's here that I'm stymied. You mention controls on the UV editor to switch between UV spaces. Where are those controls? I've looked in the manual and can't find them. By "switch between UV spaces", I assumed you meant I would have one "frame" with the original UV map (perhaps minus the head), and one with the new UV map of just the head. As you can see, the body UVs are also in the frame with the new UVs. Or by "UV space" do you just mean the unconnected mesh areas (like the hands, head, hair, etc. on the original UV map)? If I have one JPG that paints the area of the head UVs and one that paints the area of the body UVs, should the model still be textured completely? Because that is currently -not- what is happening...


I don't know if you're familiar with RealmCrafter (Solstar and Caligari apparently have a new relationship, so there's hope), but in an RC game, you can assign up to 5 textures (5 different JPGs) for the head and 5 textures (again, 5 different textures -- a total of 10 files) for the body. When the user creates a character, they can cycle through combinations of face and body textures. The problem I'm having is that whatever texture JPG I set for the body, it overrides any JPG I set for the face. I can cycle between the 5 "bodies", but the face textures may as well not be there -- they have no visible effect. The default model (encrypted, sadly, so I can't look at it in gameSpace) has separate JPGs for head and body, so I've been assuming I'm doing the UVs wrong. I tried creating a texture JPG with just the head area of the original UV map (see image #1 above) painted and one with just the body area painted. When I load them up in the game, the head is untextured -- it is not looking at the face texture at all. As I mentioned, RealmCrafter's included models work fine, so I don't think the problem is with RC -- I think the problem is with me. :)


Sorry to be so obtuse, but I'm afraid I'm still not quite getting it...


Thanks in advance for the help!

Kilo

Post by Tiles // Jun 13, 2006, 9:10pm

Tiles
Total Posts: 1037
pic
Maybe my little UV Mapping Editor Tutorial might help a bit to clear things up. Shows and explains all necessary steps ( i hope so ;) ):


trueSpace 6.6 UV Mapping Editor tutorial (http://reinerstileset.4players.de/TS66_UV_Mapping_Editor_Tut_E.htm)


For the somehow chaotic result with spherical mapping, well, spherical mapping may not be the best solution here. Better divide it into even smaller parts and use planar mapping whereever possible.

Post by TomG // Jun 14, 2006, 6:24am

TomG
Total Posts: 3397
That's a good tutorial! See the part about halfway down, where it tells you about the little black arrows right down on the bottom right of the UV editor, on the frame, beneath the widget.


These navigate sub parts and allow you to see different textures and different UV maps on the same object.


Don't forget that you still also need to paint it with a different texture as well as separating out its UV :)


BTW, you dont need to move the UV spaces to separate areas in the editor any more. They can both occupy the full size of the UV editor. They will overlap in the default "see all spaces at once" mode, but when you access sub-parts, you'll see only the UV space you are working with.


THis is where you get the advantage of using an image efficiently (if you separate it out as shown in your example, you will have a lot of "dead space" in the image - ie bits in the image for the head which are unused on the body, and bits on the body that are unused on the head - which will make the image file larger than it needs to be.


HTH!

Tom

Post by Kilo // Jun 14, 2006, 7:54am

Kilo
Total Posts: 10
Don't forget that you still also need to paint it with a different texture as well as separating out its UV :)



Tom and Tiles -


Thanks very much! I've printed out Tiles' tutorial and will work my through it this afternoon. Thank you for that, Tiles, it looks great! I had seen the two little buttons at the bottom of the UV editor and clicked on them, but couldn't figure out what they were doing. From reading your message, I see that since I hadn't yet painted with a different texture on the head polys (I had only separated out its UV), it wasn't giving what I expected. I'll give that a try this afternoon.


Many thanks,

Kilo

Post by Kilo // Jun 15, 2006, 8:54am

Kilo
Total Posts: 10
Tiles and Tom -


An update: I worked through Tiles' tutorial -- really, really great tutorial! I think I completely understand the process now. Unfortunately, it's still not working Realm Crafter, but I'm starting to think that maybe I'm not importing the model into Realm Crafter correctly.


I put together a draft walk-through of what I did, could one of you take a look at it and make sure I did everything correctly from the gameSpace side? It is possible there is a problem with the gameSpace B3D export, but I want to make sure I've got the technique correct before I investigate further. The URL is http://www.ExodusProject.com/CharacterTut


I appreciate the help!

Kilo

Post by Tiles // Jun 15, 2006, 8:58pm

Tiles
Total Posts: 1037
pic
Hmm, TS shows the textures correctly. And so you did everything correct. I have no clue why it makes trouble in Realm Crafter ...

Post by TomG // Jun 16, 2006, 5:22am

TomG
Total Posts: 3397
Yes, the procedure looks fine.


Some things to check - what happens if you paint the model with just one texture but keep the two UV spaces, and then export? Ignore the fact that the head will then have clothing mapped onto it in a weird way :)


This is to determine whether it is the export of multiple textures, or the export of multiple UV spaces, that is the problem. If its the first, then using just one texture will allow the head to show up textured in RC (admittedly with the wrong texture, but the issue will have been isolated to the multiple textures).


If however it still shows up grey, then most likely the issue is that the head does not get a UV space.


BTW you could also try asking on the gS forums (if you haven't already), where you will be more likely to run into a Realm Crafter user :)


HTH!

Tom

Post by Kilo // Jun 16, 2006, 2:44pm

Kilo
Total Posts: 10
'Lo gents!


Just an update: Success!


It turns out that the textures that gameSpace creates must be in the same directory as the mesh, even if those textures are being overridden by the Realm Crafter system as new head/body textures are loaded. Once I did that, the model worked -- I was able to switch between faces and clothes in the character creation portion game client.


I did have a problem in that the scale was way off, so the character was only a couple if inches tall (and so practically invisible), but scaling it by a factor of 15 or so (forgot the exact ratio) fixed that up. I still have a problem with a memory access violation in RC when the actual game starts, so something is missing in the model, but I bet it's related to the quick-and-dirty animation I did and not the model or texturing.


Thanks again for the help! As soon as I iron out these last bugs, I'll update the tutorial and let you know when it's done.


Many thanks!

Kilo

Post by Kilo // Jun 17, 2006, 3:38pm

Kilo
Total Posts: 10
Hi folks -


Just an update, I figured out the memory access violation problem (too many bones in the animation skeleton), so everything works great! I've updated the Realm Crafter-oriented version of Tiles' tutorial on my website:


http://www.ExodusProject.com/CharacterTut


My goal is to have a set of tutorials that covers the entire character development process in gameSpace/Realm Crafter from initial modeling to rigging and animating to importing and set-up in Realm Crafter. Now to figure out how to do bones in gameSpace... :)



Thanks again for all the help, I really appreciate it!


Kilo

Post by Tiles // Jun 17, 2006, 8:21pm

Tiles
Total Posts: 1037
pic
Don´t overdo. Native Bones in TS is a very very special chapter. Lots to have a look at ;)


Maybe even here i can help out a bit. The following tutorial was made with and for TS 4.3 and TS 6.6. gameSpace bones should be the same way.


TS Bones Tutorial , zipfile, 4.5 mb (http://reinerstileset.4players.de/TSbonestut.zip)
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn