It is currently May 8th, 2024, 10:52 pm

help with animation - i'm new here

Get help with creating, editing & fixing problems with skins
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: help with animation - i'm new here

Post by LuciferVisuals »

balala wrote: April 24th, 2023, 8:04 pm Sorry, but looking to the skin of your package I still can't realize what does this mean:


No, I don't see it. What the "stable event horizon" does mean?

Doesn't matter, try it when you get time.
Right load the ini file, big round circle on screen nothing in it. play with the two big square buttons, one should open the "Stargate" a whoosh should happen then a rippling pool of water,

Push one button to turn on, that button goes and a new one appears, push that and the wormhole(both effects) closes. But not working right. So push one and wait, pool happens first wait and watch then the Whoosh, which should happen just b4 the wormhole stabilised (You must have seen stargate? If not see a you tube clip). That's what we are after.

Have I explained that sdo you can see the issue?

Keith
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: help with animation - i'm new here

Post by LuciferVisuals »

balala wrote: April 24th, 2023, 8:04 pm Sorry, but looking to the skin of your package I still can't realize what does this mean:


No, I don't see it. What the "stable event horizon" does mean?

Doesn't matter, try it when you get time.
Well I found the cause of all the errors

[measureWhooshFrameCalc]
measure=Calc
formula=counter % 45
substitute=".00000":""
disabled=0
dynamicVariables=1

This part is counting up 45 to 100, But there are only 45 images, I wanted to to count up to all files fro 0 to 45..... This appears to work with my other pool animation, which has 100 images and the calc goes from 0 to 100. ???

What do I need to do to the above to correct it to show 0 - 45 images please.

Then back to the timing issue, that I contacted you about.

Thanks for your patience and time. Assuming you actually got the images running, they are pretty cool, even if they are not behaving as I wish.

Keith
User avatar
SilverAzide
Rainmeter Sage
Posts: 2620
Joined: March 23rd, 2015, 5:26 pm

Re: help with animation - i'm new here

Post by SilverAzide »

LuciferVisuals wrote: April 24th, 2023, 8:56 pm But there are only 45 images, I wanted to to count up to all files fro 0 to 45.....
Erm... 0 to 45 would be 46 images. So which is it? If there's actually 46, then change your modulo to 46. If there's actually 45 images, then you'll need to decide whether to count from 0 to 44 or 1 to 45, and adjust the formula accordingly. Also, that Substitute isn't going to do anything since with modulus math the formula should only return integers.
Gadgets Wiki GitHub More Gadgets...
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: help with animation - i'm new here

Post by LuciferVisuals »

SilverAzide wrote: April 24th, 2023, 9:09 pm Erm... 0 to 45 would be 46 images. So which is it? If there's actually 46, then change your modulo to 46. If there's actually 45 images, then you'll need to decide whether to count from 0 to 44 or 1 to 45, and adjust the formula accordingly. Also, that Substitute isn't going to do anything since with modulus math the formula should only return integers.
Sorry yes you are right it's 0 - 44 giving 45 images (I was tired by the time I wrote this). The good news is I have just fixed that.... There were (stil are 45 Images, but the error counter was counting upwards from 45, as opposed to 0 to 45. But I have fixed it. Thank you for your input, the actual mistake was I am using two animated images. Having got the first working perfectly I cut and pasted the code then inserted the new image details etc for the second animation, I forgot to tell it to use the second calc, so it was using the calc one from the first animation the penny dropped as it was working but giving errors from image 46 to 100, the first animation is dif but has 100 images in it.

Thank you for your time. Sorry for my mistake on the numbers

Keith
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: help with animation - i'm new here

Post by LuciferVisuals »

