Page 1 of 1

GUI scripting: setObjectColor does not work

Posted: Wed Aug 26, 2020 4:23 am
by genim
Hi, some commands don't seem to work in the scriptinshell window of the GUI:

I can get the model, a marker and a body fine:

Code: Select all

a = getCurrentModel()
thoraxBody = a.getBodySet().get("thorax")
randomMarker = a.getMarkerSet().get("ij")
Display/hide works (without updateDisplay()):

Code: Select all

toggleObjectDisplay(thoraxbody,0)
toggleObjectDisplay(thoraxbody,1)
toggleObjectDisplay(randomMarker,0)
toggleObjectDisplay(randomMarker,1)
But changing the color or the opacity does not work on either of the two objects (with and without updateDisplay()):

Code: Select all

setObjectOpacity(thoraxbody,0)
setObjectColor(thoraxbody,[51,255,51])
setObjectOpacity(randomMarker,0)
setObjectColor(randomMarker,[51,255,51])
Any clue?
Thanks!

Re: GUI scripting: setObjectColor does not work

Posted: Wed Aug 26, 2020 10:16 am
by aymanh
Hi Martin,

I confirmed that the functionality to change color and opacity through scripting broke during the transition to 4.0. I opened an issue to track and fix it in the next release so it doesn't fall through the cracks.

Thanks for reporting,
-Ayman

Re: GUI scripting: setObjectColor does not work

Posted: Tue Jan 09, 2024 4:28 pm
by vigneshrk
Hi,

Has this been fixed in OpenSim 4.4? How can I change the colour of markers?

Thanks,
Vignesh