Page 1 of 1

Breakpoint HoldX/Y problem

Posted: 10 Dec 2013 18:07
by oldgearguy
Lemur 4.1.2 on iPad 4, Lemur editor 4.1.1 on Windows.

Note - an even easier way to see the issue is to create a breakpoint in a new project, move the points around, and then simply set holdX or holdY to 1 in the behavior tab. The manual says that each breakpoint can be held by using a vector and that does seem to work, but the extra lines on the screen are quite unfortunate.


I have some code that is manipulating breakpoints. I want to move them programatically and not allow the user to move them. I'm using holdX and holdY to accomplish it. However, when I try to use them, weirdness results. I think there's some bug in the logic. I get artifact lines running to the edges as if there's points out there that are being connected. The lines connecting them are not fat/bolded like the breakpoint lines I'm trying to draw and some of the new lines are not showing up.

Basically - has anyone played with Breakpoints holdX, holdY?

Here's the code:

Code: Select all

decl numPts, op, objRect, i, holdEm, clearEm;

  // these 3 lines are figuring out what to display - not relevant to the problem
  currentAlg = floor(selection);
  algCfg = algorithms[currentAlg];  
  bpCfg = brkpoints[currentAlg];  
  
  // get the current number of breakpoints and create a vector of zeros
  numPts = getattribute(Breakpoint, 'nbr');
  clearEm = stretch(0, numPts);

  // get the number of breakpoints in the new configuration and create a vector of ones
  numPts = bpCfg.value[0];
  holdEm = stretch(1, numPts);

  // release the old points so they can move.
  Breakpoint.holdX = clearEm;
  Breakpoint.holdY = clearEm;

  // set the new number of breakpoints and set their x,y values
  setattribute(Breakpoint, 'nbr', numPts);
  Breakpoint.x = subarray(bpCfg.value, 1, numPts);
  Breakpoint.y = subarray(bpCfg.value, 1+numPts, numPts);

  // lock the points from being edited
  Breakpoint.holdX = holdEm;
  Breakpoint.holdY = holdEm;


Re: Breakpoint HoldX/Y problem

Posted: 14 Jan 2014 10:10
by oldgearguy
in case anyone is trying something similar - I ended up coding a simple script that redrew the breakpoints and forgot trying to use Hold. I set it to trigger On Expression, x, any.

I actually coded the trigger expression as (x || y) with the hope that it captured a change to either vector without me having to write 2 separate scripts. Interestingly, it seems to work as expected inside the editor (Windows here) but not on the iPad. If I just code is as x, it behaves as expected, although there is a small possibility that someone can shift a breakpoint such that y changed and x did not.

Re: Breakpoint HoldX/Y problem

Posted: 14 Jan 2014 15:25
by Softcore
Although not officially supported, the old Jazzmutant "Gesture" object can be inserted in any Lemur project. Why? Well because its the only "transparent" object that "blocks" what lies beneath - hence it can be an easy solution for ANY Lemur design that needs objects to be shown but not be edited by the end user. I can upload the "Gesture" object if you want, but again, it is not officially supported and if any problems occur (crashing of Lemur, fire in your house, wife divorcing you) dont blame me. I have used it extensively though and besides the fire in my house, didnt have any other problems.

Re: Breakpoint HoldX/Y problem

Posted: 15 Jan 2014 05:29
by Macciza
Hi
Thin lines get drawn to show that the points are held and in which orientation - x or y .

If you don't want user input than set Attraction to 0 - so Cursors i.e. Fingers have no effect . . .

Cheers
MM

Re: Breakpoint HoldX/Y problem

Posted: 15 Jan 2014 16:09
by Phil999
attraction zero, good idea. Thanks Macciza.

Re: Breakpoint HoldX/Y problem

Posted: 15 Jan 2014 21:57
by oldgearguy
Macciza wrote:Hi
Thin lines get drawn to show that the points are held and in which orientation - x or y .

If you don't want user input than set Attraction to 0 - so Cursors i.e. Fingers have no effect . . .

Cheers
MM
Originally that wasn't working for me because I had changed Physic to "None". Putting it back to interpolate does exactly as you say (and as the manual says...) :shock: