3DS Max Import/Export plugin

Discussion in 'Models, Animations, and Particle Effects' started by Leksey, Sep 16, 2006.

Remove all ads!
  1. Cuchulainn

    Cuchulainn Windmill Tilter

    Joined:
    Jan 16, 2006
    Messages:
    611
    Likes Received:
    0
    Cool!! :thumbsup:

    Yeah, no animations just multiple bones. The Bone Helm and the Short Sword are 2 I remember for sure if you want'd to see what I mean.

    Thanks again,

    Cuchulainn.
     
  2. Cujo

    Cujo Mad Hatter Veteran

    Joined:
    Apr 4, 2005
    Messages:
    3,636
    Likes Received:
    1
    I'm currious - would it be posable to make a japanese style bow - take a normal bow and strech the top half longer by 1/3 aprox?
     
  3. Leksey

    Leksey Member

    Joined:
    Mar 28, 2006
    Messages:
    51
    Likes Received:
    0
    It seems bow contains animations... May be when I will add support of multiple bones and some work in HEX. This can be done.
     
  4. Cujo

    Cujo Mad Hatter Veteran

    Joined:
    Apr 4, 2005
    Messages:
    3,636
    Likes Received:
    1
    thanks for that, I thought it might but wasn't sure.
     
  5. Leksey

    Leksey Member

    Joined:
    Mar 28, 2006
    Messages:
    51
    Likes Received:
    0
    Some fixes made to plugin:
    Added option "Apply node transform" in export options dialog.(by default is checked)

    @Cuchulainn : This will solve problems with models scale and rotation of model.
     
  6. Cuchulainn

    Cuchulainn Windmill Tilter

    Joined:
    Jan 16, 2006
    Messages:
    611
    Likes Received:
    0
    Tested it out, works perfect.

    Rotation, scale, and relative position all export. :yes:

    Thanks Again!!

    Cuchulainn.
     
  7. Cuchulainn

    Cuchulainn Windmill Tilter

    Joined:
    Jan 16, 2006
    Messages:
    611
    Likes Received:
    0
    Hey Leksey,

    I have some more details on the texture issues. The Ambient value is always showing up in-game as black. I've had off and on problems with various parts of my models showing up as black, and had assumed that the black portion was un-textured. With my latest model 3/4 of it is black in-game. I accidently loaded the Tutorial last night which is set inside with torches as lighting, and the entire model looked perfect, albeit with a slightly orange hue from the torches. When I loaded an outside scene though the model went back to being mostly black. Once I figured out my issue was ambient light I tried a few things none of which has worked so far.

    I added lights to the scene.

    I unlocked the Ambient value in the material editor and tried setting it to a much lighter grey. I also tried loading the same bitmap as Difuse.

    I turned on Self Illuminate both with a colour and with just a value of 100.

    If there is any more info I can provide, or something else I should try, just let me know.

    Cuchulainn.
     
  8. Leksey

    Leksey Member

    Joined:
    Mar 28, 2006
    Messages:
    51
    Likes Received:
    0
    In SKM file format there is no places for ambient or diffuse colors.... For now as I said plugin doesn't support materials export. So may be ambient color can be set manually in ".mdf" file (it is human-readable text file), i am not sure. I viewed a lot of .mdf files and it seems their support a lot of keywords, not only "Textured".For example "Color" can be ...but i am not sure what this color field mean. So If you will play with ToEE .mdf files you can figure out something...
     
  9. Cuchulainn

    Cuchulainn Windmill Tilter

    Joined:
    Jan 16, 2006
    Messages:
    611
    Likes Received:
    0
    OK, I'll play around and see what I can figure out.

    Cuchulainn.
     
  10. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    OK, I sent all the information I know to Leksey so he can go on working with animations. He told me he'll try to dig things further this weekend.

    @ Leksey: I was digging some more data on the keyframes, and here's what I found out:

    First of all, the first two 32-bit floats that come before the keyframes are the maximum scale and maximum offset, both divided by 32767, so it's like this:

    float max_scale/32767;
    float max_offset/32767;

    After this, we have our first block of data which is related to bones, and its format is like this, I suppose:

    16bit base bone ID
    16bit scale X
    16bit scale Y
    16bit scale Z
    16bit orient X
    16bit orient Y
    16bit orient Z
    16bit orient fourth component
    16bit offset X
    16bit offset Y
    16bit offset Z

    After the bones block is over, we have a 16-bit "-2" signalling that it's the end of the bones block.

    Now, we have the keyframes block, which is as I told you, except the fact that I might have messed up with the size of the data inside. Let me know if you were able to find something out.

    It *seems* like one keyframe might have multiple sets of scale/orient/offset specified under certain circumstances, but I'm not sure if this ever happens in original game files and I'm also not sure how you can guess whether it does have multiple sets or not. For now, ignore this comment unless you come to a file which has large block of data after the frame number (larger than the one normally there).

    Also, in the beginning of each keyframe header, there's a 16bit frame number followed by 16bit value which seems to store *both* the base bone ID AND the keyframe flags, in the format:

    (base_bone_ID << 4) | (keyframe_flags << 1) | 1

    So basically, if you have base_bone_ID equal to 10 and keyframe_flags equal to 3, the value you're getting from the file is ((10<<4) | (3 << 1) | 1), which equals a 16-bit 167.

    I don't know why exactly it's done in this way, but this is the way I assume you should read that value. Try it out if nothing else works.

    Hope this helps.
    - Agetian
     
    Last edited: Oct 12, 2006
  11. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    OK, so, a clarification here. The formula I wrote above, which is:
    (base_bone_ID << 4) | (keyframe_flags << 1) | 1

    Stores a single 16-bit value in the form:

    CCCCCCCCCCCCBBBA

    Where:
    C = bits for bone index (values 0-4095)
    B = bits for keyframe flags (values 0-7)
    A = bit 0 which is always 1 as long as the frame is used.

    - Agetian
     
  12. Cuchulainn

    Cuchulainn Windmill Tilter

    Joined:
    Jan 16, 2006
    Messages:
    611
    Likes Received:
    0
    Nice to see this still progressing (rubs hands gleefully). I'll certainly be happy to help with testing when (not if) it gets that far.

    @Agetian: Very cool your finding the time for this, with this being your insanely busy time and all.

    @Leksey: Very much looking forward to animations!! No great surprise but aparently the problems I was having with the skm plugin, were just user error. I have a theory what I did wrong, once I confirm it I'll post details for anyone else that has the problem.

    Cuchulainn.

    Edit-- Never did figure out what caused this problem but it hasn't happened again with any other models.
     
    Last edited: Oct 18, 2006
  13. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    Yeah, I've just changed my priorities for a while. Unfortunately, since I'm that busy right now, I can't do a lot of things at the same time (e.g. ToEEWB and file format specs), so I decided to switch over to finding things about the SKM and SKA file formats so that Leksey can write a full-blown plugin (while he's still at it, that is ;))

    - Agetian
     
  14. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    Ummm does this mean someone can make me a horse? (U know what I mean...) Lamia body + modded leucrotta head perhaps?

    Or a decent cat model? Cat models are desperately needed, from simple alley toms and familiars to upsized panthers, jaguars etc. Add some tentacle and wa-la, displacer beasts. :)

    Btw, I do believe we just shattered the final frontier of ToEE modding :) I should go on honeymoon more often ;)
     
  15. Leksey

    Leksey Member

    Joined:
    Mar 28, 2006
    Messages:
    51
    Likes Received:
    0
    @Shiningted :
    We can' make a horse or a cat :( .
    Now we can add just simple one bone models without animation. I am working on that, but have not many free time to do it ( work, study and I caught a chill :( )

    But for now I think I have enough info on how to create difficult models with animations.. so will try to complete this plugin...
     
Our Host!