Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Milkshape3D MS3D help needed

  1. #1

    Milkshape3D MS3D help needed

    Hi all,
    I hope anyone here who is familiar with the Milkshape3D MS3D file format can help me

    I am trying to create a Pascal MS3D exporter for a project I am working on, and I have a few questions about the structures involved with this format.

    I have gotten the specs for the Milkshape3d MS3D 3D file format from here:

    http://local.wasp.uwa.edu.au/~pbourk...s3d/ms3dspec.h

    Question 1

    Code:
    typedef struct {
      byte  flags;                   // SELECTED | SELECTED2 | HIDDEN
      float  vertex[3];                 //
      char  boneId;                   // -1 = no bone
      byte  referenceCount;
    } ms3d_vertex_t;
    What values do I use for the referenceCount in this structure?

    Prior to writing out the vertex to the file, I know what to put into the other three fields, but not this one.

    I figure I can use 0 for the flags, vertex is obvious, I can use -1 for boneId (till I decide to do animation support).

    I have looked at the source code of some MS3D readers but none of them seem to use this field at all...do I just put 0 for the referenceCount in vertex?

    Question 2

    Code:
    typedef struct {
      word  flags;                   // SELECTED | SELECTED2 | HIDDEN
      word  vertexIndices[3];              //
      float  vertexNormals[3][3];            //
      float  s[3];                    //
      float  t[3];                    //
      byte  smoothingGroup;               // 1 - 32
      byte  groupIndex;                 //
    } ms3d_triangle_t;
    Re: groupIndex field
    What values would I use for groupIndex in this structure?

    Does every triangle have to belong to a group?

    It seems that every triangle that uses a different material needs to belong to a different group, is this correct?

    I may have other questions later on, but thanks for your time
    cheers,
    Paul

  2. #2

    Re: Milkshape3D MS3D help needed

    If I may, did you look here?

  3. #3

    Re: Milkshape3D MS3D help needed

    Quote Originally Posted by Brainer
    If I may, did you look here?
    Yes, but unless I'm going blind (tm), I can't see it mentioned here either

    cheers,
    Paul

  4. #4

    Re: Milkshape3D MS3D help needed

    Ah, sorry. I thought you were looking for an importer. My bad there.

    It seems the things you asked for are not needed, in my opinion. They might be used by the original Milkshape program for something, they might not have any particular meaning to other programs. Just a speculation, tho'.

  5. #5

    Re: Milkshape3D MS3D help needed

    The things you are uncertain about are not mentioned in the milkshape ascii format. So i gues the only have purpose for the milkshape editor. Did you try filling them with zero's and see how the milkshape editor behaves when loading it. As brainer said when using the ms3d file you dont use those properties.

    My gues on referencecount is about on in how many faces an vertex is used.
    You may go for an group per material way. Alternative you may try to assemble a meaning like a leg or the head. Again i suggest you experiment with that. Again milkshape ascii only knows smoothing groups and does not use groups so they probeably are just convenient ways to quicky select some faces quickly.

    I only have finished an milkshape ascii mesh exporter. But have not yet gotten around to export the skeleton with bones and animations yet.
    http://3das.noeska.com - create adventure games without programming

  6. #6

    Re: Milkshape3D MS3D help needed

    As far as I can tell, triangles belong to groups and each group can have it's own material. This means that you need to have multiple groups if you want multiple materials, but you can use multiple groups that have the same material.

    My gues on referencecount is about on in how many faces an vertex is used.
    I second that. I don't see why you would have a refcount field inside a vertex struct for any other reaseon.

    It seems like a very vague part of the fileformat. I think your best shot is to just expiriment and try to make it work. You can always solidify the source if someone eventually comes up with some answers.




    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  7. #7

    Re: Milkshape3D MS3D help needed

    Thanks all for the replies

    If you are curious, I am making MS3D importer and exporter plugins for DeleD (www.delgine.com)

    The importer works on vertices, triangles, and UV coordinates...I still have to make it automatically install the texture into DeleD and use the texture in the model.

    Currently I have to manually set the texture to the model, but it works when I do this, so some yay.

    The exporter doesn't do much yet, except to show usual importer/exporter DeleD plugin GUI

    cheers,
    Paul

  8. #8

    Re: Milkshape3D MS3D help needed

    Cool.. The more importers/exporters the better.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  9. #9

    Re: Milkshape3D MS3D help needed

    Quote Originally Posted by chronozphere
    Cool.. The more importers/exporters the better.


    Oh, I forgot to mention...the ms3d importer and exporter is going to support joints if I can wangle things ok...

    cheers,
    Paul

  10. #10

    Re: Milkshape3D MS3D help needed

    Hi,

    I did a ms3d binary file format reader/writer long time ago.

    - Refcount should have to be 0, it is used internally by milkshape and it start with that value.
    - You need to have at least one group and assign your data to that group;
    - smoothgroup should have to be value 1.
    - Note that if you want to include MS3D_VertexEX data you have to put propely the subversion value.

    This is a copy of my ms3d reader/writer wich include bones and animations with weight vertex; but it discard comments data; I hope it can be usefull for someone.

    http://www.dxtre3d.com/temp/ms3dunit.pas

    Note that i dont have idea which is today current ms3d filformat version, but Mete was always carefull not to break backward compatibilty so this reader/writer should work with today ms3d files.

    good luck with the bones and animations part of your plugins, it is a realy headache to interpret correct that data if you have not experience with skelatal animations.


    Good luck
    Tp.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •