I had a mayor rethinking on the way I was loading obj files from Maya and coded some basic error detection algorithms.
Maya does not export information regarding groups that doesn't have any faces associated to (empty groups) to an obj file, which is not really a big issue, normally. The problem is that the way Maya names groups do involve empty groups if they exist, and therefore they are used when you make the association of what face goes to what group.
In Maya a group hierarchy like "g father son", means that there are 2 groups a group father and a group son, and the relationship between them (son goes under father), on the other hand a name like this: "g father son empty) means that the hierarchy is like this father->empty->son, an empty group at the end of a branch wouldn't appear in the group name at all because there are no faces after, but if after an empty group there is a group with info like in this hierarchy father->son->empty->sonofson maya would do something like "g father son sonofson empty", the best way to avoid this kind of problems is avoid the use of empty groups whenever possible, but they do have the advantage of giving an extra movement axis for animations, so other possible solution is create a Hierarchy association by hand, will work on the latest solution eventually in MEL, right now the best solution is what I ended up doing:
Right now the code accepts hierarchy named groups from Maya but will skip all empty groups unless the user manually adds them to the file any where like "g group" a problem for detecting the empty groups is that there is no easy way to detect them as they don't really exist so we have to name that empty group as they please but with the identifier "NULL_" before the name. Anyhow if we want those groups in the model for the sake of animation they must be added by hand to the OBJ and the hierarchy file.
The other thing that used my day was adding an extra texture to a material, this texture will be used by the shader to create BumpMaps, so far I only load the texture, no fancy normal yet, this image is from the model rendering with the BumpMap instead of the Texture file.
Next Step: Shaders.
Yo soy Alberto y ese ha sido mi post.
Happy Codding!
Suscribirse a:
Enviar comentarios (Atom)



No hay comentarios:
Publicar un comentario