void PythonMainScriptController::script_onScriptEvent(ScriptEvent* event)
{
    helper::ScopedAdvancedTimer advancedTimer( (std::string("PythonMainScriptController_Event_")+this->getName()).c_str() );

    PythonScriptEvent *pyEvent = static_cast<PythonScriptEvent*>(event);
    PythonEnvironment::gil lock(__func__);    
    SP_CALL_MODULEFUNC(m_Func_onScriptEvent,"(OsO)",sofa::PythonFactory::toPython(pyEvent->getSender().get()),const_cast<char*>(pyEvent->getEventName().c_str()),pyEvent->getUserData())
}
Example #2
0
void PythonScriptController::script_onScriptEvent(core::objectmodel::ScriptEvent* event)
{
    ActivableScopedAdvancedTimer advancedTimer(m_timingEnabled.getValue(), 
                                               "PythonScriptController_onScriptEvent", this);
    PythonEnvironment::gil lock(__func__);
    PythonScriptEvent *pyEvent = static_cast<PythonScriptEvent*>(event);
    SP_CALL_MODULEFUNC(m_Func_onScriptEvent,"(OsO)",
                       sofa::PythonFactory::toPython(pyEvent->getSender().get()),
                       pyEvent->getEventName().c_str(),pyEvent->getUserData());
}