Jump to content


Photo

How to mod the universal head


  • Please log in to reply
44 replies to this topic

#1 Ben_S

Ben_S

    Master Director

  • Mods
  • 4811 posts

Posted 10 September 2010 - 01:49 PM

New in 1.4.1 is the ability to create extras for an existing bodypart, in a seperate addon.

For example, you might want to add decals to the universal head - more scars, facepaint, eyebrows, beards, bullet holes, etc.

While not integrated with the modders workshop, this is relatively simple modding process.

Starting with a making a new addon folder, it needs some other folders created folders:
I'm making a red cross to go on a guys face, so I created these folders:
(red cross 1.jpg)

In the Male01 folder i had created, I made a new file called "Universal Head.bodypart" (note - I made it as a txt file, and changed the extension to .bodypart)
It's contents are as follows:

CODE
<mscope.things.BodyPart_-MorphPart>
  <partsCovered class="enum-set" enum-type="mscope.things.BodyPart$Category">HEAD</partsCovered>
  <name>Universal Head</name>
  <decals>
    <material>
      <name>Red Cross 1</name>
      <diffuseColor>1.0 1.0 1.0 1.0</diffuseColor>
      <shininess>1.0</shininess>
      <maps>
        <entry>
          <string>diffuseMap</string>
          <string>Heads/RedCross/RedCross.png</string>
        </entry>
      </maps>
      <flags>
        <string>TINTABLE</string><string>ADJUSTABLE</string>
      </flags>
      <parameters>
        <entry>
          <string>group</string>
          <string>Makeup</string>
        </entry>
      </parameters>
    </material>
  </decals>
</mscope.things.BodyPart_-MorphPart>


The interesting bit is between the <decals></decals> section - you can have multiple decals, each within it's own <material></material> tags.

I also made an image, a red cross on a transparent background, as a .png (you can also use .dds files). I put this in my Heads/RedCross folder, and then put the relative path from the .bodypart to the image, in the entry for the diffuse map.

I set the name, in the material, to something of my choice 'Red Cross 1', and I created a .jpg thumbnail with that name, and the .jpg extension, and put that in the Heads/thumbs folder.

I also set which decal group my new decal should appear in.

I then went to the modders workshop, and published my new addon, and then tried it out.

Attached Files


Ben Sanders
Moviestorm Ltd

#2 luxaeternam

luxaeternam

    Master Director

  • Pioneers
  • 1053 posts

Posted 10 September 2010 - 02:00 PM

Thank you Ben.

I think you've just made a lot of people very happy!

smile.gif
"Les miroirs feraient bien de réfléchir un peu plus avant de renvoyer les images" : Jean Cocteau

#3 kv

kv

    Master Director

  • Pioneers
  • 1941 posts

Posted 10 September 2010 - 02:15 PM

Thanks for this I will be having a go at it later biggrin.gif

#4 Poulet Noir

Poulet Noir

    Master Director

  • Pioneers
  • 1134 posts

Posted 10 September 2010 - 02:46 PM

Wow, that's groovier than a 78 rpm gram-o-phoneTM acetate disk!

Thanking you Moviestorm Tecchie Bods kindly,

PN
"Come back Black Chicken! Leave us an egg or something..." Love at First Bite


Hosting for the Urban Decay Pack thanks to Ichikaiden ... Bat avatar used by kind permission of Jon Huckeby. Check out his blog!

#5 Nahton

Nahton

    Master Director

  • Pioneers
  • 925 posts

Posted 10 September 2010 - 02:48 PM

This may be a noob question but what if you wanted to have the decal not span across the face and be located in a specific part of the face. Let's say for instance a scar on the cheek. Is this the diffuse map path. I actually didn't start to look into any type of costume or character modding until last night so I know I need to get up to speed. What you are describing seems like a code/text base modding process vs lining up the decal on an actual graphic file.

{Ok, the first line of this post should read "This is a noob question")

#6 Chris Ollis

Chris Ollis

    Master Director

  • Pioneers
  • 1631 posts

Posted 10 September 2010 - 03:11 PM

QUOTE (Nahton @ Sep 10 2010, 02:48 PM) <{POST_SNAPBACK}>
This may be a noob question but what if you wanted to have the decal not span across the face and be located in a specific part of the face. Let's say for instance a scar on the cheek. Is this the diffuse map path. I actually didn't start to look into any type of costume or character modding until last night so I know I need to get up to speed. What you are describing seems like a code/text base modding process vs lining up the decal on an actual graphic file.


The decals work with the geometry's mapping coordinates. So a scar on a cheek would need to be positioned in the same area as the cheek on the underlying skin texture.
You would also want to create the normal and specular maps in the same place.
But decals can be moved around the face with the nudge controls, so exact positioning is not nearly as important as with other textures.

Before you rush in to a lot of scarring though, I was hoping to surprise people, but Ben's jumped the gun a little, let the cat out of the bottle and the genie out of the bag. There will be a new blood and wounds decal pack coming soon, so you may want to save yourselves some time there and focus on other areas.
Chris Ollis
Caretaker of www.moddingstorm.co.uk, the one stop shop for all your extra addon needs
Plus Minor Web Celebrity, Viral Guru, Advertising storyboarder, Toy designer, BBC and Channel4 comedy writer/animator :D

#7 kv

kv

    Master Director

  • Pioneers
  • 1941 posts

Posted 10 September 2010 - 03:52 PM

Does that mean I am doing this:

For nothing? LOL

Anyway I made the snapshot because I have a question, how do I edit the file to include normalmap and diffussion etc, I want to use it for this as just the image is too flat.

Also can you be a little clearer on how to have several decals in the mod please, I broke it when I tried.

#8 Ben_S

Ben_S

    Master Director

  • Mods
  • 4811 posts

Posted 10 September 2010 - 04:24 PM

Ok, extending the example to have Normal Map and Specular Maps, and include two decals:
CODE
<mscope.things.BodyPart_-MorphPart>
  <partsCovered class="enum-set" enum-type="mscope.things.BodyPart$Category">HEAD</partsCovered>
  <name>Universal Head</name>
  <decals>
    <material>
      <name>Red Cross 1</name>
      <diffuseColor>1.0 1.0 1.0 1.0</diffuseColor>
      <shininess>1.0</shininess>
      <maps>
        <entry>
          <string>diffuseMap</string>
          <string>Heads/RedCross/RedCross.png</string>
        </entry>
        <entry>
          <string>normalMap</string>
          <string>Heads/RedCross/RedCross_Norm.png</string>
        </entry>
        <entry>
          <string>specularMap</string>
          <string>Heads/RedCross/RedCross_Spec.png</string>
        </entry>
      </maps>
      <flags>
        <string>TINTABLE</string><string>ADJUSTABLE</string>
      </flags>
      <parameters>
        <entry>
          <string>group</string>
          <string>Makeup</string>
        </entry>
      </parameters>
    </material>
    <material>
      <name>Red Cross 2</name>
      <diffuseColor>1.0 1.0 1.0 1.0</diffuseColor>
      <shininess>1.0</shininess>
      <maps>
        <entry>
          <string>diffuseMap</string>
          <string>Heads/RedCross/RedCross2.png</string>
        </entry>
        <entry>
          <string>normalMap</string>
          <string>Heads/RedCross/RedCross_Norm2.png</string>
        </entry>
        <entry>
          <string>specularMap</string>
          <string>Heads/RedCross/RedCross_Spec2.png</string>
        </entry>
      </maps>
      <flags>
        <string>TINTABLE</string><string>ADJUSTABLE</string>
      </flags>
      <parameters>
        <entry>
          <string>group</string>
          <string>Makeup</string>
        </entry>
      </parameters>
    </material>
  </decals>
</mscope.things.BodyPart_-MorphPart>

Ben Sanders
Moviestorm Ltd

#9 Chris Ollis

Chris Ollis

    Master Director

  • Pioneers
  • 1631 posts

Posted 10 September 2010 - 04:26 PM

QUOTE (kv @ Sep 10 2010, 03:52 PM) <{POST_SNAPBACK}>
Does that mean I am doing this:
For nothing? LOL


Either you are or I have been for the past couple of weeks.
Chris Ollis
Caretaker of www.moddingstorm.co.uk, the one stop shop for all your extra addon needs
Plus Minor Web Celebrity, Viral Guru, Advertising storyboarder, Toy designer, BBC and Channel4 comedy writer/animator :D

#10 Nahton

Nahton

    Master Director

  • Pioneers
  • 925 posts

Posted 10 September 2010 - 04:44 PM

QUOTE (Chris Ollis @ Sep 10 2010, 11:26 AM) <{POST_SNAPBACK}>
Either you are or I have been for the past couple of weeks.

Nothing is for nothing! rolleyes.gif

Whatever you do, don't both stop at the same time!

#11 kv

kv

    Master Director

  • Pioneers
  • 1941 posts

Posted 10 September 2010 - 05:11 PM

QUOTE (Nahton @ Sep 10 2010, 04:44 PM) <{POST_SNAPBACK}>
Nothing is for nothing! rolleyes.gif

Whatever you do, don't both stop at the same time!


Yeah I was just joking about it as Chris said:
QUOTE (Chris Ollis)
Before you rush in to a lot of scarring though, I was hoping to surprise people, but Ben's jumped the gun a little, let the cat out of the bottle and the genie out of the bag. There will be a new blood and wounds decal pack coming soon, so you may want to save yourselves some time there and focus on other areas.


I thought doh.....I already started work on some lol

No matter, Chris will come up with some great looks, likely better than mine but a few more wont hurt laugh.gif

Many thanks for that Ben, thats very useful information biggrin.gif

#12 luxaeternam

luxaeternam

    Master Director

  • Pioneers
  • 1053 posts

Posted 10 September 2010 - 05:15 PM

