smd import

Started by Scrotty, March 25, 2016, 10:43:11 PM

Previous topic - Next topic

Scrotty

1: When importing with a skin there are multiple vertices.


*This doesn't happen when you select the option to remove bones.*

There was also another thing...a .smd animation export issue but I'm not sure if it was just caused by me. I used CAT rigging on a head with 2 hands that moved up and down and exported it. Then I tested it by importing it into blender. The head was far above it's position in Max.

wallworm

The dead vertices were fixed in WW 2.763 update in January.

The position of a head being offset ... could be caused by many different things. Need a lot more info on the scene setup to give any useful tips.

Scrotty

#2
On the settings it says I'm using 2.777, again though, this is from importing with the bones and skin.

Retested the offset issue..it didn't happen this time but it did still turn out glitchy looking?

Max:


Blender (Imported via .smd):


As far as scene setup goes...mmm default? To me it kind of looks like it's duplicating the bones?

wallworm

OK, I'll look into the duplicate verts tomorrow.

In terms of the image, I can't really tell for sure what I'm looking at, but I'm assuming that you are talking about the little bone icons? I'm not a Blender user, so not 100%.

Each object exports as a separate SMD Node. So each mesh node in Max exports as a bone in the SMD. This is as intended. When studiomdle.exe processes the model, extra bones that are not used should be optimized out. If you are using a version of StudioMdl that doesn't do this, you may add the $collapsebones setting in the QC (you'll find this as a setting in WWMT).

Scrotty

Yes, in the blender image the little spheres are the bones and the lines are connected to the parent bone (The root or pink bone you see in the Max image). This is how they typically look when a .smd is imported. Including the root, there are a total of 4 bones in the animation. Head, L Hand, R Hand, Root. The 3 additional bones in the image shouldn't exist though I will test your suggestion. Thank you! :)

wallworm

Just to clarify: the $collapsebones setting is a QC setting for the compiler, not a setting internal to WW itself. That means that the SMD files will always have those extra bones because each object in Max is technically a bone. The SMD will have one bone node per Bone and per Geometry Object. It's the compilers that create a MDL that will remove the bones that are not actually used.

So if you simply import the SMD, you'll get the bones that represent each node (so each of the three spheres).

Scrotty

Ah, then I have no other ideas. Btw, I also just tried exporting then importing it back into max. If the "Animated Model (Hierarchy or Sequence)" isn't checked I get an error and the import buttons stop functioning.

MAXScript Rollout Handler Exception
--Unknown property: "parent" in undefined


Though this does work fine in importing the animation...the model doesn't.

wallworm

I'll need more information. I tried to replicate this and could not get an error with and SMD/QC imports I tried. Send me the SMD/QC file(s) you are trying to import.

In terms of the dead vertices. I revisited this and yes, it's still making them. I tried to think of the best logic to solve it, and it's actually more complex than it seems. And now I've made a global setting in the Models tab (look for a rollout at bottom named Model Importer). There is now a checkbox that is off by default. When off, the weld function does not run on models that are not staticprop. When on, it will weld skinned models but the dead verts art present.

Here is the thing that 99.9% of people do not understand about how SMD/VTA files store information. The SMD file does not store vertex indexes. There are only faces with unique vertices in the SMD/VTA data. It does not store whether the original file was using the same vertex on two adjacent faces. All you know for certain is what parameters are stored in the two. If the two have identical position, normal and bone weights, then you can assume the vertices were the same vertex... but it's not guaranteed to be correct. If dealing with just SMD files, this problem can be generally ignored. But the next problem is that VTA files ONLY store vertex position and normal (no weights). You cannot just weld these because you do not know how the flexes use them -- and trying to combine them breaks vertex ordering, etc.

I tried to get around this but ran into issues. So I'm not going to further address this issue unless it becomes necessary in my professional work.

The bottom line is this. There is no good programmatic way for me to decide how and what vertices to weld, especially when the importer wants to handle both SMD and VTA files. Maybe there was some magic in the other importers, but it's not known to me (and just because an across the board weld works for all cases anyone in particular tried, I know that it is prone to weld vertices that actually were not welded). The best solution is this: Do NOT weld vertices if you are importing animated/rigged/flexed models. After the model is imported, if you really want the vertices welded, add a Vertex Weld modifier on top of the modifier stack.

I know this is going to upset some people, especially those artists who have OCD. But it's such a non-issue to me that I don't think I can spend any more of my time looking into that issue specifically. If you are importing just to re-animate, the unwelded vertices have absolutely no bearing on the re-exported model. It's only if you want to modify the model (by changing the actual physical topology) that this will come to bear--and in that case you'll have to reskin anyway--so manually welding the vertices won't be an issue as you'll be collapsing the stack anyway. In that case, it's as simple as adding a single modifier or pressing a weld button in the modify stack.

SMF spam blocked by CleanTalk