balala wrote: April 24th, 2023, 2:22 pm It probably might be done even using the Counter formula, but this is a little bit harder. Instead I'd do this in a different mode.
For instance related to the [meterBackgroundFrame] meter and its related [measurebackgroundFrameCalc] measure, here are two different solutions:
  • Replace the [measurebackgroundFrameCalc] measure with the following one:

    Code: Select all

    [measurebackgroundFrameCalc]
    Measure=Calc
    Formula=(( measurebackgroundFrameCalc + 1 ) % 100 )
    IfCondition=(#CURRENTSECTION#=99)
    IfTrueAction=[!DisableMeasure "#CURRENTSECTION#"]
    The IfCondition and its IfTrueAction option are disabling the measure when it reaches its largest possible value (in this case 99).
  • Another way to do the same, is to use a Loop measure. For instance:

    Code: Select all

    [measurebackgroundFrameCalc]
    Measure=Loop
    StartValue=0
    EndValue=99
    Increment=1
    LoopCount=1
    The option which sets how many time the loop is executed is LoopCount. If this is set to 1 (as above), the increment of the measure is executed only once. At the end it is not disabled, however it doesn't count anymore.
There is a big difference between the above two measures: the first one is disabled at the end of the increment, its final value is 0. Since the second measure is not disabled (as explained above), its final value is kept to 99.

To be honest have no idea what does this mean. What it does?
Still Have not tried them BUT Replace the second animation code with this code, which fixes all those errors, and makes it run better.

Code: Select all

[meterWhooshFrame]
meter=Image
ImageTint=255,255,255,200
x=170
y=180
w=600
h=600
ImageName="#@#Whoosh\Whoosh[measureWhooshFrameCalc].png"
DynamicVariables=1
Hidden=1
It was still using the Calc from the background animation

So now I JUST NEED IT TO STOP AFTER one full loop.

Keith







calc
Last edited by balala on April 25th, 2023, 7:10 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are posting codes. It's the </> button.
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: help with animation - i'm new here

Post by LuciferVisuals »

SilverAzide wrote: April 24th, 2023, 9:09 pm Erm... 0 to 45 would be 46 images. So which is it? If there's actually 46, then change your modulo to 46. If there's actually 45 images, then you'll need to decide whether to count from 0 to 44 or 1 to 45, and adjust the formula accordingly. Also, that Substitute isn't going to do anything since with modulus math the formula should only return integers.
Hi again, sorry I was doing three conversations at the same time, and my head is spinning, I'm new to this. Right basically the relevant code I'm using is below, now working perfectly (I'll try it without the substitute later) already spent a few more hours than intended tonight TBH.

Code: Select all

[measureWhooshFrameCalc]
 measure=Calc
 formula=counter % 45
 substitute=".00000":""
 disabled=0
 dynamicVariables=1

[meterWhooshFrame]
meter=Image
ImageTint=255,255,255,200
x=170
y=180
w=600
h=600
ImageName="#@#Whoosh\Whoosh[measureWhooshFrameCalc].png"
DynamicVariables=1
Hidden=1
Given the above code, all I wish to do is make the Whoosh animation play once, instead of endlessly looping, any easy beginner fix I can do to this please.

Keith
Last edited by balala on April 25th, 2023, 3:00 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are posting codes. It's the </> button.
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: help with animation - i'm new here

Post by LuciferVisuals »

balala wrote: April 24th, 2023, 2:22 pm It probably might be done even using the Counter formula, but this is a little bit harder. Instead I'd do this in a different mode.
For instance related to the [meterBackgroundFrame] meter and its related [measurebackgroundFrameCalc] measure, here are two different solutions:
  • Replace the [measurebackgroundFrameCalc] measure with the following one:

    Code: Select all

    [measurebackgroundFrameCalc]
    Measure=Calc
    Formula=(( measurebackgroundFrameCalc + 1 ) % 100 )
    IfCondition=(#CURRENTSECTION#=99)
    IfTrueAction=[!DisableMeasure "#CURRENTSECTION#"]
    The IfCondition and its IfTrueAction option are disabling the measure when it reaches its largest possible value (in this case 99).
  • Another way to do the same, is to use a Loop measure. For instance:

    Code: Select all

    [measurebackgroundFrameCalc]
    Measure=Loop
    StartValue=0
    EndValue=99
    Increment=1
    LoopCount=1
    The option which sets how many time the loop is executed is LoopCount. If this is set to 1 (as above), the increment of the measure is executed only once. At the end it is not disabled, however it doesn't count anymore.
There is a big difference between the above two measures: the first one is disabled at the end of the increment, its final value is 0. Since the second measure is not disabled (as explained above), its final value is kept to 99.

To be honest have no idea what does this mean. What it does?
I just tried the second solution it appeared simple, and worked first time except the animation froze on the last frame, si I fixed that by adding another empty frame to the animation, si all appears perfect now.


Thank you again for your time an help.

Can you see what it does yet. ?

keith
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: help with animation - i'm new here

Post by LuciferVisuals »

balala wrote: April 24th, 2023, 5:54 pm Do it please, obviously.
OK Still not perfect.

It works exactly as needed, the buttons open and close the stargate exactly as they should ONCE, if you close the stargate, then open it again, the second time there is no Whoosh effect (the second animation). So that needs to be updated in some way when the stargate is closed, so it is reset, ready to count down again if the gate is reopened, the Whoosh happens again.

So I need the Whosh to happen once only (as opposed to looping, which it now does perfectly) but I need it to do it every time the gate is opened.

So this is where we are up to At the moment.

Code: Select all

[measureWhooshFrameCalc]
Measure=Loop
StartValue=0
EndValue=45
Increment=1
LoopCount=1

[meterWhooshFrame]
meter=Image
ImageTint=255,255,255,200
x=170
y=180
w=600
h=600
ImageName="#@#Whoosh\Whoosh[measureWhooshFrameCalc].png"
DynamicVariables=1
Hidden=1
Keith
Last edited by balala on April 25th, 2023, 3:00 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are posting codes. It's the </> button.
User avatar
balala
Rainmeter Sage
Posts: 16206
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: help with animation - i'm new here

Post by balala »

LuciferVisuals wrote: April 24th, 2023, 10:26 pm It works exactly as needed, the buttons open and close the stargate exactly as they should ONCE, if you close the stargate, then open it again, the second time there is no Whoosh effect (the second animation). So that needs to be updated in some way when the stargate is closed, so it is reset, ready to count down again if the gate is reopened, the Whoosh happens again.

So I need the Whosh to happen once only (as opposed to looping, which it now does perfectly) but I need it to do it every time the gate is opened.
Try the following:
  • In the last code I had, the [measureWhooshFrameCalc] measure was still a Calc measure, using the formula=counter % 45 option. Accordingly it counts from 0 to 44 (the largest value is one less than the number used into the modulo operation). This should have to be replaced by a Loop measure. Replace it with the following one:

    Code: Select all

    [measureWhooshFrameCalc]
    Measure=Loop
    StartValue=0
    EndValue=45
    Increment=1
    LoopCount=0
    IfCondition=(#CURRENTSECTION#>=44)
    IfTrueAction=[!DisableMeasure "#CURRENTSECTION#"][!HideMeter "meterWhooshFrame"][!Redraw]
    Disabled=1
    In this code, as you can see:
    • The LoopCount option is set to 0 (which means endless repeat)
    • A Disabled=1 option has been added, to get the measure disabled when you refresh the skin. This is needed because the effect is not visible, you have to click the [Gate-Active] meter to get the animation started. Accordingly the measure has to be disabled at the beginning.
    • The IfCondition option (and its according IfTrueAction), disables the measure when it reaches a value equal to 44. This is needed not to let the measure to endlessly count and to hide the [meterWhooshFrame] meter when the animation ends.
  • Beside these, you have to add some bangs to the ButtonCommand options of the [Gate-Idle] and [Gate-Active] meter, to get the [measureWhooshFrameCalc] measure disabled when you click the [Gate-Idle] meter and reenabled when clicking the [Gate-Active] meter:

    Code: Select all

    [Gate-Idle]
    Meter=Button
    ButtonImage=#@#Buttons\Action-1.png
    x=100
    y=100
    w=500
    h=500
    ButtonCommand=[!DisableMeasure "measureWhooshFrameCalc"][!RainmeterHideMeter Gate-Idle][!RainmeterHideMeter OsirisR][!RainmeterHideMeter MeterWhooshFrame][!RainmeterHideMeter meterBackgroundFrame][!RainmeterShowMeter Gate-Active] 
    Hidden=1
    
    [Gate-Active]
    Meter=Button
    ButtonImage=#@#Buttons\Action-2.png
    x=700
    y=100
    w=500
    h=500
    ButtonCommand=[!EnableMeasure "measureWhooshFrameCalc"][!RainmeterHideMeter Gate-Active][!RainmetershowMeter OsirisR][!RainmetershowMeter MeterWhooshFrame] [!RainmeterShowMeter meterBackgroundFrame] [!RainmeterShowMeter Gate-Idle] 
This is all, I think. Please try the above things and let me know if it works.

However note a few more things:
  • The !Rainmeter... bang prefix has been deprecated many - many years ago and accordingly it shouldn't be used. Recommend to remove all these prefixes. For instance the [!RainmeterHideMeter Gate-Idle] bang of the ButtonCommand option of the [Gate-Idle] meter following the above added [!DisableMeasure "measureWhooshFrameCalc"] bang should be [!HideMeter Gate-Idle] (or even better [!HideMeter "Gate-Idle"], however the quotes are not mandatory, but is a good idea to get used to use them).
  • The whoosh animation (the [meterWhooshFrame] meter) originally had been related to the [measureBackgroundFrameCalc] measure (through its ImageName="#@#Whoosh.\Whoosh[measureBackgroundFrameCalc].png"), however it should be related to the [measureWhooshFrameCalc] measure. This is why you have to replace the ImageName option of this meter with ImageName=#@#Whoosh\Whoosh[measureWhooshFrameCalc].png. I also removed here the not-needed quotes. This removes a lot of error messages in the log as well.
User avatar
LuciferVisuals
Posts: 226
Joined: April 11th, 2023, 7:04 pm

Re: help with animation - i'm new here

Post by LuciferVisuals »

balala wrote: April 25th, 2023, 7:07 pm Try the following:
  • In the last code I had, the [measureWhooshFrameCalc] measure was still a Calc measure, using the formula=counter % 45 option. Accordingly it counts from 0 to 44 (the largest value is one less than the number used into the modulo operation). This should have to be replaced by a Loop measure. Replace it with the following one:

    Code: Select all

    [measureWhooshFrameCalc]
    Measure=Loop
    StartValue=0
    EndValue=45
    Increment=1
    LoopCount=0
    IfCondition=(#CURRENTSECTION#>=44)
    IfTrueAction=[!DisableMeasure "#CURRENTSECTION#"][!HideMeter "meterWhooshFrame"][!Redraw]
    Disabled=1
    In this code, as you can see:
    • The LoopCount option is set to 0 (which means endless repeat)
    • A Disabled=1 option has been added, to get the measure disabled when you refresh the skin. This is needed because the effect is not visible, you have to click the [Gate-Active] meter to get the animation started. Accordingly the measure has to be disabled at the beginning.
    • The IfCondition option (and its according IfTrueAction), disables the measure when it reaches a value equal to 44. This is needed not to let the measure to endlessly count and to hide the [meterWhooshFrame] meter when the animation ends.
  • Beside these, you have to add some bangs to the ButtonCommand options of the [Gate-Idle] and [Gate-Active] meter, to get the [measureWhooshFrameCalc] measure disabled when you click the [Gate-Idle] meter and reenabled when clicking the [Gate-Active] meter:

    Code: Select all

    [Gate-Idle]
    Meter=Button
    ButtonImage=#@#Buttons\Action-1.png
    x=100
    y=100
    w=500
    h=500
    ButtonCommand=[!DisableMeasure "measureWhooshFrameCalc"][!RainmeterHideMeter Gate-Idle][!RainmeterHideMeter OsirisR][!RainmeterHideMeter MeterWhooshFrame][!RainmeterHideMeter meterBackgroundFrame][!RainmeterShowMeter Gate-Active] 
    Hidden=1
    
    [Gate-Active]
    Meter=Button
    ButtonImage=#@#Buttons\Action-2.png
    x=700
    y=100
    w=500
    h=500
    ButtonCommand=[!EnableMeasure "measureWhooshFrameCalc"][!RainmeterHideMeter Gate-Active][!RainmetershowMeter OsirisR][!RainmetershowMeter MeterWhooshFrame] [!RainmeterShowMeter meterBackgroundFrame] [!RainmeterShowMeter Gate-Idle] 
This is all, I think. Please try the above things and let me know if it works.

However note a few more things:
  • The !Rainmeter... bang prefix has been deprecated many - many years ago and accordingly it shouldn't be used. Recommend to remove all these prefixes. For instance the [!RainmeterHideMeter Gate-Idle] bang of the ButtonCommand option of the [Gate-Idle] meter following the above added [!DisableMeasure "measureWhooshFrameCalc"] bang should be [!HideMeter Gate-Idle] (or even better [!HideMeter "Gate-Idle"], however the quotes are not mandatory, but is a good idea to get used to use them).
  • The whoosh animation (the [meterWhooshFrame] meter) originally had been related to the [measureBackgroundFrameCalc] measure (through its ImageName="#@#Whoosh.\Whoosh[measureBackgroundFrameCalc].png"), however it should be related to the [measureWhooshFrameCalc] measure. This is why you have to replace the ImageName option of this meter with ImageName=#@#Whoosh\Whoosh[measureWhooshFrameCalc].png. I also removed here the not-needed quotes. This removes a lot of error messages in the log as well.
Thank You So much, that works perfectly, now I will spend some time working out exactly how it achieves it but I got your notes to read, but it works perfectly. So that the end of this problem. I have spent a couple of days on this. I'm Over the moon.

AS a matter of interest the last thing I tried was to add [!RainmeterRefresh] .... to Gate Idle button (in my previous code) .... This did actually work, BUT it did not always work perfectly, sometimes you did not get the full Whoosh effect. So it was sort of OK but I knew it should be possible to get it perfect.

Thank you again.

Keith