Plasma Python API
Posted: Sat Mar 27, 2010 11:35 am
Quite some time ago I got a script from the web and adapted it to print all functions, classes and their methods of the Plasma module, including the help text Cyan wrote for them (of course this can be used for other modules, too).
Now most of this documentation could also be guessed from the name of the functions, but in some cases there's additional useful information. Plus, this is the actual list of available classes, whereas Plasma.py is just a dummy. For example, the ptCCRMgr does not actually exist, while PtLoadAvatarModel is not even mentioned in Plasma.py.
I also extended the script to print properties, but there are only two classes having those - still, this is information not available in Plasma.py.
Here's an example:
Would this be useful for anyone and perhaps worth uploading somewhere onto the wiki?
Now most of this documentation could also be guessed from the name of the functions, but in some cases there's additional useful information. Plus, this is the actual list of available classes, whereas Plasma.py is just a dummy. For example, the ptCCRMgr does not actually exist, while PtLoadAvatarModel is not even mentioned in Plasma.py.
I also extended the script to print properties, but there are only two classes having those - still, this is information not available in Plasma.py.
Here's an example:
- Code: Select all
[Class: ptSceneobject]
Method: addKey (Params: key;Mostly used internally.;Add another sceneobject ptKey)
Method: animate
Property: avatar
Method: avatarVelocity
Property: draw
Method: fastForwardAttachedResponder (Params: state)
Method: findObject (Params: name;Find a particular object in just the sceneobjects that are attached)
Method: getKey (Get the ptKey of this sceneobject;If there are more then one attached, get the first one)
Method: getLocalToParent
Method: getLocalToWorld (Returns ptMatrix44 of the local to world transform for this sceneobject;- If there is more than one sceneobject attached, returns just the first one)
Method: getName (Returns the name of the sceneobject (Max name);- If there are more than one sceneobject attached, return just the first one)
Method: getParentToLocal
Method: getPythonMods (Returns list of ptKeys of the python modifiers attached to this sceneobject)
Method: getResponderState
Method: getResponders (Returns list of ptKeys of the responders attached to this sceneobject)
Method: getSoundIndex (Params: sndComponentName;Get the index of the requested sound component)
Method: getWorldToLocal (Returns ptMatrix44 of the world to local transform for this sceneobject;- If there is more than one sceneobject attached, returns just the first one)
Method: isAvatar
Method: isHuman
Method: isLocallyOwned (Returns true(1) if this object is locally own by this client;or returns false(0) if it is not or don't know)
Method: netForce (Params: forceFlag;Specify whether this object needs to use messages that are forced to the network;- This is to be used if your Python program is running on only one client;Such as a game master, only running on the client that owns a particular object;- Setting the netForce flag on a sceneobject will also set the netForce flag on;its draw, physics, avatar, particle objects)
Property: particle
Property: physics
Method: playAnimNamed (Params: animName)
Method: popCamera (Params: avKey)
Method: popCutsceneCamera (Params: avKey;Pop the camera stack and go back to previous camera.)
Method: position
Method: pushCamera (Params: avKey)
Method: pushCameraCut (Params: avKey)
Method: pushCutsceneCamera (Params: cutFlag,avKey;Switch to this object (assuming that it is actually a camera))
Method: rewindAnimNamed (Params: animName)
Method: right
Method: runAttachedResponder (Params: state)
Method: setSoundFilename (Params: index, filename, isCompressed;Sets the sound attached to this sceneobject to use the specified sound file.)
Method: setTransform (Params: local2world,world2local)
Method: stopAnimNamed (Params: animName)
Method: up
Method: view
Would this be useful for anyone and perhaps worth uploading somewhere onto the wiki?