1. New to Christmas lighting? Get started with the AusChristmasLighting 101 Manual:
    auschristmaslighting.com/wiki/AusChristmasLighting-101

Nutcracker: Snowflakes, bug fix and enhancement

Discussion in 'xLights (Nutcracker)' started by smeighan, Nov 10, 2012.

  1. smeighan

    smeighan Dedicated Elf

    Joined:
    Jan 19, 2012
    Messages:
    1,066
    Likes Received:
    9
    Location:
    4217 Greenfinch Dr CO 80126
    Snowflakes has never worked they way i imagined it when i wrote it 6 months ago.


    so, i rewrote it to get it closer to what i wanted and to fix some errors it was having.


    Bug fix: no longer causes errors when generating effect
    Enhancement:
    1) Faster to generate
    2) he number of frames of animation is equal to (sequence duration)/fame_timing
    so if you have 50ms frame timng and a 11 sec duration sequence you will have 220 frames of animation.
    3) 7 New prompts
    color1 (was start_color)
    color2 (was end_color)
    speed (i think values around ..3 to .8 are prob better)
    background_color (if and rgb value is ever zero, substitute with this value)
    snowflake_type (0-6. discussed below)
    colour_model (1,2. discussed below)
    number_snowflakes (How many snowflakes are originally drawn).






    snowflakes Effect Settings
    username f
    user_target A
    effect_class snowflakes
    submit Submit Form to create your effect
    effect_name SNOWFLAKE_DEMO1
    window_degrees 180
    color1 #08FFAD
    color2 #0011FF
    frame_delay 100
    sparkles 0
    speed 0.5
    background_color #000000
    snowflake_type 2
    number_snowflakes 30
    colour_model 1
    seq_duration 7
    fade_in 0
    fade_out 0
    OBJECT_NAME snowflakes
    batch 0
    show_frame N


    So , let's discuss these.
    First i changed the start_color, end_color to now be called color1, color2,. These colors are used differently than before.


    There are two color models:
    color_model #1:
    color1 is the center dot of your snowflake. color2 is the color that wraps around the center.


    here is an example
    [​IMG]


    color model #2:
    we start with color1 and then end with color2. if you have 10 snowflakes, the 1st snowflake will be color1, the 10th snowflake color2. the other 8 will be spread across the hue spectrum between the two colors.
    here is an example using everything the same as above, but selecting color_model = 2:
    [​IMG]


    There are 6 types of snowflakes, this is set with snowflake_type:
    type 1: a single pixel. this probably can look just like light snow
    type 2: a single pixel surrounded by 4 additional pixels.
    type 3: a 3 pixel vertical or 3 pixel horizontal snowflake. they are randomly picle vert or horiz.
    type 4: a single pixel surrounded by 8 additional pixels.
    type 5: a single pixel surrounded by 20 additional pixels.
    type 6: a single pixel surrounded by 44 additional pixels.


    types 2,4,5,6 create large and larger snowflakes, you need a big enough target model for the larger numbers.
    Type 0: is a special case that will randomly select all of the above.


    So here is an example of snowflake_type 5
    snowflakes Effect Settings
    username f
    user_target A
    effect_class snowflakes
    effect_name SNOWFLAKE_DEMO3
    window_degrees 180
    color1 #08FFAD
    color2 #0011FF
    frame_delay 100
    sparkles 0
    speed 0.5
    background_color #000000
    snowflake_type 5
    number_snowflakes 10
    colour_model 1
    seq_duration 7
    fade_in 0
    fade_out 0
    submit Submit Form to create your effect
    OBJECT_NAME snowflakes
    batch 0
    show_frame N
    [​IMG]






    New option background color, now works as expected. It will set your background color whenever it finds an rgb value of zero.
    snowflakes Effect Settings
    username f
    user_target A
    effect_class snowflakes
    submit Submit Form to create your effect
    effect_name SNOWFLAKE_DEMO4
    window_degrees 180
    color1 #FFFFFF
    color2 #8AFFE0
    frame_delay 100
    sparkles 0
    speed 0.5
    background_color #000CB3
    snowflake_type 2
    number_snowflakes 25
    colour_model 1
    seq_duration 7
    fade_in 0
    fade_out 0
    OBJECT_NAME snowflakes
    batch 0
    show_frame N


    [​IMG]




    Enjoy!


    I will go over this effect in tonights tutorial at 7pm MST


    thanks
    sean
     

Share This Page