MakeHuman 3D Transformation functions.
Project Name: MakeHuman
Product Home Page: http://www.makehuman.org/
Code Home Page: https://bitbucket.org/MakeHuman/makehuman/
Authors: Manuel Bastioni, Marc Flerackers, Jonas Hauquier
Copyright(c): MakeHuman Team 2001-2015
Licensing: AGPL3 (http://www.makehuman.org/doc/node/the_makehuman_application.html)
This file is part of MakeHuman (www.makehuman.org).
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Coding Standards: See http://www.makehuman.org/node/165
This module contains algorithms used to perform high-level 3D transformations on the 3D mesh that is used to represent the human figure in the MakeHuman application.
These currently include:
- morphing for anatomical variations
- pose deformations
- mesh coherency tests (for use during the development cycle)
- visualisation functions (for use during the development cycle)
This will also be where any future mesh transformation algorithms will be coded. For example:
- collision deformations
- etc..
Default license for targets, shared for all targets that do not specify their own custom license, which is useful for saving storage space as this license is globally referenced by and applies to the majority of targets.
This function retrieves a set of translation vectors from a morphing target file and stores them in a buffer. It is usually only called if the translation vectors from this file have not yet been buffered during the current session.
The translation target files contain lists of vertex indices and corresponding 3D translation vectors. The buffer is structured as a list of lists (a dictionary of dictionaries) indexed using the morph target file name, so: “targetBuffer[targetPath] = targetData” and targetData is a list of vectors keyed on their vertex indices.
For example, a translation direction vector of [0,5.67,2.34] for vertex 345 would be stored using “targetData[345] = [0,5.67,2.34]”. If this is taken from target file “foo.target”, then this targetData could be assigned to the buffer with ‘targetBuffer[“c:/MH/foo.target”] = targetData’.
This function retrieves a set of translation vectors and applies those translations to the specified vertices of the mesh object. This set of translations corresponds to a particular morph target file. If the file has already been loaded into memory then the translation vectors are read from the target data buffer, otherwise a function is first called to load the target data from disk into a buffer for future use.
The translation target files contain lists of vertex indices and corresponding 3D translation vectors. The translation vector for each vertex is multiplied by a common factor (morphFactor) before being applied to the specified vertex.
Invalidate the cache for the specified target, so that it will be reloaded next time it is requested. Generally this only has effect if the target was loaded from an ascii file, not from npz archive.
This function resets the positions of the vertices of an object to their original base positions.
This function analyses an object to determine the differences between the current set of vertices and the vertices contained in the originalVerts list, writing the differences out to disk as a morphing target file.