Author Topic: Horizontal matrix - Superstar import - Rotated  (Read 2613 times)

Offline caffeine

  • Newbie
  • *
  • Posts: 6
    • View Profile
Horizontal matrix - Superstar import - Rotated
« on: December 09, 2015, 01:58:39 AM »
So... trying to move out of LOR fully into xlights but need to get some of my old work :-)

I have a 14x50 horizontal matrix in Superstar.  I can import that onto my 14-50 horizontal matrix in Xlights BUT things are sideways.  Not everything mind you, some sections that were full on one colour have changed to full colour washes but images are sideways (can be rotated to fix in the image directory) and the centres for shockwaves are back to front (x and y percentage conversion reversed).  Likewise the morphs go the wrong way, although seem to have elongated to still fill each side.

I've tried all four combinations of x and y 14 versus 50 and flip checkbox ticked/unticked with the same result.

Is there any solution to this?  I could probably write a script to modify the superstar file to rotate it so that when xlights rotates it it ends up the right way but that seems convoluted.

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Horizontal matrix - Superstar import - Rotated
« Reply #1 on: December 09, 2015, 07:37:47 AM »
The code is pulling the values listed in the sup file for X and Y and mapping them to X and Y.  So if its rotated then either Superstar isn't outputting the values to the correct parameters or your model is defined wrong in xLights.  The Flip only flips the Y values so it's a vertical flip.

Offline caffeine

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Horizontal matrix - Superstar import - Rotated
« Reply #2 on: December 09, 2015, 08:13:27 AM »
The code is pulling the values listed in the sup file for X and Y and mapping them to X and Y.  So if its rotated then either Superstar isn't outputting the values to the correct parameters or your model is defined wrong in xLights.  The Flip only flips the Y values so it's a vertical flip.

Ah... so that's the problem.  XLights and your utility is being logical.  Superstar is not.

For a 14 x 50 grid, CCR's selected for convenience, you get the following in Superstar positioning:

Horizontal
Top Left x=13 y=0
Bottom Left x=0 y=0
Top Right x=13 y=49
Bottom Right x=0 y=49

Vertical

Top Left x=0 y=0
Bottom Left x=0 y=49
Top Right x=13 y=0
Bottom Right x=13 y=49

So just as we have the weirdness that in a vertical arrangement the Y position is descending when it's horizontal then X becomes the vertical ascending upwards and y is the horizontal ascending left to right.

So you are indeed taking X and Y as they are in the sup file, they just don't mean what you think they mean when you see ribbonOrientation="horizontal" in the layout tag.

I dealt with this when I wrote a quick utility for increasing/decreasing string count a year or two ago... I might dig out that code.

Simple enough for me for now to write a two second parser for the SUP file to switch x/y (and off the top of my head I'll probably also need to reverse one of them).

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Horizontal matrix - Superstar import - Rotated
« Reply #3 on: December 09, 2015, 08:36:02 AM »
Well you know how coding goes I make things work as the problems are encountered.  Almost everyone using the import including me was bringing in megatree data so we didn't see this.  I'm probably not even looking at the ribbonOrientation since we didn't run into this issue during development.  I do look at the controller position attribute to determine whether to do the Y flip which probably becomes an X flip for horizontal.

Offline caffeine

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Horizontal matrix - Superstar import - Rotated
« Reply #4 on: December 09, 2015, 08:47:14 AM »
Well you know how coding goes I make things work as the problems are encountered.  Almost everyone using the import including me was bringing in megatree data so we didn't see this.  I'm probably not even looking at the ribbonOrientation since we didn't run into this issue during development.  I do look at the controller position attribute to determine whether to do the Y flip which probably becomes an X flip for horizontal.

Yup!  Last time I played with SUP file manipulation each new test showed one more weirdness in the xml.  I think this one might simply be for easier channel mapping in LOR, i.e. x/y follows strings rather than directionality.

I'll post here a tool to flip stuff tomorrow in case others have the same issue.  I'll also see if I can lend a hand on the dev side next year.  Hopefully the conversions will be a dying breed, mostly getting hard work out, new stuff will be done directly in xlights thanks to your new features.  Still a bit to get used to but your work is the final piece that has allowed me to exit LOR.

Thanks mate.

Offline ValentinoRx

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Horizontal matrix - Superstar import - Rotated
« Reply #5 on: June 03, 2016, 04:31:22 AM »
I do not know coding at all. Did this go any further? I am looking to flip some images. Not the whole file. Thanks


Sent from my iPhone using Tapatalk

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Horizontal matrix - Superstar import - Rotated
« Reply #6 on: June 03, 2016, 02:10:59 PM »
If that's all you need just import them and then flip em.