bpatcher scripting bug


    Sep 14 2006 | 5:46 am
    Whenever I script an object within a bpatcher, it will be positioned relative to the main patcher, which renders scripting of visible objects useless within a bpatcher.
    I wanted to move a slider two pixels to the right, and it was moved way out of sight.
    steps to reproduce: load the below patcher into a bpatcher and place it more to the right...
    click the script, watch the slider disapear.
    expected result: move according to the internal coordinates of the bpatcher as it does with normal patchers...
    possible workaround: If there would be a way to get the information about the properties (position and size) of a bpatcher into the bpatcher, I could patch around that problem.
    Max 4.6.1, OS X 10.4.7, Powerbook 12" PPC
    -- Stefan Tiedje------------x------- --_____-----------|-------------- --(_|_ ----|-----|-----()------- -- _|_)----|-----()-------------- ----------()--------www.ccmix.com

    • Sep 14 2006 | 6:08 am
      This is pretty standard fair. just about all of the coordinates and scrolling is done relative to the main patcher. I think its a tad counter intuitive but its been discussed before. obviously the work around is to get and use the top/left coordinates of the bpatcher.
      if your not in js jasch's posit object should do the trick
      other than that, I give the floor to a more senior maxman -matt
    • Sep 14 2006 | 6:35 am
      matthew aidekman wrote: > if your not in js jasch's posit object should do the trick
      Thanks to the pointer. If somedy has a js solution to get the coordinates of a bpatcher, that would be great as well...
      For the relative moving its actually not a problem as I found the offset scripting command. The other workaround is to place all potential objects in there and delete those which are not needed. Thats what I do now...
      Stefan
      -- Stefan Tiedje------------x------- --_____-----------|-------------- --(_|_ ----|-----|-----()------- -- _|_)----|-----()-------------- ----------()--------www.ccmix.com
    • Sep 14 2006 | 9:08 am
      put this into a javascript inside your bpatcher (it works for subpatchers in general).
      this.patcher.box.rect
      hth
      /*j
      >> if your not in js jasch's posit object should do the trick > > Thanks to the pointer. If somedy has a js solution to get the > coordinates of a bpatcher, that would be great as well...
      /////////////////////////////
      save as get_bpatchercoords.js
      /////////////////////////////
      /* * get the coordinates of the bpatcher box - jasch 20060914 */
      function bang() { outlet(0, this.patcher.box.rect); }
      /////////////////////////////
      save as whatever
      /////////////////////////////
      /////////////////////////////
      save as bpatchercoords_sub.mxb
      /////////////////////////////
    • Sep 14 2006 | 10:04 am
      /*j wrote: > put this into a javascript inside your bpatcher (it works for > subpatchers in general). > > this.patcher.box.rect
      Thanks a lot, much simpler than I thought...
      Stefan
      -- Stefan Tiedje------------x------- --_____-----------|-------------- --(_|_ ----|-----|-----()------- -- _|_)----|-----()-------------- ----------()--------www.ccmix.com
    • Sep 14 2006 | 4:40 pm
      Stephan - the other method is to use the offsetfrom var, var2 method to thispatcher, and use a hidden named object within the bpatcher to use as your new origin.
      jasch:
      the problem with this solution is that it only gets the box coordinates from within the bpatcher, relative to the bpatcher, as far as Ive seen on my max 4.6.1.
      if I have an ubumenu within the bpatcher, and I want to get its global , absolute coordinates relative to the screen, how do I do it? I cant seem to figure it out ...
      I posted this question recently in the JS forum. Any help?
      BTW, that bpatcher coordinate issue is really really really non- intuitive, and IMO should be fixed. or set as an option in the bpatchers inspector to choose the coordinate system.
      v a d e //
      www.vade.info abstrakt.vade.info
      On Sep 14, 2006, at 6:04 AM, Stefan Tiedje wrote:
      > /*j wrote: >> put this into a javascript inside your bpatcher (it works for >> subpatchers in general). >> this.patcher.box.rect > > Thanks a lot, much simpler than I thought... > > Stefan > > -- > Stefan Tiedje------------x------- > --_____-----------|-------------- > --(_|_ ----|-----|-----()------- > -- _|_)----|-----()-------------- > ----------()--------www.ccmix.com >