QUOTE (Chris Ollis @ Sep 10 2010, 04:11 PM) <{POST_SNAPBACK}>
[...] There will be a new blood and wounds decal pack coming soon, so you may want to save yourselves some time there and focus on other areas.


You don't mean snot do you? wink.gif
Mind you, Halloween is coming up, and I'm thinking bogeyman and ectoplasm...

"Les miroirs feraient bien de réfléchir un peu plus avant de renvoyer les images" : Jean Cocteau

#13 kv

kv

    Master Director

  • Pioneers
  • 1941 posts

Posted 10 September 2010 - 05:29 PM

Hmmm I`m a little confused, I have applied a bump map to the scar and published, the thing is it seems the bump is being placed in the wrong place even though the bump was created using my wound diffuse so it`s in exactly the same position in the texture, also it does not look to be bumping correctly as according to the bump texture:



Any ideas what could have gone wrong?

#14 Armanus

Armanus

    Master Director

  • Pioneers
  • 1532 posts

Posted 10 September 2010 - 08:42 PM

Talk about possibilities! Thanks for sharing this! KV, I'm guessing Chris might not be doing anything quite that extreme, but maybe you might want to wait and see what he offers anyway smile.gif

Any possibility we can have a tutorial about creating custom hair in the near future? So many possibilities!



#15 luxaeternam

luxaeternam

    Master Director

  • Pioneers
  • 1053 posts

Posted 11 September 2010 - 06:02 AM

QUOTE (kv @ Sep 10 2010, 06:29 PM) <{POST_SNAPBACK}>
Hmmm I`m a little confused, I have applied a bump map to the scar and published, the thing is it seems the bump is being placed in the wrong place even though the bump was created using my wound diffuse so it`s in exactly the same position in the texture, also it does not look to be bumping correctly as according to the bump texture:



Any ideas what could have gone wrong?


For some odd reason, normal maps get imported the wrong way round. After a few experiments I figured that the way to fix it was with a horizontal flip and then rotation through 180°. that seemed to do the trick for me.

Hope that helps

smile.gif
"Les miroirs feraient bien de réfléchir un peu plus avant de renvoyer les images" : Jean Cocteau

#16 kv

kv

    Master Director

  • Pioneers
  • 1941 posts

Posted 11 September 2010 - 08:12 AM

QUOTE (luxaeternam @ Sep 11 2010, 06:02 AM) <{POST_SNAPBACK}>
For some odd reason, normal maps get imported the wrong way round. After a few experiments I figured that the way to fix it was with a horizontal flip and then rotation through 180°. that seemed to do the trick for me.

Hope that helps

smile.gif


Thanks for the tip but oddly that has not fixed it, the bump is still showing in the same place and same orientation, and it`s still not bumping correctly blink.gif

#17 kv

kv

    Master Director

  • Pioneers
  • 1941 posts

Posted 11 September 2010 - 08:41 AM

Update, after completely replacing the .bodypart file with a fresh one and editing it again, I have republished and had some success. Now nothing is showing out of place, my only gripe is I can`t tell if the bump is actually working properly still because it still does not look right to me as the bump shows more texture than what I am seeing in the result here. Shader map pro (where I made the bump and spec files) shows them looking much better than this result unsure.gif



I just do not know what more I can do and why the Norm config just does not seem to be bumping the way it should sad.gif

#18 Ben_S

Ben_S

    Master Director

  • Mods
  • 4811 posts

Posted 12 September 2010 - 12:27 PM

The normal maps for decals are quite complex, I think. As I recall, the dds textures we used for most of the decal normal maps have a transparency mask that means that it doesnt overwrite the normal map for the whole face. I would strongly recomend looking at the textures in Base01 that are used for decals, to see what formats they are in.
Ben Sanders
Moviestorm Ltd

#19 D.L. Watson

D.L. Watson

    Master Director

  • Pioneers
  • 559 posts

Posted 30 January 2011 - 12:29 AM

Great Info Ben! Thanks alot!

#20 rgr

rgr

    Master Director

  • Pioneers
  • 425 posts

Posted 30 January 2011 - 03:40 AM

QUOTE (Chris Ollis @ Sep 10 2010, 03:11 PM) <{POST_SNAPBACK}>
The decals work with the geometry's mapping coordinates. So a scar on a cheek would need to be positioned in the same area as the cheek on the underlying skin texture.
You would also want to create the normal and specular maps in the same place.
But decals can be moved around the face with the nudge controls, so exact positioning is not nearly as important as with other textures.

Before you rush in to a lot of scarring though, I was hoping to surprise people, but Ben's jumped the gun a little, let the cat out of the bottle and the genie out of the bag. There will be a new blood and wounds decal pack coming soon, so you may want to save yourselves some time there and focus on other areas.


Ah, cool. Any idea if this will allow us to put wounds on body parts as well? I have a script where a guy gets shot in the leg (or back side smile.gif ) and would like to show a wound there instead of keeping the camera away.

Cheers,

rgr


  • Please log in to reply


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users