Changeset 580


Ignore:
Timestamp:
08/24/11 16:02:44 (9 months ago)
Author:
ddangelo
Message:

simple script to capture X succesive frames added

Location:
trunk/avango-utils
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/avango-utils/python/SConscript

    r565 r580  
    3232avango.build.add_library(env, 'avango-osg') 
    3333avango.build.add_library(env, 'avango-core') 
    34 for lib in ['osg', 'osgDB', 'osgGA', 'osgViewer', 'osgParticle', 'osgText', 'osgUtil', 'GL', 'GLU']: 
    35     avango.build.add_library(env, lib) 
     34avango.build.add_library(env, 'avango-osgviewer') 
    3635 
    3736lib = env.SharedLibrary("_utils.cpp") 
     
    5756    _interpolators.py 
    5857    _node_optimizer.py 
     58    _screen_capture.py 
    5959    """) 
    6060 
  • trunk/avango-utils/python/__init__.py

    r522 r580  
    3939from _interpolators import * 
    4040from _node_optimizer import * 
     41from _screen_capture import * 
  • trunk/avango-utils/python/_utils.cpp

    r517 r580  
    2626#include <avango/Link.h> 
    2727#include <avango/ContainerPool.h> 
     28#include <avango/osg/viewer/View.h> 
    2829 
    2930#include <osg/Matrix> 
     31#include <osgViewer/View> 
     32#include <osgViewer/ViewerEventHandlers> 
    3033 
    3134#include "../include/avango/utils/Init.h" 
     
    160163} 
    161164 
     165 
     166void addScreenCaptureHandler(av::osg::viewer::View * avView, std::string folder, std::string filename, int numFrames) { 
     167  ::osgViewer::View * view = avView->getOsgView(); 
     168  osgViewer::ScreenCaptureHandler* scnsvr = new osgViewer::ScreenCaptureHandler(new osgViewer::ScreenCaptureHandler::WriteToFile(folder+"/"+filename,"png")); 
     169  scnsvr->setFramesToCapture(numFrames); 
     170  scnsvr->startCapture(); 
     171  view->addEventHandler(scnsvr); 
     172} 
     173 
     174 
    162175BOOST_PYTHON_MODULE(_utils) 
    163176{ 
     
    175188  def("print_registered_field_containers",print_actual_registered_field_containers); 
    176189 
     190  def("add_screen_capture_handler",addScreenCaptureHandler); 
     191 
    177192  av::utils::initMultiValueFields(); 
    178193  av::utils::initMultiValueOSGFields(); 
  • trunk/avango-utils/src/SConscript

    r503 r580  
    2828avango.build.add_library(env, 'avango-osg') 
    2929 
     30for lib in ['osg', 'osgDB', 'osgGA', 'osgViewer', 'osgParticle', 'osgText', 'osgUtil', 'GL', 'GLU']: 
     31    avango.build.add_library(env, lib) 
     32 
    3033env.Append(CPPDEFINES='AV_UTILS_LIBRARY') 
    3134 
Note: See TracChangeset for help on using the changeset viewer.