KatsBits Community

Game Editing => 3D Modeling & Content Creation => Topic started by: sam1 on March 01, 2012, 09:38:02 PM

Title: How do I add eyes to UniHuman?
Post by: sam1 on March 01, 2012, 09:38:02 PM
I have managed to animate and export md5mesh to platinum arts sandbox but I can't seem to add eyes on her head so that they show up in PAS. So I tried another approach and deleted its head, and voila her head was gone but everything else worked fine. I'm very noob to blender and any 3d application but I've tried every trick I've learn from the net but to no avail. Could someone please elaborate how to do that because I would really like to know how to add meshes to it like clothes and accessories but the eys are really what I would like to learn how to do now. The UniHuman I'm using is this version because the one I tried from the author had wierd distortions when exporting to PAS.
http://forum.sandboxgamemaker.com/viewtopic.php?p=3890

My blender is 2.49b on ubuntu
Title: Re: How do I add eyes to UniHuman?
Post by: kat on March 02, 2012, 03:27:54 AM
Looking at the image supplied on sandboxgamemakers forum it looks like the UniHuman isn't yet set up with separate 'eye' meshes. At a guess that means you're going to need to paint them directly onto the character 'skin' as indicated below (see attachment). There should be an image file available/associated with the mesh that will allow you to 'paint' the eyes into the sockets indicated (highlighted red).

[EDIT]correction.. just had a look at the actual file itself, so far as I can tell it doesn't yet have any eyes so the socket is bare - no mesh. If this is correct (I couldn't find any mesh object in any of the other layers in Blender), and based on the meshes construction, it looks like the eyes are going to be spherical objects and that will probably mean separate texture maps.
Title: Re: How do I add eyes to UniHuman?
Post by: sam1 on March 02, 2012, 09:13:30 AM
Thanks for the reply kat but I'm still confused.

With PAS comes model named uh and it has eyes added but the question is how do I add them so that they appear in PAS when exporting? I made eyes from part of a sphere and joined them with the head mesh i had separated so now when I pose or move the head the eyes follow but they don't show up in PAS.

Here is link to the pictures I took in blender of uh:
http://imageshack.us/photo/my-images/843/58936946.png/
http://imageshack.us/photo/my-images/811/77132808.png/
http://imageshack.us/photo/my-images/827/29312735.png/
http://imageshack.us/photo/my-images/707/93299701.png/

Title: Re: How do I add eyes to UniHuman?
Post by: sam1 on March 02, 2012, 11:16:54 AM
Just to be clear, what I need to know is how to add eye mesh to the existing unihuman so that the md5mesh exporter understands it's part of the unihuman.
Title: Re: How do I add eyes to UniHuman?
Post by: kat on March 02, 2012, 03:18:32 PM
You'll need to post a link to the exact file you're using so I can take a look at that.

For now though, there could be a couple of reasons; it sounds like the eyes might be inverting if they are there in the mesh but not in-game (as per your shots) - that means the faces are pointing inwards so you'll need to (confirm) "Flip Normals" in the "Mesh Tools" panel when in Edit mode. Alternatively if you're editing the mesh and adding structure to it, you need to make sure they are properly vertex parented else they may be 'reset' and collapsed to 0,0,0 grid space on export.

Slightly OT, I searched "PAS" but came up empty. Link?
Title: Re: How do I add eyes to UniHuman?
Post by: sam1 on March 02, 2012, 05:07:04 PM
PAS is just short for platinum arts sandbox;) 

I zipped the uh model that comes with the sandboxgamemaker with the model I'm trying to put eyes on called sam1model.blend, here's the link;
http://www.filefactory.com/file/c346e82/n/uh.zip

Thanks a ton for the help, I'll try to flip the normals and check that vertex thing if I can and know how.
Title: Re: How do I add eyes to UniHuman?
Post by: sam1 on March 02, 2012, 05:16:58 PM
If that link didn't work try this one;
http://www.zshare.net/download/9922463846d38760/

Edit; I changed the filehost because the earlier asked for emailaddress.

Edit 2;

Link fot the PAS;
http://www.sandboxgamemaker.com/
Title: Re: How do I add eyes to UniHuman?
Post by: kat on March 02, 2012, 05:42:09 PM
Yep, the eyes are inverted so you'll need to do what was mentioned above and flip the normals. You'll also need to set "Smooth" on those so they don't appear faceted in-game (it's not set in the file).

