diff --git a/ColorPlugin.cc b/ColorPlugin.cc index 8a6206ae3622e831d30bdfba1bd915d60aba9c9b..4b41b1c8f52f5fdd0bbb3e0cdc680559eb21957c 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 3360208fcacc7cff070abdf4b41cd0ec634037de..03d333f9cdf1032eb1af6ee1aa001bdfeef9c46d 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); + /** @} */ //===========================================================================