K3Studio has embedded Python. Started from a shell user gets a standard command
line with Python prompt.
The embedding consists of C wrappers created from headers (.i files resp.) with SWIG which also generates appropriate .py script files.
The main application has interface described in k3studio.py but every plugin can have its own Python interface.
The .py files are located in KDEPREFIX/apps/k3studio/python/.
Use dir() to see what's available.
r=net().root() // get the root of network p1=K3Point(r) // create the point p1, child of root paint() // change are reflected on area(s) p1.setXyz(10,10,10) // set new p1 coordinates paint() // again changes are reflected
c=area().camera() // get the camera node for i in range(0,359,5): c.rotate(5,0,0,1) paint() peq() // you can play with the scene while this loop is running
from math import * r=area().root() N=K3NSphere(r,"Sphere") n.setScaleXyz(4,4,4) p=K3Point(r,"Light") p1=K3Point(r,"Light") p.setXyz(5,5,5) area().lighting().setOn(1) area().lighting().light(0).setNode(p) area().lighting().light(1).setNode(p1) paint() while 1: for i in range(0,360): x=5*cos(2*pi*i/360) y=5*sin(2*pi*i/360) p.setX(x) p.setZ(y) p.lookAt(0,0,0) x=5*cos(2*pi*(i+180)/360) y=5*sin(2*pi*(i+180)/360) p1.setX(x) p1.setZ(y) p1.lookAt(0,0,0) paint() peq()