You mentioned above that you tried to add a set of eyes to the mesh? You shouldn't need to do that if "UH" has them built in (you mentioned it does?). So... if the zip file you posted above is the exact model as used in the tools then you'll need to get in touch with SandBox devs and let them know there's an issue with they eyes... I suspect that they're using a double-sided material which means then may not know about the problem.
Title: Re: How do I add eyes to UniHuman?
Post by: sam1 on March 02, 2012, 06:35:57 PM
Yes the eyes were inverted but because I flipped normals on whole head the result was that;
http://img585.imageshack.us/img585/5382/screenshot52004.png

Haha:) Anyway, I now know thanks to you what the problem is and I'll have to make the normals flipped before I join them with the mesh.

The UH model that comes with the Platinum arts sandbox has the eyes but the UniHuman blend I used has no eyes...
http://forum.sandboxgamemaker.com/viewtopic.php?p=3890 

but has sliders to modify the mesh so I use it. I haven't found updated UniHuman with eyes so I think that the maker of the modified UniHuman just added eyes to it and it was put in the models in sandboxgamemaker. I tried to register in the platinum arts forum but never received email so I can't go there asking if there is updated unihuman with eyes but I haven't found it from the forum or anywhere from net so I don't think or know if it exists unfortunately.
Title: Re: How do I add eyes to UniHuman?
Post by: kat on March 03, 2012, 04:22:08 AM
You can flip the normals before or after joining the spheres to the mesh - use "Ctrl+A" and "Apply > Rotation/Location" to 'fix' the meshes before joining them to the character mesh. To make sure to correct the problem once joined to the mesh, in Edit mode, use "B" (press it twice if you're using 2.49) to select the eye meshes and then flip the normals as per the above; this particular action is selection based so it'll invert whatever is active, that way you won't invert the entire mesh.

The sliders you see aren't for the eyeballs, they're for the socket, the area around the opening for said eyes - sliding those adjusts the size of that area, not the eyeballs themselves (which should generally remain spherical otherwise you get problems when moving them independent of the socket they effectively 'in').

It might be worth getting in touch with SandBox support to sort out your forum issues, you could also probably query them on an updated "UH" file at the same time.
Title: Re: How do I add eyes to UniHuman?
Post by: sam1 on March 03, 2012, 08:08:29 AM
Thanks alot for the tips. Yesterday I shift+rmb selected the visible parts of they eyes in editmode and flipped normals and the result was this:
http://img856.imageshack.us/img856/1456/screenshot79785.png

I still have that spiky thing sticking out of her jaw below coming from her left eye and don't know what to do about it. Also the eyes look weird and are not in their correct places so I have to do them again unless theres a procedure to fix them in edit mode somehow.

I was wondering what that round thing was when I had accidentally pressed b twice earlier so it's nice to know what it does;D. I just noticed it gets bigger or smaller with scroll wheel which is very handy.

I will ask the PAS staff if there is UniHuman with eyes available and also notify that the registration form may have some issues.
Title: Re: How do I add eyes to UniHuman?
Post by: kat on March 03, 2012, 09:19:21 AM
You've got a couple of issues to content with and the fix is a little fiddly if you're not familiar with using Blender yet;

(1) The eyes look the way they do because they don't appear to be UVW mapped or properly textured, you need both for game use. Have a read through this section of the above tutorial on UVW mapping (http://www.katsbits.com/tutorials/blender/basic-unwrapping-uvw-maps.php).

(https://www.katsbits.com/images/tutorials/blender/animation/unihuman-eyes-not-uvw-mapped.jpg)
(https://www.katsbits.com/images/tutorials/blender/animation/unihuman-eyes-fully-uvw-mapped.jpg)

(2) the positioning issue is likely related to vertex parenting - I've not yet written a tutorial on this (I'm doing one at the moment but it won't be available for a while). In Edit mode, you need to check the assignments of vertex_groups to the mesh, the eyes need to use the same ones as the head and only the head otherwise they may be unduly influenced by additional groups (which will pull the sub-meshes out of shape).

(https://www.katsbits.com/images/tutorials/blender/animation/unihuman-vertex-group-eyes.jpg)

Select the mesh in "Object" mode  and switch to "Weight Paint" mode (an option available in the 3DView header - the mesh will turn 'blue'), you'll be able to see the colour influences of each group on the mesh. Select the 'head' group and see which elements change colour. The eyes should turn red.

(3) the 'spike' exiting the chin is a vertex that hasn't been 'weighted' and/or isn't yet assigned to a vertex group. When that happens Blender automatically parents the elements to the 'root' bone of the mesh on export, resulting in what you see. So again in "Weight Paint" mode, be sure all the eye sub-mesh vertices are assigned a group (refer to the 'blue' areas in the image above).

The round thing in 2.49 is "Border Select" - have a read through this section of the "Learning Blender (http://www.katsbits.com/tutorials/blender/basic-modeling-mesh-editing.php#borderselect)" tutorial to learn more about using it.
Title: Re: How do I add eyes to UniHuman?
Post by: sam1 on March 03, 2012, 12:12:09 PM
Ok I'm going to need soon some smart pills to go through this all and your tutorials but for now I managed to get rid of the spike by weightpainting the nonred parts of the eye:
http://img15.imageshack.us/img15/615/screenshot104038.png

I had to go inside of the head in wireframe mode because I couldn't get only the eyes visible like in your picture. Then in edit mode unwrapped and I think I see the eyes in there with something in the middle I'm not aware of what it is, and the image flipped 90 degrees but I can always rotate it in gimp when coloring and then rotate back for the blender. Here's the UV map;
http://img687.imageshack.us/img687/3507/sam1headhead.png

I haven't textured yet except before I splitted the mesh in three; head, torso and legs, because the uh model was in 3 parts too and had 3 skins. I just wanted to see what part of the UVmap was hair, legs arms and so on so I colored the different parts, made shirt and pants and painted some toenails or what I thought to be the toenail, not the bottom side of the toe:D

Thanks again for the help. I emailed to PAS team and asked about the registration and possible unihuman with eyes, now waiting for their reply.
Title: Re: How do I add eyes to UniHuman?
Post by: kat on March 03, 2012, 02:12:51 PM
Sorry yes, I should have clarified, I detached the head so you could see the issue more clearly because it's difficult to make sense of what's going on from the inside. You seem to be getting the hang of the problem though, just make sure you don't inadvertently overwrite any original data with the changes you're making  otherwise it might cause compatibility issues in-game.
Title: Re: How do I add eyes to UniHuman?
Post by: sam1 on March 04, 2012, 01:57:51 PM
I got the clothes on for her in blender but not in the platinum arts sandbox;
http://img851.imageshack.us/img851/3885/ruv2.png

and the other eye has some issues, missing parts...
http://img408.imageshack.us/img408/4534/eyebroken.png

but overall I'm happy I managed to cloth her in blender which I couln't achieve without your tutorial because I had no idea it had to put in the materials first and then textures and so on.

No email from the platinum arts team yet so waiting.
Title: Re: How do I add eyes to UniHuman?
Post by: kat on March 04, 2012, 03:06:45 PM
That's pretty decent relative to what you're having to work with. Don't worry about using the render engine for your screenshots, there's a button in the 3DView header which looks like a little picture (should be far right of all the other layer buttons and what have you). Click that and it'll capture the scene based on what you're looking at.

The eye looks like some of the faces are still pointing the wrong way. In Edit mode, find the "Mesh Tools More" panel and click the "Draw Normals" button, a tonne of blue lines will appear. Use these to help you figure out which way around the faces are pointing - they should point 'outwards'. Also check the UVW map to make sure that's done correctly as it looks like it still mapping each of the faces individually.

(https://www.katsbits.com/images/tutorials/blender/animation/unihuman-draw-normals.jpg)
Title: Re: How do I add eyes to UniHuman?
Post by: sam1 on March 05, 2012, 03:52:34 PM
I fixed those eyes by going inside her head again and selecting the ones pointing inwards and flipped normals. Now the eyes are totally visible and no more missing parts. Thank you again.

Hurray, I found out how to get the model textured in platinum arts sandbox. In the uh model man.md5mesh that comes with the platinum arts sandbox is lines that were missing from my md5mesh.

mesh {
   // meshes: body

   shader "/home/tha/Desktop/laptop/Desktop/blender/unihuman/man-textured02/body-ampel-shirt.tga"

mesh {
   // meshes: head

   shader "/home/tha/Desktop/laptop/Desktop/blender/unihuman/man-textured02/head-proj2.tga"

mesh {
   // meshes: legs

   shader "/home/tha/Desktop/laptop/Desktop/blender/unihuman/man-textured02/legs2-jeans.tga"

The missing lines were:

// meshes: body
// meshes: head
// meshes: legs

After adding those lines in their proper places by opening the mesh with texteditor and saving when finished I was happy to find out she had skin finally:
http://img717.imageshack.us/img717/1880/screenshot120841.png 




Title: Re: How do I add eyes to UniHuman?
Post by: terrymorgan on June 25, 2012, 03:07:02 PM
Here's a fat unihuman with eyes in obj format

http://terrymorgan.net/uni_human.zip
830K
http://terrymorgan.net/images/uni_shot.jpg
No attachments?
Title: Re: How do I add eyes to UniHuman?
Post by: kat on June 25, 2012, 04:04:56 PM
Thanks for posting but you may need to check with the author of UniHuman (http://unihuman.yolasite.com/faq.php) to see if you can distribute that file (even though it's just a static mesh version).