Author Topic: Effect Changes on Save  (Read 1223 times)

Offline gotwibble

  • Newbie
  • *
  • Posts: 6
    • View Profile
Effect Changes on Save
« on: August 17, 2016, 07:44:14 AM »
New to xLights and just doing some basic things but I've got a stack of 9 RGB pixels that I want the same 3 layered effects on each just different colors for each pixel.  I've got them setup in xLights and preview and output via DMX dongle looks good.  The problem I have is that I can see the individual nodes patterns are different and it changes everytime I click on an effect, which is fine as I want this to be random for each, but when I save it seems like it redoes the effects and several of the patterns end up coming out with the same pattern. 

I've attached a beforesave and an aftersave picture hopefully showing what I mean.

Am I missing something or is there anything I can do to fix this so they stay random at save?

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Effect Changes on Save
« Reply #1 on: August 17, 2016, 07:51:07 AM »
It would help if you mentioned the effect name you're having a problem with.  My eyes aren't that great and I don't recognize the icon in the photo.

Offline gotwibble

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Effect Changes on Save
« Reply #2 on: August 17, 2016, 08:03:15 AM »
Certinaly.

It's three layered effects,  2 layers of 'Snow Storm' set to layer blend 'Average' with different values (5,2,2 and 10,5,1) and 1 layer of just 'On'

I'm attempting to get a single pixel to flicker like a candle and after reading a bunch I found these three layers gave me the closest to what I was wanting with the different colors.

Apologies for not including an expanded view of the effects for 1 pixel.  Attached now.
« Last Edit: August 17, 2016, 08:06:03 AM by gotwibble »

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Effect Changes on Save
« Reply #3 on: August 17, 2016, 08:23:54 AM »
Ok I haven't used the Snowstorm effect so didn't recognize it.  Every effect is going to be rendered when you save so if the effect's algorithm has a random calculation then yes it's going to change every time you render.  One of us would need to look at the actual code to see how it's seeded.  When you say several of the patterns are coming out the same do you mean several copies of the effect all look the same?

Offline gotwibble

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Effect Changes on Save
« Reply #4 on: August 17, 2016, 08:34:20 AM »
Yep. Of the 9 pixels with this combination effects, 7 of them turned out having the same pattern after saving.

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Effect Changes on Save
« Reply #5 on: August 17, 2016, 08:42:56 AM »
So you need to hit the Render all button to get an idea of what things will look like after saving.  Just clicking around on effects changes render ordering so it gives a false sense of what you will see when saved.

Offline gotwibble

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Effect Changes on Save
« Reply #6 on: August 17, 2016, 08:48:57 AM »
Ahh okay. That makes sense so.  So basically those effects that render the same have the same random seed, probably from me copying and pasting them to the next pixel.  Is there a way to set it to be random for each or would I need to basically delete the current effects and recreate them by dragging the effect back on to the sequencer?
« Last Edit: August 17, 2016, 08:58:48 AM by gotwibble »

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Effect Changes on Save
« Reply #7 on: August 17, 2016, 11:09:07 AM »
I'd have to play around and investigate.  It appears to use a built-in rand() function so I don't see us providing any type of seed.  Not sure if that's an option I assumed that function would be well somewhat random on its own.

Offline gotwibble

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Effect Changes on Save
« Reply #8 on: August 17, 2016, 12:12:09 PM »
I tried removing the effects and re-adding them, while it's a different pattern the 3 pixels I tested it on, when rendered, all turned to the same pattern. 

Is it because I'm setting the parameters for SnowStorm to be the same that it is why they are rendering the same?  Should it be different even when the parameters are set the same? 

Still odd that of the 9, 2 of them with parameters the same as the rest would come out different, even different then each other (which is what I'd want).

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Effect Changes on Save
« Reply #9 on: August 17, 2016, 12:18:11 PM »
Here browse the code and look for "rand".  You can see what alters the effect.

https://github.com/smeighan/xLights/blob/master/xLights/effects/SnowstormEffect.cpp

Offline gotwibble

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Effect Changes on Save
« Reply #10 on: August 17, 2016, 01:04:38 PM »
Thanks Gilrock.  Not much of a coder but saw some things that maybe pointed to it being tied to the the length of the effect.  Changing the length of the effect and adding multiples to fill out the length seems to have done the trick.

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Effect Changes on Save
« Reply #11 on: August 17, 2016, 01:17:13 PM »
Yeah and it seemed like speed has a random affect on it.