1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Skeletal mesh/multiple materials (UT/3ds max 6)

Discussion in 'Modeling & Skinning' started by MrBond, Jan 29, 2005.

  1. MrBond

    MrBond ZHP Founder

    Joined:
    Sep 23, 2003
    Messages:
    452
    Likes Received:
    0
    I've got a few weapons I want to use multiple materials on using 3ds max 6. I've got everything set up, all the materials show up in the right place.

    The problem comes when I try to import into UnrealEd. Even though I've exported (through ActorX) the skeletal mesh and animation file with two materials, only the first one covers the whole mesh.

    I have tried vertex instead of skeletal export (and the multiple materials work fine), but it is much too slow, and the mesh has some....oddities.

    My question is this: How do I get multiple materials to import correctly into UnrealEd?

    I tried using just a simple test object (code outlined below), but only the first material is used again. I have heard about using multi subobject textures (which is what I use anyways), but it seems that UnrealEd isn't recognizing the second material along with the skeletal mesh. Or maybe I have the code wrong, I don't know.

    Code:
    //******************************************************************************
    // TO_TestObject -- Tests multiple materials with skeletal meshs
    // Created by mrbond113
    //******************************************************************************
    
    class TO_TestObject extends Decoration;
    
    #exec MESH  MODELIMPORT MESH=TO_TestObjectMesh MODELFILE=models\TestObject_Mesh.PSK LODSTYLE=10
    #exec MESH  ORIGIN MESH=TO_TestObjectMesh X=0 Y=0 Z=0 YAW=0 PITCH=0 ROLL=0
    #exec ANIM  IMPORT ANIM=TO_TestObjectAnims ANIMFILE=models\TestObject_Mesh.PSA COMPRESS=1 MAXKEYS=999999
    #exec MESHMAP   SCALE MESHMAP=TO_TestObjectMesh X=1.0 Y=1.0 Z=1.0
    #exec MESH  DEFAULTANIM MESH=TO_TestObjectMesh ANIM=TO_TestObjectAnims
    
    #EXEC ANIM  SEQUENCE ANIM=TO_TestObjectAnims SEQ=Still STARTFRAME=0 NUMFRAMES=1 RATE=30.0000 COMPRESS=1.00 GROUP=None
    #EXEC ANIM  SEQUENCE ANIM=TO_TestObjectAnims SEQ=Move STARTFRAME=1 NUMFRAMES=10 RATE=30.0000 COMPRESS=1.00 GROUP=None
    #exec ANIM DIGEST ANIM=TO_TestObjectAnims  VERBOSE
    
    #EXEC TEXTURE IMPORT NAME=TO_TestObjectTex0  FILE=MODELS\mat00_map.pcx  GROUP=Skins
    #EXEC TEXTURE IMPORT NAME=TO_TestObjectTex1  FILE=MODELS\mat01_map.pcx  GROUP=Skins
    #EXEC MESHMAP SETTEXTURE MESHMAP=TO_TestObjectMesh NUM=0 TEXTURE=TO_TestObjectTex0
    #EXEC MESHMAP SETTEXTURE MESHMAP=TO_TestObjectMesh NUM=1 TEXTURE=TO_TestObjectTex1
    
    defaultproperties
    {
        DrawType=DT_Mesh
        Mesh=SkeletalMesh'Test.TO_TestObject.TO_TestObjectMesh'
    }
    
    Advice/insights greatly appreciated!
     
  2. mainframe

    mainframe New Member

    Joined:
    Aug 20, 2004
    Messages:
    5
    Likes Received:
    0
    go to www.3dbuzz.com register search for video tutorials then d/l the weapon creation tutorial, that should help u out alot :)
     
  3. MrBond

    MrBond ZHP Founder

    Joined:
    Sep 23, 2003
    Messages:
    452
    Likes Received:
    0
    Already have, that's where I learned all this stuff. :)

    But they don't cover multiple materials along with ActorX in detail.

    (Assuming, of course, you're talking about the UT vids? Didn't look at 2k3/2k4 vids, as the engines are too different to have much in common any more.)
     
  4. Eyegore

    Eyegore =================

    Joined:
    Sep 4, 2001
    Messages:
    293
    Likes Received:
    0
    I think you should avoid using the script templates generated in the UT style and simply do all your material assignment in the editor.

    Here is a script for a dangly chain skeletal anim I made for a map. At first I tried to do it the way you have it, but this works much better.

    For Example:

    Code:
    //=============================================================================
    // my dangly chain
    //=============================================================================
    
    class danglychain extends Decoration;
    
    simulated function PostBeginPlay()
    {
        LoopAnim('dangle');
        Super.PostBeginPlay();
    }
    
    defaultproperties
    {
         Mesh=SkeletalMesh'DN_Dangly.danglychain'
         bStatic=False
         bStasis=False
         Physics=PHYS_None
         DrawScale=1.000000
         bNetNotify=True
    }
    
    Then in UEd, you import your skeletal mesh and assign the materials in there. Save the mesh package and then it's simply a matter of assigning the skeletal mesh in the default properties.

    If you still have issues, let me know and I'll show you how I got it to work, step-by-step.
     
    Last edited: Feb 7, 2005
  5. MrBond

    MrBond ZHP Founder

    Joined:
    Sep 23, 2003
    Messages:
    452
    Likes Received:
    0
    I see what you're saying. The only thing I am confused about is how to import the skeletal mesh into UEd (just to make sure...we're both talking about UEd 2.0?).
     
  6. Eyegore

    Eyegore =================

    Joined:
    Sep 4, 2001
    Messages:
    293
    Likes Received:
    0
    I'm sorry dude - I wasn't clear that you were talking about Ued2. I was talking about Ued3.

    One thought though - but nothing to do with ActorX...
    I have experienced in the past when exporting material info with several materials, a bug or glitch with the exporter. I have no examples right now, but here - I've inserted some of the exort code to illustrate:

    Code:
    *MATERIAL_COUNT 1
    	*MATERIAL 0 {
    		*MATERIAL_NAME "Material #52"
    		*MATERIAL_CLASS "Multi/Sub-Object"
                    ... //more info here, then you get to:
              *NUMSUBMTLS 2
    		*SUBMATERIAL   {                  <= here is the trouble
                                                                                  
    			*MATERIAL_NAME "Material #39"
                     *SUBMATERIAL 1 {                 <= this is correct
    			*MATERIAL_NAME "Material #40"
    
    The issue I've encountered would be that the submats end up with the same identification number, so when you look at it in Max, it looks good, but when you apply the material in Ued, it is wrong because it show you that there are 2 mats being used, but the same material is used for both, not the correct ones.

    I don't know if this is the problem, it took me forever to figure out. I found this error would occur if I didn't apply the materials in to correct order after assigning UVs. I never really traced the root cause of the issue, but I was able to fix the file simply be giving the SUBMATERIALs the correct numbers.

    Let me know if this helps - it may actually have nothing to do with your issue...
     
    Last edited: Feb 9, 2005
  7. MrBond

    MrBond ZHP Founder

    Joined:
    Sep 23, 2003
    Messages:
    452
    Likes Received:
    0
    Where is that code from? It looks like it might be the answer...
     
  8. Eyegore

    Eyegore =================

    Joined:
    Sep 4, 2001
    Messages:
    293
    Likes Received:
    0
    That's actually what an .ASE contains when opening it with a text editor. So if you're using ActorX, it's probably not the problem... it really only seems to occur with static meshes. I though perhaps that if you were using 3ds2unr, that might be the problem, but when I looked at a .3ds, it turns out to be a binary file as well.
     
  9. MrBond

    MrBond ZHP Founder

    Joined:
    Sep 23, 2003
    Messages:
    452
    Likes Received:
    0
    ...ASE?

    Nah, can't use that. ActorX exports the PSK and PSA files I need, and it's all gibberish when opened with a text editor....

    When I use 3ds2unr, I can get multiple materials, no problem. I want to use ActorX because it's a bunch faster than exporting each animation sequence individually. I've tried ActorX's vertex export, but there's some weird mesh distortions.

    Blast.
     
  10. Eyegore

    Eyegore =================

    Joined:
    Sep 4, 2001
    Messages:
    293
    Likes Received:
    0
    yeah -

    I'm doing some experiments to see if I can figure anything out.

    I've not had that problem with Ued 2, but I'll try to recreate it.

    I do realize that personal projects are at times...personal, but if ou wouldn't be averse to posting your max file, I can check to see if I get the same results on my machine...
     
  11. MrBond

    MrBond ZHP Founder

    Joined:
    Sep 23, 2003
    Messages:
    452
    Likes Received:
    0
    Not a problem. I'm not concerned about theft. ;)

    I've included two files, one with two separate materials, and one with a single material (just in case you need to make modifications to the base). I want the "slime" to have an animated WetTexture.
     

    Attached Files:

  12. Eyegore

    Eyegore =================

    Joined:
    Sep 4, 2001
    Messages:
    293
    Likes Received:
    0
    ok-

    I'll check it out and let you know how it goes.
     
  13. Eyegore

    Eyegore =================

    Joined:
    Sep 4, 2001
    Messages:
    293
    Likes Received:
    0
    OK - i got the exact same issue you got -

    Attempting to troubleshoot...
     
  14. Eyegore

    Eyegore =================

    Joined:
    Sep 4, 2001
    Messages:
    293
    Likes Received:
    0
    GOT IT!!! :)

    You need to name the materials in Max per the following:

    SKIN0
    SKIN1
    etc...

    that's how it'll differentiate between the materials

    Here's an in-editor screenshot as well as the .u files and .utx so you can see the awesome bad barrel knockover animation:)
     

    Attached Files:

  15. Eyegore

    Eyegore =================

    Joined:
    Sep 4, 2001
    Messages:
    293
    Likes Received:
    0
    BTW -

    I had success using the max file with the separated materials, didn't try the one with just one texture.

    Also, i used ut2004 textures and imported them into the editor - didn't bother with trying with the wet-texture.

    just name the materials in Max (at the parent level) to SKINx - I think you can only do up to 4 materials maximum in UT.
     
  16. MrBond

    MrBond ZHP Founder

    Joined:
    Sep 23, 2003
    Messages:
    452
    Likes Received:
    0
    DUDE! You are the MAN!

    ...although I shouldn't speak too soon. I'll try it now, then celebrate when (ahem....IF) it works...

    [EDIT]
    And work it does. Thanks a TON!
    I should also add that UT material identifiers can still be used (like TRANSPARENT, WEAPON, etc.), and they should be used at the BEGINNING of the material name (TRANSPARENTSKIN0, TRANSPARENTSKIN1, etc.).

    Thanks again!!
     
    Last edited: Feb 13, 2005
  17. Eyegore

    Eyegore =================

    Joined:
    Sep 4, 2001
    Messages:
    293
    Likes Received:
    0
    Not a prob - I took me a little while to shake the rust off having not used UT in almost 2 years!!

    Good point!

    Looking forward to seeing the finished weapons!!
     
  18. MrBond

    MrBond ZHP Founder

    Joined:
    Sep 23, 2003
    Messages:
    452
    Likes Received:
    0
  19. Eyegore

    Eyegore =================

    Joined:
    Sep 4, 2001
    Messages:
    293
    Likes Received:
    0
    Looks cool - will be looking forward to following the progress!
     

Share This Page