OpenGLContext.browser.interactivity
index
/home/mcfletch/pylive/OpenGLContext/browser/interactivity.py

Interactivity in VRML contexts
 
What I would like to do is create a mechanism
for binding python actions to a particular prototype
without requiring explicit subclassing within the
python class.  Something like:
 
8< ________ somefile.wrl ____
#VRML V2.0 utf8
 
PROTO TestNode [
    exposedField SFVec3f position 0,0,0
] {
    Shape { geometry Sphere {} appearance Appearance { material DEF Material Material{}}}
}
 
8< __________ regnode.py ____

 
Classes
       
ProtoScript

 
class ProtoScript
    Node providing scripting for a given node-name
 
  Methods defined here:
OnInit(self)
Initialisation of the node
__init__(self, *arguments, **named)
bindFieldHandlers(self)
Scan the class binding field handlers for this node
captureEvents(self, eventType, manager=None)
Capture the given events to the given manager
on_mouseover(self, event)
Change colour on mouse-over
registerCallback(self, button=0, state=0, modifiers=(0, 0, 0), function=None)
Register a (mouse) callback for our name
set_position(self, value, field, event)
Handle setting of position

Data and other attributes defined here:
PROTO = 'TestNode'

 
Data
        __file__ = '/home/mcfletch/pylive/OpenGLContext/browser/interactivity.py'
__name__ = 'OpenGLContext.browser.interactivity'