From 24478a3aa90218c761ecbca41a0cb324f88cd294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Fri, 8 Mar 2013 16:01:49 +0000 Subject: [PATCH] Added scripting function to set color of object via color plugin git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@16495 383ad7c9-94d9-4d36-a494-682f7c89f535 --- ColorPlugin.cc | 13 +++++++++++++ ColorPlugin.hh | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/ColorPlugin.cc b/ColorPlugin.cc index 8a6206a..4b41b1c 100644 --- a/ColorPlugin.cc +++ b/ColorPlugin.cc @@ -289,6 +289,19 @@ void ColorPlugin::setBackgroundColor( Vector _color ) { PluginFunctions::setBackColor(color); } +//----------------------------------------------------------------------------- + +void ColorPlugin::setObjectEmissiveColor(int _objectId , Vector4 _color) { + + BaseObjectData* object; + if ( ! PluginFunctions::getObject(_objectId,object) ) { + return; + } + + OpenMesh::Vec4f tmp = OpenMesh::Vec4f(_color); + object->materialNode()->set_base_color(tmp); + +} //----------------------------------------------------------------------------- diff --git a/ColorPlugin.hh b/ColorPlugin.hh index 3360208..03d333f 100644 --- a/ColorPlugin.hh +++ b/ColorPlugin.hh @@ -181,6 +181,13 @@ class ColorPlugin : public QObject, BaseInterface, MenuInterface, ScriptInterfac */ void setBackgroundColor( Vector _color ); + /** Sets the emissive color of an object + * + * @param _objectId Id of an Object + * @param _color Color to be set + */ + void setObjectEmissiveColor(int _objectId , Vector4 _color); + /** @} */ //=========================================================================== -- GitLab