GUI scripting: setObjectColor does not work

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Martin Gen
Posts: 2
Joined: Wed Aug 26, 2020 4:19 am

GUI scripting: setObjectColor does not work

Post by Martin Gen » Wed Aug 26, 2020 4:23 am

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!

Tags:

User avatar
Ayman Habib
Posts: 2233
Joined: Fri Apr 01, 2005 12:24 pm

Re: GUI scripting: setObjectColor does not work

Post by Ayman Habib » Wed Aug 26, 2020 10:16 am

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

User avatar
Radhakrishnan Vignesh
Posts: 104
Joined: Tue Jun 01, 2021 8:09 am

Re: GUI scripting: setObjectColor does not work

Post by Radhakrishnan Vignesh » Tue Jan 09, 2024 4:28 pm

Hi,

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

Thanks,
Vignesh

POST REPLY