Commit b5007c21 authored by Sylvain Thery's avatar Sylvain Thery Committed by Pierre Kraemer
Browse files

python recording

parent db28963b
...@@ -40,6 +40,7 @@ void Surface_Deformation_DockTab::positionAttributeChanged(int index) ...@@ -40,6 +40,7 @@ void Surface_Deformation_DockTab::positionAttributeChanged(int index)
{ {
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map); MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
m_plugin->h_parameterSet[map].positionAttribute = mh->getAttribute<PFP2::VEC3, VERTEX>(combo_positionAttribute->currentText()); m_plugin->h_parameterSet[map].positionAttribute = mh->getAttribute<PFP2::VEC3, VERTEX>(combo_positionAttribute->currentText());
m_plugin->pythonRecording("changePositionVBO", "", map->getName(), combo_positionAttribute->currentText());
} }
} }
} }
...@@ -54,6 +55,8 @@ void Surface_Deformation_DockTab::handleSelectorChanged(int index) ...@@ -54,6 +55,8 @@ void Surface_Deformation_DockTab::handleSelectorChanged(int index)
{ {
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map); MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
m_plugin->h_parameterSet[map].handleSelector = mh->getCellSelector<VERTEX>(combo_handleSelector->currentText()); m_plugin->h_parameterSet[map].handleSelector = mh->getCellSelector<VERTEX>(combo_handleSelector->currentText());
m_plugin->pythonRecording("changeHandleSelector", "", map->getName(), combo_handleSelector->currentText());
} }
} }
} }
...@@ -67,6 +70,7 @@ void Surface_Deformation_DockTab::freeSelectorChanged(int index) ...@@ -67,6 +70,7 @@ void Surface_Deformation_DockTab::freeSelectorChanged(int index)
{ {
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map); MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(map);
m_plugin->h_parameterSet[map].freeSelector = mh->getCellSelector<VERTEX>(combo_freeSelector->currentText()); m_plugin->h_parameterSet[map].freeSelector = mh->getCellSelector<VERTEX>(combo_freeSelector->currentText());
m_plugin->pythonRecording("changeFreeSelector", "", map->getName(), combo_freeSelector->currentText());
} }
} }
} }
......
...@@ -267,6 +267,9 @@ MapHandlerGen* Surface_Radiance_Plugin::importFromFile(const QString& fileName) ...@@ -267,6 +267,9 @@ MapHandlerGen* Surface_Radiance_Plugin::importFromFile(const QString& fileName)
mapParams.radiancePerVertexShader = new Utils::ShaderRadiancePerVertex(Utils::SphericalHarmonics<PFP2::REAL, PFP2::VEC3>::get_resolution()); mapParams.radiancePerVertexShader = new Utils::ShaderRadiancePerVertex(Utils::SphericalHarmonics<PFP2::REAL, PFP2::VEC3>::get_resolution());
registerShader(mapParams.radiancePerVertexShader); registerShader(mapParams.radiancePerVertexShader);
} }
this->pythonRecording("importFile", mhg->getName(), fi.baseName());
return mhg; return mhg;
} }
else else
...@@ -564,6 +567,8 @@ void Surface_Radiance_Plugin::exportPLY( ...@@ -564,6 +567,8 @@ void Surface_Radiance_Plugin::exportPLY(
} }
out.close() ; out.close() ;
this->pythonRecording("exportPLY", "", mapName, positionAttributeName, normalAttributeName, filename);
} }
......
...@@ -37,6 +37,7 @@ void Surface_Radiance_DockTab::positionVBOChanged(int index) ...@@ -37,6 +37,7 @@ void Surface_Radiance_DockTab::positionVBOChanged(int index)
m_plugin->h_mapParameterSet[map].positionVBO = map->getVBO(combo_positionVBO->currentText()); m_plugin->h_mapParameterSet[map].positionVBO = map->getVBO(combo_positionVBO->currentText());
foreach (View* v, map->getLinkedViews()) foreach (View* v, map->getLinkedViews())
v->updateGL(); v->updateGL();
m_plugin->pythonRecording("changePositionVBO", "", map->getName(), combo_positionVBO->currentText());
} }
} }
} }
...@@ -51,6 +52,7 @@ void Surface_Radiance_DockTab::normalVBOChanged(int index) ...@@ -51,6 +52,7 @@ void Surface_Radiance_DockTab::normalVBOChanged(int index)
m_plugin->h_mapParameterSet[map].normalVBO = map->getVBO(combo_normalVBO->currentText()); m_plugin->h_mapParameterSet[map].normalVBO = map->getVBO(combo_normalVBO->currentText());
foreach (View* v, map->getLinkedViews()) foreach (View* v, map->getLinkedViews())
v->updateGL(); v->updateGL();
m_plugin->pythonRecording("changeNormalVBO", "", map->getName(), combo_normalVBO->currentText());
} }
} }
} }
...@@ -78,6 +80,13 @@ void Surface_Radiance_DockTab::decimateClicked() ...@@ -78,6 +80,13 @@ void Surface_Radiance_DockTab::decimateClicked()
slider_decimationGoal->value() / 100.0f, slider_decimationGoal->value() / 100.0f,
checkbox_halfCollapse->checkState() == Qt::Checked checkbox_halfCollapse->checkState() == Qt::Checked
); );
m_plugin->pythonRecording("decimate", "",
m_schnapps->getSelectedMap()->getName(),
combo_positionVBO->currentText(),
combo_normalVBO->currentText(),
slider_decimationGoal->value() / 100.0f,
checkbox_halfCollapse->checkState() == Qt::Checked);
} }
......
...@@ -440,10 +440,6 @@ void SCHNApps::disablePlugin(const QString& pluginName) ...@@ -440,10 +440,6 @@ void SCHNApps::disablePlugin(const QString& pluginName)
{ {
if (m_plugins.contains(pluginName)) if (m_plugins.contains(pluginName))
{ {
// RECORDING
if (m_pyRecording)
*m_pyRecording << "schnapps.disablePlugin(\"" << pluginName << "\");" << endl;
Plugin* plugin = m_plugins[pluginName]; Plugin* plugin = m_plugins[pluginName];
// remove plugin dock tabs // remove plugin dock tabs
...@@ -473,6 +469,12 @@ void SCHNApps::disablePlugin(const QString& pluginName) ...@@ -473,6 +469,12 @@ void SCHNApps::disablePlugin(const QString& pluginName)
emit(pluginDisabled(plugin)); emit(pluginDisabled(plugin));
delete plugin; delete plugin;
// RECORDING
if (m_pyRecording)
*m_pyRecording << "schnapps.disablePlugin(\"" << pluginName << "\");" << endl;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment