vertex transforms

how many model formats use these??

they basically take a model’s verts,
and reposition them to a certain point before being tranformed by the bones

here’s a few example images:

before transforms are applied: (vert alignment left alone)

after being applied: (set by object transforms)

ignore the bones…
that’s just a collada 141 import error
they work perfectly in 3DS so I’ve seen…

anyways… yea…
I need to know weather to add transforms to my conversion format (for support with other file types),
or just apply the transforms and log the transformed verts :confused:

again…
these transforms are different from the 4x3 transform matrix
the bones have nothing to do with this step

I’ll take the silence as a no…

srsly guys…
I’m on a freakin forum all about 3D modelling and such
and I can’t even get info on other formats that use mesh transforms >:O

something’s wrong here…
3 weeks is a long time to wait you know >:/

It’s likely a terminology mismatch. Could you provide a link that explains vertex transforms? From your description, they sound like they should be similar to Blender’s shape keys.

I don’t really have any info that describes anything… heh

but I can give you this:

vert = 1.0,-1.0,0.0
transform = 0.5,2.5,-1.0

new_vert = vert + transform
(new_vert == 1.5,1.5,-1.0)

‘vert’ would be basically the main position of the vert
(what would be logged in say… an obj file)
(look at the first image)

‘transform’ is the value to add to the vert

‘new_vert’ is the transformed vert offset
(look at the second image)

thanx for replying :slight_smile:

so these are called ‘shape keys’??

Have a look at the Blender wiki documentation of shape keys and let me know if that’s similar to the feature you’re looking for. That document is targeted at Blender 2.4x, but since your screenshots indicate you’re using that version anyway, that should be okay.

As for other file formats that support shape keys… I’m not fully sure. I’d wager that Collada and FBX can do it, but the follow-up question is whether or not Blender’s importers/exporters to those formats support shape keys.

hmm… that does sound quite similar
IDK if that’s what they would be called for the MDL0 format though <_<

hey
when applying them to a model would they offset the verts to a new position??
(not visually, but internally)

lemme restate that…
dealing with the vert positions in the data stream…
would those change when the values of the shape keys are applied to them??

like say…
if you were to export the verts from memory w/o applying the keys to the data,
would that cause the verts to offsetto a new position like in my first image??

The way that shape keys typically work is that you usually start with a basis shape (it’s similar to the idea of the first image you posted, but usually the model is coherent on its own). The vertices in subsequent shape keys are stored with their positions relative to the verts in the basis shape. This is predominantly used in animation, but it can pretty easily be used for other purposes.

My understanding of the MDL0 format is very superficial, but IIRC that format does not support armature-based animation… that is, animation has to happen via direct vertex transforms (i.e. Blender shape keys). So if I’m right, you should be able to use shape keys to do what you’re aiming for.

ok… thanx for the info :slight_smile:

hmm…
yeh… I’m a little confused now… XD

so to import…
the shape keys would reposition the altered verts to their proper place…
but to export…
the keys would distort the verts from the basis shape in the 2nd img,
and reposition them as shown in the first img…

is that right?? <:/

this is advanced stuff I’m just getting into…
so there’s gonna be alot of verification Q’s from me :stuck_out_tongue:
I hope you don’t mind XD

I’m trying to figure this out to build onto my format…

I’ve already got an idea on how to use the weights listed in the definition groups
but I’m not quite at that stage yet… heh

if you’re interested in my format…
I’ve just updated it: http://tcll5850.proboards.com/index.cgi?board=umcrel&action=display&thread=81&page=1
it’s still kindof at the basic model stage atm…

yeah yeah… I have my own forum… blah blah… 9_9
I’ve got enough hype on that already (coming from 11/14 forums I’m on)

I’ve moved this over to the Technical support forum as it fits there a bit better now (it’s either that or the Python support forum).

At any rate (and again, remember that my understanding of the MDL0 format is shakey at best… in fact, looking at your spec, it seems I was wrong about the format not supporting bone animation), I need to ask more questions. Specifically, does the object you’re attempting to import have any animation? More importantly, can a vertex have more than one transform state (that is, if the first image you post is the base and the second image is the vertices after transforming, could you have a third version with the vertices located at different coordinates)?

Now, assuming that you can, in fact, have more than one transform state for vertices (are they named?), then the translation to shape keys is pretty straight-forward. On import, you take the initial location of vertices and you set that as a basis shape. Then, for each transform state, you create a shape key and move each vertex accordingly. On export, it’s the same process, but in reverse.

However, if I’m completely wrong and there’s only one state of transform vertices, then shape keys are not your answer. In that case, your best option is probably to pull in the raw vertex locations first and then simply run a second pass where you move those vertices based on the values stipulated by the transform vertex values.

hmm…
in that case…
it might be my first thought…

facepalm derp derp DX<

alright… shape keys arn’t contained in MDL0 files
there are SHP0 files for which I originally thought those were…
(just had a different idea about them back then)
CHR0 files are for controlling the bone animations

if you’d like to learn a bit on an mdl0 file yourself,
I have a few resources I’ve developed…

sigh nintendo’s format is quite complicated…
but I can help you understand some of the basic stuff if you like :slight_smile:

the rest you’d have to look for in the Wii SDK or w/e…

EDIT:
thanx for moving this btw…
I’m hoping this’ll get better attention now

I figured it out :smiley:

ok so it applies to the weight groups
to apply a transform to a vert to get the actual offset:

vert + bone_matrix = actual_offset

where the bone matrix comes from the bone holding the weights

IDK if or why this is needed to build an MDL0 file, but I’m sure I’ll find out :slight_smile: