[LDCad] Detecting current editing plane using API? - Printable Version +- LDraw.org Discussion Forums (https://forums.ldraw.org) +-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html) +--- Forum: LDraw Editors and Viewers (https://forums.ldraw.org/forum-11.html) +--- Thread: [LDCad] Detecting current editing plane using API? (/thread-25802.html) |
Detecting current editing plane using API? - David Manley - 2021-12-28 Hi Roland, is there an API call which returns the current editing plane? Something which perhaps returns a value of 1, 2 or 3? By way of an example, when ctrl+R is pressed to open the Manual Rotation dialog, it knows the current editing plane to apply the rotation to. I'm wanting to modify the part alignment scripts to work based on the current rotation plane rather than making the user identify the X, Y or Z plane to be rotated around. If an API call isn't available, can you guide me in the direction of a possible approach to try? Thanks and regards, David RE: Detecting current editing plane using API? - Roland Melkert - 2021-12-29 (2021-12-28, 2:44)David Manley Wrote: is there an API call which returns the current editing plane? Something which perhaps returns a value of 1, 2 or 3? Not at the moment, but I will add it to the ldc.view object (along with some other things found in the compass). You could calculate it yourself by using the current camera orientation if you really need it right now. RE: Detecting current editing plane using API? - David Manley - 2021-12-30 (2021-12-29, 20:16)Roland Melkert Wrote: You could calculate it yourself by using the current camera orientation if you really need it right now. Thank you. From some preliminary script fiddling, presumably just based just on the Tilt and Yaw values, with the toggle point being at the +/- 45 degree angle and +/-135 degree angle. The Roll doesn't appear to influence the current editing plane. Is this interpretation along the correct lines? David RE: Detecting current editing plane using API? - Roland Melkert - 2021-12-30 (2021-12-30, 8:17)David Manley Wrote: From some preliminary script fiddling, presumably just based just on the Tilt and Yaw values, with the toggle point being at the +/- 45 degree angle and +/-135 degree angle. The Roll doesn't appear to influence the current editing plane. Is this interpretation along the correct lines? Seems ok, in case you want the exact same value here's the relevant LDCad source: Code: void TEditWindowSession::applyAutoEditPlane() { It basically does the same but it applies a 'dead-zone' so it won't jump around too match. |