3ds Max 2017 - SMD Exporter

3ds Max 2017 - SMD Exporter

RadioRahim
Collaborator Collaborator
10,245 Views
41 Replies
Message 1 of 42

3ds Max 2017 - SMD Exporter

RadioRahim
Collaborator
Collaborator

Hi there. I am looking for a way to export to SMD file in 3dsMax 2017. It looks like there was a pluggin for this for 2010-2012 but not sure if that has been maintained.

Would that older pluggin work in 2017? If not, are there are other resources for exporting to SMD file for 3dsMax 2017?

Cheers

0 Likes
Accepted solutions (2)
10,246 Views
41 Replies
Replies (41)
Message 2 of 42

Alfred.DeFlaminis
Alumni
Alumni

Hello @RadioRahim,

 

There's no native support for this, but there are some 3rd party programs that can export out SMD.  I'd say the person who knows the most about this would be Shawn Olson a.k.a. @lightcube, he may have some ideas.   The guy is on a whole other level when it comes to this stuff...  Smiley LOL

 

Best Regards,

0 Likes
Message 3 of 42

lightcube
Advisor
Advisor
Accepted solution

The answer is this: Wall Worm. Updated just today, actually, to further support Max 2018.



Shawn Olson

Developer of Wall Worm

3ds Max 4/Gmax - 3ds Max 2027
Mudbox 2009-2022

Windows 11 x64
i9 11900K
128GB RAM
Geforce 3090
Message 4 of 42

Alfred.DeFlaminis
Alumni
Alumni

Hello @RadioRahim,

 

I just wanted to follow up here, any progress on this issue?

Best Regards,

0 Likes
Message 5 of 42

RadioRahim
Collaborator
Collaborator

Hey sorry to get back on this so late. I spoke with Shawn about his pluggin but it lacks the ability to preserve some bone assignments that are required for the game I am using. Is there any other workable tools out there that will not destroy bone assignments in SMD files?

0 Likes
Message 6 of 42

Alfred.DeFlaminis
Alumni
Alumni

Hello @RadioRahim,

 

There is no greater authority that I know of for this type of stuff than @lightcube.  Max doesn't have native SMD support so honestly I'm at a loss.  Most of the tools for SMD support stopped updating after 2012, it's really quite an impressive work of customer support and development that Wallworm is still rocking in the current year seeing how old HL2 is.  If it's not possible in Wallworm then I couldn't think of another plugin where it would work.  


Could you bake the vert animation or something a bit less elegant?  

 

Best Regards,

0 Likes
Message 7 of 42

RadioRahim
Collaborator
Collaborator

Hi thanks , yes while there is some great features that he is working on, the one thing I need isnt there which is bone support.In standard smd form, every vertex must have :

position, normal, texture, bone count, bone index and bone weight parameters.


His smd files that are exported lack bone parameters 

0 Likes
Message 8 of 42

lightcube
Advisor
Advisor

Please do not misrepresent the SMD Exporter in Wall Worm. It does have bone support as per the SMD specs. It works exactly as the SMD specifications dictate.

 

I am posting below a copy of the email response I sent to you about this:

 

As stated in previous emails, the SMD exporter in WW does account for all of the items on your list:
 
  • bone id
  • position
  • normal
  • texture
  • bone weight count*
  • bone weight index*
  • bone weights*
*When exporting as a staticprop, those parameters are ignored and thrown out. So if you need those parameters and they are being skipped, then make sure you are not exporting as a staticprop. Weight lists are used by WW when necessary--but not in staticprops or vertices weighted 100% to their parent bone.
 
Because the vertex information already includes the information for the bone assigned to a vertex, there is no need for any extra bone weight and bone id if the vertex is already weighted 100% to the same bone it belongs to--that information is already included in the line for the vertex:
 
For example, look at these lines from an SMD exported by wall worm:
 
Example Group 1: Weighted to Single (non-node bone)
 
0 -17.7423 4.6284 42.4492 0.261727 -0.838213 -0.478434 0 0 1 16 1
 
Because the vertex is not weighted to bone 0 (which is the blue ID at the beginning of the line) the bone count is 1 (green), the bone weighted to is 16 (red) and is fully weighted at 1 (orange).
 
Example Group 2: Weighted to Multiple (non-node bone)
 
0 8.45797 1.70189 42.1489 -0.738487 0.670565 0.0705682 0 0 2 10 0.0110556 11 0.988944
 
