Skip to content

Commit

Permalink
Autogen documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
joepal1976 committed Apr 2, 2017
1 parent 6994d7b commit f977d18
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 48 deletions.
5 changes: 2 additions & 3 deletions docs/assets.md
@@ -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"


12 changes: 6 additions & 6 deletions docs/internals.md
@@ -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.

12 changes: 6 additions & 6 deletions docs/locations.md
@@ -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)

7 changes: 3 additions & 4 deletions docs/mesh.md
@@ -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

28 changes: 3 additions & 25 deletions docs/modifiers.md
@@ -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()

-

38 changes: 38 additions & 0 deletions docs/ui.md
@@ -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)

7 changes: 3 additions & 4 deletions docs/version.md
@@ -1,6 +1,6 @@
# Version

Information about hg and the current makehuman version.
This namespace wraps all calls that are related to hg and MH version.

## getBranch()

Expand All @@ -12,13 +12,13 @@ Return the full textual representation of the Hg revision, for example 'r1604 (d

## getRevisionId()

Returns the hash id of the current local revision as an integer, for example d48f36771cc0. If this is not possible to deduce, None is returned.
Return the hash id of the Hg revision, for example 'd48f36771cc0'. If this is not possible to deduce, None is returned.

## getRevisionNumber()

Returns the number of the current local revision as an integer, for example 1604. If this is not possible to deduce, None is returned.

## getVersion()
## getFullVersion()

Returns the full textual description of the current version, for example 'MakeHuman unstable 20141120' or 'MakeHuman 1.0.2'.

Expand All @@ -30,4 +30,3 @@ Returns the numeric representation of the version number as cells in an array, f

Returns the string representation of the version number, for example '1.0.2'.


4 changes: 4 additions & 0 deletions docs/viewport.md
@@ -0,0 +1,4 @@
# Viewport

This namespace wraps calls which relate to the viewport (camera position etc).

55 changes: 55 additions & 0 deletions genDoc.py
@@ -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

0 comments on commit f977d18

Please sign in to comment.