Opened 5 years ago

Last modified 2 years ago

#4536 closed defect

consist model color scheme — at Initial Version

Reported by: Eric Pettersen Owned by: Eric Pettersen
Priority: moderate Milestone:
Component: Core Version:
Keywords: Cc: Tom Goddard
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

Discussion from email thread:

Yes, we need to come up with something mnemonic and consistent. For now, I am just having the Model Panel issue the appropriate 'color' command, though for those that have to resort to the 'models' target the undo won't be correct until this gets sorted out.

--Eric

On Apr 15, 2021, at 6:55 PM, Tom Goddard <goddard@…> wrote:

If git says I wrote that I guess we have to believe it. It saves the single color and vertex colors and the auto-recoloring state for a Model. Keep in mind that color command _set_model_color() really appears to be "_set_nonmolecular_surface_color()" -- that is the only case it is called. I probably spent all of 15 minutes designing that code. So I' would not jump to apply it to everything without careful thought.

I am a little worried that Model.color and Model.model_color is going to cause a lot of confusion. Maybe it can be remedied by adequate doc strings. Currently Structure, Volume and VolumeSurface all override Drawing.set_color() which is used by property Drawing.color. That stuff was all done before single_color existed and I think those overrides were trying to do the same thing as single_color -- ie color model subdrawings, not just set the Drawing._color attribute which would not even be visible. So I am unclear how this mess is going to be sorted out. I think the lower level graphics module Drawing needs to keep its simple notion of having a single color (property "color") and overriding that was probably not a good idea. Or maybe it is a good idea and there should be no "model_color". Maybe a better design would be that Drawing.single_color is the low level color for the drawing, not to be overridden, and Model.color by default uses single_color but is intended to be overridden and might color subdrawings, and also might compute some average color from subdrawings.

Let me know what you come up with.

Tom

On Apr 15, 2021, at 6:12 PM, Eric Pettersen <pett@…> wrote:

Hi Tom,

When you were speculating about how to undo single-coloring of models, apparently you'd gotten that you'd already implemented a scheme for it. The Model.color_undo_state property is used to get/set the coloring of a model. At least, that's what _set_model_colors() in std_commands/color.py (written by you) is using it for. Seems like we should just keep using that (and probably implement it for more models -- like Structures!).

--Eric

Change History (0)

Note: See TracTickets for help on using tickets.