As you can see, Wall Worm SMD exporter accounts for those and uses weight lists.
 
However, it skips bone weights when there is only one bone weighted to the vertex and it is the same ID as the bone at beginning of the line. For example if the vertex from Example Group 1 above was fully weighted to bone id 0 and no other bone, it skips that data and would look like this:
 
0 -17.7423 4.6284 42.4492 0.261727 -0.838213 -0.478434 0 0
 
OR if in example 1 above was not attached to bone 0 and was instead attached to bone 16, then it would be this:
 
16 -17.7423 4.6284 42.4492 0.261727 -0.838213 -0.478434 0 0
 
Basically, any parser of the SMD using the actual SMD specs will know that a vertex without any weight list is 100% weighted to the bone at the beginning of the line. As mentioned previously, this is the actual SMD spec. Also, any parser of the SMD should be updated to recognize that the weight list is optional for the reason just outlined.
 
Notice that if I took the last two examples and added the weightlist, there is actually no information added that wasn't included in the last two lines above:
 
0 -17.7423 4.6284 42.4492 0.261727 -0.838213 -0.478434 0 0 1 0 1 (see that bone ID 0 is already listed at beginning of the line making the weight list redundant)
or
16-17.7423 4.6284 42.4492 0.261727 -0.838213 -0.478434 0 0 1 16 1 (see that bone ID 16 is already listed at beginning of the line making the weight list redundant)

The bottom line is that the weightlist is optional as per the SMD specifications. I really suggest that you point this out to the developer of the toolset you are using. Feel free to forward this explanation to them if they are not convinced. Also, link them to the actual SMD documentation at https://developer.valvesoftware.com/wiki/Studiomdl_Data which explicitly states: "The final three values are optional: they override <Parent bone> to define a series of weightmap links. Bone ID and Weight are repeated for each link. If the weights do not add up to 1, any remaining value is placed on <Parent bone>."
 
What you are asking me to do is to add extra and unnecessary data to each line. As noted, weight lists are used by WW when necessary--but not in staticprops or vertices weighted 100% to their parent bone. Increasing file size without adding any extra information that isn't already included is inefficient and exactly why the specifications make the weight list optional.
 
If your developer of your toolset cannot be convinced of this, I can add this option into WW for a fee .... If it was me, I'd convince the other developer to update his/her SMD parser to the SMD specification.


Shawn Olson

Developer of Wall Worm

3ds Max 4/Gmax - 3ds Max 2027
Mudbox 2009-2022

Windows 11 x64
i9 11900K
128GB RAM
Geforce 3090
Message 9 of 42

RadioRahim
Collaborator
Collaborator

thanks for the reply Shawn, im glad this information is out there now. Sadly, I'm not in a position to pay a fee for these features (i am on a disability and dont have money for this kind of thing right now).. , but I do hope they get into one of your updates if its possible.  

Thanks


0 Likes
Message 10 of 42

RadioRahim
Collaborator
Collaborator

Wait let me get this straight.. you said:

"*When exporting as a staticprop, those parameters are ignored and thrown out. So if you need those parameters and they are being skipped, then make sure you are not exporting as a staticprop. Weight lists are used by WW when necessary--but not in staticprops or vertices weighted 100% to their parent bone."

So is it then possible to export with all the features I need with your pluggins? 

0 Likes
Message 11 of 42

Alfred.DeFlaminis
Alumni
Alumni

Hey fellas,

 

As someone who doesn't fully understand the problem... is there something that @RadioRahim could do to make his problem go away?   Is it a matter of unnecessary data in the rig?  Weight tables?  

 

Petersroad, what are the features you need?  What engine or app is this going into?  I thought the format was purely for Half Life 2 but after some Googling it seems I was wrong.

 

Best Regards,

0 Likes
Message 12 of 42

RadioRahim
Collaborator
Collaborator

Thank you.. I am exporting these SMD models to Resident Evil 4 UHD. I'd love to see a solution here that isnt going to cost me money. 

0 Likes
Message 13 of 42

lightcube
Advisor
Advisor

Yes. Although I would still insist that the parser that you are using these with is updated to the actual specs and realizes that bone weights are optional (because the verts may already belong to a bone and need no weighting).

 

First, here are scenarios that will not have bone weights:

 

  • The staticprop setting is on
  • The verts are weighted 100% to their owning bone

