Commit 24478a3a authored by Jan Möbius's avatar Jan Möbius

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
parent b3b9774d
...@@ -289,6 +289,19 @@ void ColorPlugin::setBackgroundColor( Vector _color ) { ...@@ -289,6 +289,19 @@ void ColorPlugin::setBackgroundColor( Vector _color ) {
PluginFunctions::setBackColor(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);
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
...@@ -181,6 +181,13 @@ class ColorPlugin : public QObject, BaseInterface, MenuInterface, ScriptInterfac ...@@ -181,6 +181,13 @@ class ColorPlugin : public QObject, BaseInterface, MenuInterface, ScriptInterfac
*/ */
void setBackgroundColor( Vector _color ); 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);
/** @} */ /** @} */
//=========================================================================== //===========================================================================
......
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