Skip to content

Cannot set box hit color from JSON #664

@Lysarina

Description

@Lysarina

Currently, setting a color for a hit object of type box in a JSON event file does not work. For example, here the color attribute is set to 0xff00ff (fuchsia) for all hits in the collection ecalClusters, but the boxes still appear red. This seems to only be a problem with box hits, as setting e.g. point hits and tracks to the same color works just fine.
image
Attached is the JSON file in question.
clusters copy.json
It is possible to change the hit color in the Phoenix menu, so it is possible for boxes to have a different color, just not from a JSON file.
I have tried loading in the JSON file in my own Phoenix setup, in the Phoenix playground, as well as from the locally run yarn project pulled from the Phoenix GitHub, and the result is the same in all cases.
I looked around in the Phoenix code, and the issue seems to be in /phoenix/packages/phoenix-event-display/src/loaders/objects/phoenix-objects.ts, where box type hits are loaded in hitsToBoxes(); the color is not parsed correctly when creating the MeshPhongMaterial object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions