Posted By: HeelX
various MDL related MDL7 SDK questions - 01/26/12 10:03
Ok, I'll start a new thread here, because I will have to deal now to the full extent with the MDL part of the MDL7 SDK. Here are my first four questions:
1) In your LoadMdl7 example, you open a mdl, read the group count and iterate over them. For each group, you do the following:
which leads to the assumption, that skins are not associated to the model itself (like in .HMP files), but to a group. This feels wrong, given that you have in MED only a list of skins unrelated to any group(s). Then, in your SaveMdl7-example, you use a function save_skins to save skins. Though, you conditioned it to g == 0, whereas g is the iterator variable in the surrounding loop, that, well, iterates over all groups:
which leads to the observation, that skins are only saved in the first group and which confirms my feeling concerning my experience with MED. --- So how are you treating skins anyway? It is a bit confusing.
2) You are in fact doing all references (bone parents, skin asisgnment to triangles, vertex assignments to triangles, etc.pp.) via indices, which is fine for me. I observed, that all references are passed to me during loading in an ascending order. For example, if I get the bone with index = 6 and this bone has a parent, the parent index is guaranteed to be always < 6 (and not > 6; which I wil call a forward reference). This accounts to all other references as well. My question is, if I have to provide this sorting during saving or if I can do foward references, too. Subquestions are:
3) In your LoadMdl7-example, you just get the amount of triangles and use the method
to read them out. Nevertheless, in the class MDL7R there is a second one:
which I assume to be the method for getting the 2nd uv-set data. Question: how do I know if there is a second uv-set at all and how do I handle that?
4) Have you seen my saving-related feature request here?: http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=391472#Post391472
Regards,
-Christian
1) In your LoadMdl7 example, you open a mdl, read the group count and iterate over them. For each group, you do the following:
Code:
long skins; mdl.Group(skins, ...); //... if (skins) { // load each skin }
which leads to the assumption, that skins are not associated to the model itself (like in .HMP files), but to a group. This feels wrong, given that you have in MED only a list of skins unrelated to any group(s). Then, in your SaveMdl7-example, you use a function save_skins to save skins. Though, you conditioned it to g == 0, whereas g is the iterator variable in the surrounding loop, that, well, iterates over all groups:
Code:
if (dt.numgroups()) { for ( int g = 0; g < dt.numgroups(); g++) { // ... if (g == 0) save_skins(mdl7, dt);
which leads to the observation, that skins are only saved in the first group and which confirms my feeling concerning my experience with MED. --- So how are you treating skins anyway? It is a bit confusing.
- When loading, will group 0 only return any skins?
- Can it happen (during loading), that any other group reports skins?
- During saving - shall I just save the skins into group 0? What happens if I save skins in any other skins?
- During loading, triangles refer to a material index. I guess, this is the index of the loaded skins. So, do I just then use the index of skins in group 0?
2) You are in fact doing all references (bone parents, skin asisgnment to triangles, vertex assignments to triangles, etc.pp.) via indices, which is fine for me. I observed, that all references are passed to me during loading in an ascending order. For example, if I get the bone with index = 6 and this bone has a parent, the parent index is guaranteed to be always < 6 (and not > 6; which I wil call a forward reference). This accounts to all other references as well. My question is, if I have to provide this sorting during saving or if I can do foward references, too. Subquestions are:
- When passing indices during saving, must I hold the ascending condition? Will the function fail if I do a forward reference?
- Can I pass the indices arbitrarily and the SDK sorts them during saving anyway?
- What happens if do such a forward referencing, save and load the mdl... will the SDK will do a sorting before I get them or do I get them as I entered them during saving?
- Will such a forward referencing cause trouble in MED or the engine?
3) In your LoadMdl7-example, you just get the amount of triangles and use the method
Code:
bool Triangle(int & v1, int & v2, int & v3, int & sp1, int & sp2, int & sp3, int & material);
to read them out. Nevertheless, in the class MDL7R there is a second one:
Code:
bool Triangle(int & v1, int & v2, int & v3, int & sp1, int & sp2, int & sp3, int & material, int & sp21, int & sp22, int & sp23, int & material2);
which I assume to be the method for getting the 2nd uv-set data. Question: how do I know if there is a second uv-set at all and how do I handle that?
4) Have you seen my saving-related feature request here?: http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=391472#Post391472
Regards,
-Christian