EXP_ListValue
Base class: EXP_PropValue
This is a list like object used in the game engine internally that behaves similar to a python list in most ways.
As well as the normal index lookup (val= clist[i]), EXP_ListValue supports string lookups (val= scene.objects["Cube"])
Other operations such as len(clist), list(clist), clist[0:10] are also supported.
append(val)
Section titled “append(val)”Add an item to the list (like pythons append)
count(val)
Section titled “count(val)”Count the number of instances of a value in the list.
Returns: number of instances
Return type: integer
index(val)
Section titled “index(val)”Return the index of a value in the list.
Returns: The index of the value in the list.
Return type: integer
reverse()
Section titled “reverse()”Reverse the order of the list.
get(key, default=None)
Section titled “get(key, default=None)”Return the value matching key, or the default value if its not found.
Returns: The key value or a default.
filter(name, prop)
Section titled “filter(name, prop)”Return a list of items with name matching name regex and with a property matching prop regex.
If name is empty every items are checked, if prop is empty no property check is proceeded.
Returns: The list of matching items.
from_id(id)
Section titled “from_id(id)”This is a funtion especially for the game engine to return a value with a spesific id.
Since object names are not always unique, the id of an object can be used to get an object from the EXP_ValueList.
Example:
myObID=id(gameObject)ob= scene.objects.from_id(myObID)Where myObID is an int or long from the id function.
This has the advantage that you can store the id in places you could not store a gameObject.
