Suggested additional documentation for compound()

18 views
Skip to first unread message

Bennett Weaver

unread,
May 13, 2018, 9:17:55 PM5/13/18
to Glowscript Users
Bruce,

While trying to debug a program I was getting unexpected results (so what's new?). I had chosen a very poor way to display objects, some visible and some not. The clue to the behavior came when I realized that compounding a list of visible and non-visible objects turns on the visibility for all the objects that are being compounded, ie: .visible = True for all the objects in the compound. 

A note about this behavior in the docs might help some beginner folk, like me.

My solution was to create, using clone(), only those objects that needed to be visible. In my case, that eleminated thousands of non-visible objects, greatly increasing display speed.

Thanks for all you do.

Bennett Weaver

Bruce Sherwood

unread,
May 14, 2018, 9:20:23 AM5/14/18
to Glowscript Users
Good point. I'll revise the documentation.

I don't understand your clone comment. Why not simply avoid adding invisible objects to the compound list?

Bruce

Bruce Sherwood

unread,
May 14, 2018, 9:53:49 AM5/14/18
to Glowscript Users
The documentation has updated. Thanks.

Bruce

Bennett Weaver

unread,
May 14, 2018, 4:56:40 PM5/14/18
to Glowscript Users
Your suggestion regarding avoiding compounding invisible object is what I implemented. 

The cloning reference was because the visible objects are selected from a list of possible candidates. The list is moved to a different location before each element is checked for visibility. For each location, only the "will be visible" elements of the the list are cloned and compounded before the list is moved to the next location.

Thanks.

Bennett Weaver
Reply all
Reply to author
Forward
0 new messages