Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6994d7b
commit f977d18
Showing
9 changed files
with
120 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
# Assets | ||
|
||
These are calls related to reading, parsing and manipulating assets. | ||
This namespace wraps all calls that are related to reading and managing assets. | ||
|
||
## openAssetFile(path, strip = False) | ||
|
||
This opens an asset file and returns an [assetInfo](assetInfo.md) dict. If strip is set to True, the raw data is excluded from the dict. | ||
Opens an asset file and returns a hash describing it | ||
|
||
## writeAssetFile(assetInfo, createBackup = True) | ||
|
||
This (over)writes the asset file named in the assetInfo's "absolute path" key. If createBackup is set to True, any pre-existing file will be backed up to it's former name + ".bak" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
# Internals | ||
|
||
These are calls which you would normally not need to make. They give you low-level access to internal MakeHuman objects. In most cases | ||
you would do operations via calls in other namespaces, not directly on these. | ||
The *internals* namespace hierarcy consists of a number of namespaces collecting calls for gaining low-level access to internal MakeHuman functionality. | ||
|
||
In the vast majority of cases, you would benefit from first trying to find a relevant call elsewhere in the API, and as a last resort look here. | ||
|
||
## getHuman() | ||
|
||
Returns the central human object. | ||
Get the central human object. | ||
|
||
## getApp() | ||
|
||
Returns the central "app" object. | ||
Get the central app object. | ||
|
||
## getSkeleton() | ||
|
||
Returns the current Human's skeleton. This will return None if no skeleton is assigned. | ||
|
||
Get the human's skeleton, if any. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
# Locations | ||
|
||
Gives you information about file and directory locations. | ||
This namespace wraps all calls that are related to file and directory locations. | ||
|
||
## getUnicodeAbsPath(path) | ||
|
||
Returns the abspath version of path, and ensures that it is correctly encoded | ||
|
||
## getInstallationPath(subpath = "") | ||
|
||
Returns the unicode-encoded absolute path to the directory which contains the makehuman.py file. If subpath is given, assume that a subdirectory is indicated and return the combined path. | ||
Returns the unicode-encoded absolut path to the directory which contains the makehuman.py file | ||
|
||
## getUserDataPath(subpath = "") | ||
## getSystemDataPath(subpath = "") | ||
|
||
Returns the unicode-encoded absolute path to the location of the user's "data" directory (as opposed to the installation's data directory). If subpath is given, assume that a subdirectory is indicated and return the combined path. | ||
|
||
## getUserHomePath(subpath = "") | ||
|
||
Returns the unicode-encoded absolute path to the location of the user's makehuman directory (i.e normally ~/makehuman). If subpath is given, assume that a subdirectory is indicated and return the combined path. | ||
Returns unicode-encoded absolute path to the location of the user's makehuman directory (i.e normally ~/makehuman). | ||
|
||
## getSystemDataPath(subpath = "") | ||
## getUserDataPath(subpath = "") | ||
|
||
Returns the unicode-encoded absolute path to the location of the installation's "data" directory (as opposed to the user's data directory). If subpath is given, assume that a subdirectory is indicated and return the combined path. | ||
Returns unicode-encoded absolute path to the location of the user's "data" directory (as opposed to the installation's data directory) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
## mesh | ||
# Mesh | ||
|
||
Operations on and info about the mesh as such (ie direct access to vertices, edges and faces) | ||
This namespace wraps call which works directly on mesh vertices, edges and faces. | ||
|
||
## getVertexCoordinates() | ||
|
||
Returns an array with the location of all vertices. | ||
|
||
Return an array with the current position of vertices | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,26 @@ | ||
# Modifiers | ||
|
||
Gives you control and information about modifiers and targets. | ||
This namespace wraps calls concerning modifiers and targets. | ||
|
||
## applyModifier(modifierName, power) | ||
## applyModifier(modifierName, power, assumeThreading = False) | ||
|
||
Applies the named modifier, using the power (which is usually between 0.0 and 1.0, but sometimes between -1.0 and +1.0) | ||
|
||
## applyTarget(targetName,power) | ||
|
||
Applies the named target, using the power (which is usually between 0.0 and 1.0, but sometimes between -1.0 and +1.0) | ||
## applyTarget(targetName,power, assumeThreading = False) | ||
|
||
## getAppliedTargets() | ||
|
||
Get a list of which targets have been applied, and to what extent | ||
|
||
## setAge(age) | ||
|
||
- | ||
|
||
## setWeight(weight) | ||
|
||
- | ||
|
||
## setMuscle(muscle) | ||
|
||
- | ||
|
||
## setHeight(height) | ||
|
||
- | ||
|
||
## setGender(gender) | ||
|
||
- | ||
|
||
## getAvailableModifierNames() | ||
|
||
Get the full list of available modifiers. | ||
|
||
## applySymmetryLeft() | ||
|
||
- | ||
|
||
## applySymmetryRight() | ||
|
||
- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# ComboBox(QtGui.QComboBox, QtGui.QWidget) | ||
|
||
## setData(items) | ||
|
||
## getCurrentItem() | ||
|
||
## rowCount() | ||
|
||
## setCurrentRow(row) | ||
|
||
## setCurrentItem(itemText) | ||
|
||
## setOnChange(onChange) | ||
|
||
# UI | ||
|
||
This namespace wraps all calls that are related to working with the user interface. | ||
|
||
## createWidget() | ||
|
||
## createTab(parent,name,label) | ||
|
||
## createGroupBox(label) | ||
|
||
## createSlider(value=0.0, min=0.0, max=1.0, label=None, vertical=False, valueConverter=None, image=None, scale=1000) | ||
|
||
## createButton(label=None, selected=False) | ||
|
||
## createCheckBox(label=None, selected=False) | ||
|
||
## createComboBox(data = None, onChange = None) | ||
|
||
## createList(data=None) | ||
|
||
## createLabel(label='') | ||
|
||
## createTextEdit(text='', validator = None) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Viewport | ||
|
||
This namespace wraps calls which relate to the viewport (camera position etc). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/python3 | ||
|
||
import os | ||
import re | ||
|
||
files = [] | ||
|
||
for dirName, subdirList, fileList in os.walk("1_mhapi"): | ||
for fileName in fileList: | ||
fileBase, fileExt = os.path.splitext(fileName) | ||
if fileExt == ".py" and fileBase.startswith("_") and not fileBase.startswith("__"): | ||
newFile = {} | ||
newFile["dirName"] = dirName | ||
newFile["fileBase"] = fileBase | ||
newFile["functions"] = {} | ||
|
||
with open(os.path.join(dirName,fileName),'r') as f: | ||
newFile["contents"] = f.readlines() | ||
|
||
files.append(newFile) | ||
|
||
classMatch = re.compile('class\s+(.*):') | ||
defMatch = re.compile('\s+def\s+([^_]*):') | ||
|
||
for aFile in files: | ||
|
||
fn = aFile["fileBase"].replace("_","") | ||
fn = fn + ".md" | ||
fn = os.path.join("docs",fn) | ||
|
||
with open(fn,'wt') as f: | ||
|
||
length = len(aFile["contents"]) | ||
i = 0 | ||
|
||
while i < length: | ||
currentLine = aFile["contents"][i] | ||
m = classMatch.match(currentLine) | ||
if(m): | ||
cn = m.group(1).replace("(NameSpace)","") | ||
f.write("# " + cn + "\n\n") | ||
|
||
m = defMatch.match(currentLine) | ||
if(m): | ||
funcName = m.group(1) | ||
funcName = funcName.replace("self,","") | ||
funcName = funcName.replace("self","") | ||
funcName = funcName.replace("( ","(") | ||
f.write("## " + funcName + "\n\n") | ||
if '"""' in currentLine: | ||
currentLine = currentLine.replace('"""','').strip() | ||
f.write(currentLine + "\n\n") | ||
|
||
i = i + 1 | ||
|