University of Southern CaliforniaUSC
USC ICT TwitterUSC ICT FacebookUSC ICT YouTube

Python API to change background color | General SmartBody Discussion | Forum

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Python API to change background color
December 21, 2016
3:07 am
Avatar
Member
Members
Forum Posts: 20
Member Since:
April 21, 2016
sp_UserOfflineSmall Offline

I am not able to find any api to change the background color of the smartbody. 

I am looking for a wrapper in pyhon for the below C++ API

C:\Users\satyag\Documents\SmartBody\src\sbgui\fltk_viewer.cpp

else if (attrName == "GUI.BackgroundColor")
{
SmartBody::Vec3Attribute* vec3Attribute = dynamic_cast<SmartBody::Vec3Attribute*>(attribute);
SrVec val = vec3Attribute->getValue();
_data->bcolor = SrColor(val.x, val.y, val.z);
updateOptions();
}

i was expecting something like this in scene and could not find. 

scene.getAttribute('background').setValue(SrVec(1,1,1)) ???

 Any help?

 

thx

December 21, 2016
7:35 am
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

The following should work in Python:

scene.setVec3Attribute("GUI.BackgroundColor", 1, 1, 0)

 

Ari

December 21, 2016
8:28 am
Avatar
Member
Members
Forum Posts: 20
Member Since:
April 21, 2016
sp_UserOfflineSmall Offline

It worked. thx.