Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#8995 closed enhancement (fixed)

Remove vertex colors when saving gltf of single color objects

Reported by: kristen.browne@… Owned by: Tom Goddard
Priority: normal Milestone:
Component: Input/Output Version:
Keywords: Cc: Elaine Meng, pett
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

All  "monochrome" and the "volume" presets are intended to represent "no color".  Blue was a stylistic decision that was made in 3DPX.  The small molecules are all being output with vertex color, while the surface models are coming out with a material applied.  We would prefer that the monochrome outputs had a consistent method of coloration, and the preferred method would be to not use vertex color.  Vertex color isn't visible in the viewport nor renderable by default in many commercial 3D packages, including Blender, and can therefore create some unexpected results for the naïve user.

Please let us know if this is doable or we can make the adjustments on our end when processing the files into other formats.

Thanks!

Kristen


Kristen Browne, MSc, MscBMC
Contractor - MSC, Inc. | A Guidehouse Company
3D Modeling and Biovisualization Specialist
Bioinformatics and Computational Biosciences Branch (BCBB)<https://www.niaid.nih.gov/research/bioinformatics-computational-biosciences-branch>
OCICB/OSMO/OD/NIAID/NIH

5601 Fishers Lane, Room 4A60
Rockville, MD 20852
Office 202-253-5228


Change History (5)

comment:1 by pett, 2 years ago

Cc: Tom Goddard added
Component: UnassignedInput/Output
Owner: set to pett
Platform: all
Project: ChimeraX
Status: newaccepted

comment:2 by Tom Goddard, 2 years ago

I think atoms and bonds use per-vertex colors in GLTF output because they are instanced objects (spheres and cylinders), and also ribbons use per-vertex colors always. But surfaces use a single color or per-vertex colors depending on whether the surface was multi-colored or not. The GLTF save code can probably be improved so that if these objects are one color then a single material color is used instead of vertex colors.

comment:3 by Tom Goddard, 2 years ago

Cc: Elaine Meng pett added; Tom Goddard removed
Owner: changed from pett to Tom Goddard
Status: acceptedassigned
Summary: Consistent usage of materials vs vertex color in no-color outputs from presetsRemove vertex colors when saving gltf of single color objects
Type: defectenhancement

Fixed.

I made saving GLTF remove vertex colors from all objects that are a single color. Instead it uses just the material color. This reduces the use of vertex colors in gltf files which many gltf viewers cannot handle.

In the rare case that you would like to preserve vertex colors in the saved gltf for single color objects use the new save gltf option "pruneVertexColors false".

comment:4 by Tom Goddard, 2 years ago

Resolution: fixed
Status: assignedclosed

comment:5 by Tom Goddard, 2 years ago

Specifically if all ribbon residues of a structure are the same color then the ribbons object in the gltf will not have vertex colors. Likewise if all atoms of a structure are the same color then the atoms object will have no vertex colors.
And if all bonds of the same structure are the same color then the bonds object will not have vertex colors. This rule applies to any object including surfaces, and volumes, or any geometry where the vertices may have vertex colors.

Note: See TracTickets for help on using tickets.