This chapter describes the builtin commands which are implemented in the cgkit.cmds module and which are always available. New commands can be added via the register() function (for example, by plugins), so there might actually be more commands available than are listed here.
| pos, obj) |
| objs) |
| ) |
Example:
>>> listWorld() Root +---Bottom (Box/BoxGeom) +---GLPointLight (GLPointLight/-) +---GLPointLight1 (GLPointLight/-) +---Middle (Sphere/SphereGeom) +---TargetCamera (TargetCamera/-) +---Top (Box/BoxGeom) >>> exec setupObjectNames() >>> Bottom <cgkit.box.Box object at 0x094765D0> >>> TargetCamera <cgkit.targetcamera.TargetCamera object at 0x09470BD0> >>> Top <cgkit.box.Box object at 0x09476690>
| *children, **name) |
name keyword argument.
The return value is the newly created Group object.
Example:
>>> b1=Box()
>>> b2=Box()
>>> s1=Sphere()
>>> listWorld()
Root
+---Box (Box/BoxGeom)
+---Box1 (Box/BoxGeom)
+---Sphere (Sphere/SphereGeom)
>>> group("Box", "Box1", s1, name="MyGroup")
>>> listWorld()
Root
+---MyGroup (Group/-)
+---Box (Box/BoxGeom)
+---Box1 (Box/BoxGeom)
+---Sphere (Sphere/SphereGeom)
| group) |
Example:
>>> listWorld()
Root
+---MyGroup (Group/-)
+---Box (Box/BoxGeom)
+---Box1 (Box/BoxGeom)
+---Sphere (Sphere/SphereGeom)
>>> ungroup("MyGroup")
>>> listWorld()
Root
+---Box (Box/BoxGeom)
+---Box1 (Box/BoxGeom)
+---Sphere (Sphere/SphereGeom)
| name, newmat) |
| childs, parent=None, relative=False) |
None then the links are just
removed. The argument childs may be either a single world object or
a sequence of world objects. Instead of world objects you can also pass
the names of the world objects.
By default, the absolute position and orientation of the children is
maintained (i.e. the local transform is modified). If you set relative
to True the local transform is not modified which will change the
position/orientation of the children (unless the parent transform is the
identity).
Note: The function modifies the name of a child object if there would be a clash with an existing object under the new parent.
| ) |
| pos, col=(1,1,1), size=1) |
| pos1, pos2, col=(1,1,1), size=1) |
| pos, txt, font=None, col=(1,1,1)) |
GLUT_BITMAP_8_BY_13
GLUT_BITMAP_9_BY_15 (default)
GLUT_BITMAP_TIMES_ROMAN_10
GLUT_BITMAP_TIMES_ROMAN_24
GLUT_BITMAP_HELVETICA_10
GLUT_BITMAP_HELVETICA_12
GLUT_BITMAP_HELVETICA_18
| ) |
>>> load("demo4.py")
>>> listWorld()
Root
+---GLDistantLight (GLTargetDistantLight/-)
+---GLDistantLight1 (GLTargetDistantLight/-)
+---Sphere (Sphere/SphereGeom)
| +---Box0 (Box/BoxGeom)
| +---Box1 (Box/BoxGeom)
| +---Box2 (Box/BoxGeom)
| +---Box3 (Box/BoxGeom)
| +---Box4 (Box/BoxGeom)
| +---Box5 (Box/BoxGeom)
| +---Box6 (Box/BoxGeom)
| +---Box7 (Box/BoxGeom)
| +---Box8 (Box/BoxGeom)
| +---Box9 (Box/BoxGeom)
+---TargetCamera (TargetCamera/-)
| filename, **options) |
To be able to load the file there must be an appropriate import class (protocol: "Import") available in the plugin manager. The class is determined by examining the file extension. If no importer is found a NoImporter exception is thrown. See chapter 13.2 for the available standard importers.
Any exception generated in the importer is passed to the caller.
| filename, **options) |
To be able to save the scene there must be an appropriate export class (protocol: "Export") available in the plugin manager. The class is determined by examining the file extension. If no exporter is found a NoExporter exception is thrown.
Any exception generated in the exporter is passed to the caller.
| ) |
| obj) |
| objs) |
| cmds,...) |
| paths) |
| paths) |
>>> splitPaths("&:c:\\shaders:c:\\more_shaders;")
['&', 'c:\\shaders', 'c:\\more_shaders']