The second example happens in scenarios where the mesh already belongs to a bone. For example, if you export a single geometry node (like a Box) or multiple nodes (like a bunch of boxes) and they are not weighted to anything but themselves. This is intentional--and is part of the SMD spec.

 

If you absolutely need the bone weights, even if it isn't adding more information (and isn't required by the spec) you can force this with this method:

 

  1. Make a skeleton of bones that represent the object's rig
  2. Skin the geometry to those bones with a skin modifier (making sure that all the vertices are fully weighted to one or more bones other than the node itself)

I want to reiterate that it would save you time and energy if the target platform adopts to the spec--because in the case of characters/rigs that are not using Skin modifiers (perhaps you have mechanical rigs?) then this is adding a bunch of tedious labor. In reality, the target parser could save you tons of time and effort by simply adding a single line of code. (I understand that it might seem like I could do the same--but the change you are asking adds file size bloat for the thousands of people who are using it in environments that fully read the SMD spec; and making it an optional switch adds unnecessary complexity to the application that I would have to support by answering questions, etc.)



Shawn Olson

Developer of Wall Worm

3ds Max 4/Gmax - 3ds Max 2027
Mudbox 2009-2022

Windows 11 x64
i9 11900K
128GB RAM
Geforce 3090
Message 14 of 42

RadioRahim
Collaborator
Collaborator

Thanks again Shawn for your in depth reply. You mentioned that the verts need to be weighted 100% to their owning bone

 but many of these verts are weighed to several bones at once, having a certain percentage of their weight to several bones, so I dont think that is going to work. 

0 Likes
Message 15 of 42

lightcube
Advisor
Advisor

One final thing to point out is this:

 

If you are using the Standalone SMD Exporter, there is a list of meshes and bone nodes. By default it has a setting to Auto, which will export objects based on this scenario:

 

  • If any objects are selected, just those objects (and their bones if they are skinned objects)
  • If no objects are selected, all geometry in the scene

Both options honor the checkbox for Only Visible Objects.

 

The preferred method should be the Wall Worm Model Tools floater, however (Wall Worm > Wall Worm Model Tools > Wall Worm Model Tools). This allows you to export the model, rig and all animations in one single pass. Since you would not be using the compiler, you could still use it but just click the Write SMDs button. All the models and sequences will output all at once. Take note it has a $staticprop checkbox--so turn that off for your models needing to keep the skeleton and weighting.



Shawn Olson

Developer of Wall Worm

3ds Max 4/Gmax - 3ds Max 2027
Mudbox 2009-2022

Windows 11 x64
i9 11900K
128GB RAM
Geforce 3090
Message 16 of 42

RadioRahim
Collaborator
Collaborator

ok i will try this and get back to you on this to see if ti works. THanks

Message 17 of 42

Alfred.DeFlaminis
Alumni
Alumni

Thanks for taking time out to communicate about this @lightcube.    I'm excited to see if this helps you @RadioRahim

 

Best Regards,

0 Likes
Message 18 of 42

lightcube
Advisor
Advisor

I do not think you read the comment completely:

 

"Skin the geometry to those bones with a skin modifier (making sure that all the vertices are fully weighted to one or more bones other than the node itself)"

 

It works exactly as you'd expect. The weights for all the bones that are skinned to a vertex will be added to a weight list in the SMD. So if vertex 4 is weighted to bone1, bone2 and bone3, it will get those weights. I was saying that to get what you need for the output you are looking for--add a skin modifier and skin the model. It will work.



Shawn Olson

Developer of Wall Worm

3ds Max 4/Gmax - 3ds Max 2027
Mudbox 2009-2022

Windows 11 x64
i9 11900K
128GB RAM
Geforce 3090
0 Likes
Message 19 of 42

Alfred.DeFlaminis
Alumni
Alumni

Just for my own personal understanding, is there a maximum number of bones that can be affecting verts in the SMD format?  3? 

 

Best Regards,

0 Likes
Message 20 of 42

lightcube
Advisor
Advisor

For Source it's 3. For Goldsource it was 1. There may be other limits in special mods. WW won't truncate that for the user--so it's up to the user to limit the weighting to 3 (or the limit imposed by their game).



Shawn Olson

Developer of Wall Worm

3ds Max 4/Gmax - 3ds Max 2027
Mudbox 2009-2022

Windows 11 x64
i9 11900K
128GB RAM
Geforce 3090
0 Likes