You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
Changing line 480 in phoenix-objects.ts (hitsToBoxes() method) to color: parseInt(hitsParams[0].color) ?? EVENT_DATA_TYPE_COLORS.Hits
solved it for me.
I tried to push this change to a new branch but did not have permission.
Hi @Lysarina - thanks very much for this (and apologies for not having found the time to investigate for myself yet). You should always be able to open a PR - but you need to do this from your own fork. Can you try this?
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.
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.
The text was updated successfully, but these errors were encountered: