示例#1
0
文件: anim.py 项目: gcross/QC-Talks
 def render( self, t, aspect, alpha ):
     camera = self.camera.eval_unfinished( t )
     #print 'inter pre'
     draw._pre_drawing( aspect, alpha, self.name )
     try:
         draw.set_camera( camera )
         viewall = Rect( draw.visible() )
         for i in self.working_set.eval( t ):
             d, view = i.eval_unfinished( t )
             if view is None:
                 view = viewall
             i.render( d, view, t )
     finally:
         draw._post_drawing()
示例#2
0
文件: anim.py 项目: markovg/slithy
 def render(self, t, aspect, alpha):
     camera = self.camera.eval_unfinished(t)
     #print 'inter pre'
     draw._pre_drawing(aspect, alpha, self.name)
     try:
         draw.set_camera(camera)
         viewall = Rect(draw.visible())
         for i in self.working_set.eval(t):
             d, view = i.eval_unfinished(t)
             if view is None:
                 view = viewall
             i.render(d, view, t)
     finally:
         draw._post_drawing()
示例#3
0
文件: anim.py 项目: gcross/QC-Talks
 def render( self, t, aspect, alpha ):
     camera = self.camera.eval_finished( self.timelines[self.camera], t )
     #print 'anim pre'
     draw._pre_drawing( aspect, alpha, self.name )
     keepalive = 0
     try:
         draw.set_camera( camera )
         torender = self.working_set.eval( t )
         for i in torender:
             d, view = i.eval_finished( self.timelines[i], t )
             if view is None: view = draw.visible()
             if i.render( d, view, t ):
                 keepalive = 1
             
         for i in self.cast:
             if i not in torender:
                 i.no_render()
     finally:
         draw._post_drawing()
     return keepalive
示例#4
0
文件: anim.py 项目: markovg/slithy
    def render(self, t, aspect, alpha):
        camera = self.camera.eval_finished(self.timelines[self.camera], t)
        #print 'anim pre'
        draw._pre_drawing(aspect, alpha, self.name)
        keepalive = 0
        try:
            draw.set_camera(camera)
            torender = self.working_set.eval(t)
            for i in torender:
                d, view = i.eval_finished(self.timelines[i], t)
                if view is None: view = draw.visible()
                if i.render(d, view, t):
                    keepalive = 1

            for i in self.cast:
                if i not in torender:
                    i.no_render()
        finally:
            draw._post_drawing()
        return keepalive
示例#5
0
def global_draw_object(obj, pdict, aspect, alpha):
    #print 'GDO: %.2f %s' % (aspect, obj)

    if isinstance(obj, anim.Animation):
        return obj.render(pdict['t'], aspect, alpha)

    elif isinstance(obj, controller.Controller):
        obj._anim.render(pdict['t'], aspect, alpha)

    elif isinstance(obj, tuple):
        draw._do_gldrawing(obj[0], pdict, aspect, alpha)

    elif callable(obj):
        # object must be a parameterized diagram
        try:
            #print 'diagram pre'
            draw._pre_drawing(aspect, alpha, obj.func_name)
            obj(**pdict)
        finally:
            draw._post_drawing()

    else:
        raise ValueError, ('global_draw_object on object', obj)
示例#6
0
文件: system.py 项目: gcross/QC-Talks
def global_draw_object( obj, pdict, aspect, alpha ):
    #print 'GDO: %.2f %s' % (aspect, obj)
    
    if isinstance( obj, anim.Animation ):
        return obj.render( pdict['t'], aspect, alpha )

    elif isinstance( obj, controller.Controller ):
        obj._anim.render( pdict['t'], aspect, alpha )

    elif isinstance( obj, tuple ):
        draw._do_gldrawing( obj[0], pdict, aspect, alpha )
        
    elif callable( obj ):
        # object must be a parameterized diagram
        try:
            #print 'diagram pre'
            draw._pre_drawing( aspect, alpha, obj.func_name )
            obj( **pdict )
        finally:
            draw._post_drawing()

    else:
        raise ValueError, ('global_draw_object on object', obj)