-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot set box hit color from JSON #664
Comments
Changing line 480 in phoenix-objects.ts (hitsToBoxes() method) to |
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? |
Fix for Cannot set box hit color from JSON #664
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: