realtime-CSG-for-unity icon indicating copy to clipboard operation
realtime-CSG-for-unity copied to clipboard

Applying material via drag-and-drop selects wrong surface

Open code-monkey-101 opened this issue 3 years ago • 4 comments

When you drag a material onto a surface, it seems to pick a different surface along the ray for every frame. So it's very hard to apply the material to the correct surface.

https://user-images.githubusercontent.com/32152103/155893393-f257285c-bd30-4779-a04f-70fce21d9173.mp4

code-monkey-101 avatar Feb 27 '22 17:02 code-monkey-101

Note to whomever fixes this; this probably has same or similar root issue as #331

LogicalError avatar Mar 07 '22 09:03 LogicalError

Unable to replicate on 2019, 2021. @killerlegs could you share your unity version / realtimeCSG version, and if possible a scene that replicates this issue? Have a feeling it is something geo or material specific, or some exact steps I missed.

n.b. it reminds me of behaviour I saw before the imminent crash in this issue https://github.com/LogicalError/realtime-CSG-for-unity/issues/314

alexjhetherington avatar Apr 22 '22 15:04 alexjhetherington

I have been able to reproduce (a similar issue) across multiple versions. When dragging a material from the project browser into the scene view, a ray is indeed casted every frame. This causes the model to invalidate, marking the scene dirty even if no changes were made. It is more noticeable if you have a scene with baked lighting of any kind (both realtime GI and baked). Having a ray only be cast when the mouse button is lifted (or alternatively only highlighting the surface) would probably work better here and avoid the issues mentioned.

nukeandbeans avatar Apr 25 '22 23:04 nukeandbeans

As a side note, testing this, the undo stack get spammed with new undo states on a per-frame basis when dragging over surfaces.

nukeandbeans avatar Apr 26 '22 00:04 nukeandbeans