It is currently September 14th, 2024, 9:53 pm

Help

Get help with creating, editing & fixing problems with skins
Japmc7
Posts: 33
Joined: May 11th, 2024, 3:57 am

Help

Post by Japmc7 »

Hello guys my name es Jesus and I'm new on this page but not in Rainmeter, I've been using Rainmeter for many years, and I've created some skins by myself, I needing help to create an animation.

The thing is that I created a gate that is a sprite, and I want it to have two functions, cause it's a gate to a music player.

The first function is that it opens when I bring the mouse to the gate and it closes when I move it away, I almost make it but the problem is that the sprite does not rewind the closing animation if I move the cursor away before it opens completely, so it´s not working the way I want.

The second function is that it opens when the music plays and stays open, and automatically close again when the music stops, I think is possible but I don't know how to do it, if anyone could help me I'd really appreciate it, I can upload an animated video in After Effects explaining the exact function I want it to do. Thanks in advance, I hope someone please answer me :great:
User avatar
balala
Rainmeter Sage
Posts: 16539
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help

Post by balala »

Japmc7 wrote: May 11th, 2024, 5:58 pm I can upload an animated video in After Effects explaining the exact function I want it to do.
Don't upload a video, or at least not just a video. Upload (or in fact copy and paste here) instead the code of your skin. Your questions are general ones and no one here will be able to say you something meaningful without seeing your code, so please.
Japmc7
Posts: 33
Joined: May 11th, 2024, 3:57 am

Re: Help

Post by Japmc7 »

Thank you but my code is not doing what I want it to do, I gonna upload it but I repeat is not doing what I need, and is not complete.
Japmc7
Posts: 33
Joined: May 11th, 2024, 3:57 am

Re: Help

Post by Japmc7 »

Code: Select all

[Rainmeter]
Update=35

[Metadata]
Name=Gate
Author=Jesús Pacheco
Version=2.0
License=Japware Designs C.A

------------------------------------------------------------------------
[Back]
Measure=Calc
Formula=0

[Open]
Measure=Calc
Formula=13

[CounterStep]
Measure=Calc
Formula=Counter

[CounterHold]
Measure=Calc
Formula=CounterHold = 0 ? CounterStep : CounterHold
Disable=1

[BackAnim]
Measure=Calc
MinValue=0
MaxValue=13
Formula=(CounterStep-CounterHold < 13) ? CounterStep-CounterHold : 0
IfEqualValue=0
IfEqualAction=!Execute [!RainmeterHideMeter MeterAnimOpen][!RainmeterShowMeter MeterBackOpen][!RainmeterHideMeter MeterBackAnim][!RainmeterDisableMeasure BackAnim][!RainmeterShowMeter MeterAnimClose][!RainmeterDisableMeasure CounterHold]
Disabled=1

[BackAnimRev]
Measure=Calc
MinValue=0
MaxValue=13
Formula=(CounterStep-CounterHold < 13) ? 13-(CounterStep-CounterHold) : 12
IfEqualValue=1
IfEqualAction=!Execute [!RainmeterShowMeter MeterBack][!RainmeterHideMeter MeterBackAnimRev][!RainmeterDisableMeasure BackAnimRev][!RainmeterShowMeter MeterAnimOpen][!RainmeterHideMeter MeterAnimClose][!RainmeterDisableMeasure CounterHold]
Disabled=1


---------------------------------------------------------------------------------


[MeterBack]
MeasureName=Back
Meter=BITMAP
X=0
Y=0
BitmapImage=Gate.png
BitmapFrames=13
BitmapZeroFrame=1


[MeterBackAnim]
MeasureName=BackAnim
Meter=BITMAP
X=0
Y=0
BitmapImage=Gate.png
BitmapFrames=13
BitmapZeroFrame=1
Hidden=1

[MeterBackAnimRev]
MeasureName=BackAnimRev
Meter=BITMAP
X=0
Y=0
BitmapImage=Gate.png
BitmapFrames=13
BitmapZeroFrame=1
Hidden=1

[MeterBackOpen]
MeasureName=Open
Meter=BITMAP
X=0
Y=0
BitmapImage=Gate.png
BitmapFrames=13
BitmapZeroFrame=1
Hidden=1

[MeterAnimOpen]
Meter=Image
X=30
Y=35
h=100
w=100
MouseOverAction=!Execute [!RainmeterEnableMeasure CounterHold][!RainmeterEnableMeasure BackAnim][!RainmeterShowMeter MeterBackAnim][!RainmeterHideMeter MeterBack][!RainmeterHideMeter MeterAnimOpen]

[MeterAnimClose]
Meter=Image
X=30
Y=35
h=100
w=100
MouseLeaveAction=!Execute [!RainmeterHideMeter MeterAnimClose][!RainmeterEnableMeasure CounterHold][!RainmeterEnableMeasure BackAnimRev][!RainmeterShowMeter MeterBackAnimRev][!RainmeterHideMeter MeterBackOpen]
Hidden=1
Last edited by Japmc7 on May 12th, 2024, 4:38 am, edited 3 times in total.
Japmc7
Posts: 33
Joined: May 11th, 2024, 3:57 am

Re: Help

Post by Japmc7 »

This code doesn't fulfill the second function I need it to do, I don't know how to do it at all, that's why I'm looking for help, I hope someone can give me a hand.
User avatar
balala
Rainmeter Sage
Posts: 16539
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help

Post by balala »

You're complicating things too much, in my opinion. I'd use one single measure to count up or down and would disable that measure when it's not needed. Here is what am i talking about: replace all those useless measures existing out there ([Back], [Open], [CounterStep], [CounterHold], [BackAnim] and [BackAnimRev]) with the following one:

Code: Select all

[MeasureAnim]
Measure=Calc
Formula=( Clamp (( MeasureAnim + #Step# ), 0, 13 ))
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!DisableMeasure "MeasureAnim"]
DynamicVariables=1
Disabled=1
This measure uses the Step variable, which have to be created into the [Variables] section. So add such a section and add the Step=1 variable to it.
No need to have two different meters, one having a MouseOverAction and the other a MouseLeaveAction option. Recommend to move both options to one single meter (let that one being [MeterAnimOpen], so remove [MeterAnimClose]) and alter those options this way:

Code: Select all

[MeterAnimOpen]
...
MouseOverAction=[!SetVariable Step "1"][!UpdateMeasure "MeasureAnim"][!EnableMeasure "MeasureAnim"]
MouseLeaveAction=[!SetVariable Step "-1"][!UpdateMeasure "MeasureAnim"][!EnableMeasure "MeasureAnim"]
This way when you're hovering the mouse over the meter, [MeasureAnim] starts increasing and when you're leaving it, the measure starts decreasing, no mater if the animation has been finished or not.
Finally replace the [MeterBackAnim] and [MeterBackAnimRev] meters by one single, using the above [MeasureAnim] measure. For instance remove the [MeterBackAnimRev] meter and replace the MeasureName option of the remaining [MeterBackAnim] meter by MeasureName=MeasureAnim.
Is this what you wanted to achieve?
Japmc7
Posts: 33
Joined: May 11th, 2024, 3:57 am

Re: Help

Post by Japmc7 »

Thank you but is not working, I don't get what you say cause I'm not a programmer, something is missing. This is what I understood and did.

Code: Select all

------------------------------------------------------------------------
[MeasureAnim]
Measure=Calc
Formula=( Clamp (( MeasureAnim + #Step# ), 0, 10 ))
IfCondition=0
IfTrueAction=[!DisableMeasure "MeasureAnim"]
DynamicVariables=1
Disabled=1

---------------------------------------------------------------------------------
[MeterAnimation]
Meter=BitMap
MeasureName=MeasureAnim
BitmapImage=Gate.png
BitmapFrames=10
BitmapExtend=1
MouseOverAction=[!SetVariable Step "1"][!UpdateMeasure "MeasureAnim"][!EnableMeasure "MeasureAnim"]
MouseLeaveAction=[!SetVariable Step "-1"][!UpdateMeasure "MeasureAnim"][!EnableMeasure "MeasureAnim"]
In formula now is 10 because I changed the animation to 10 Frames to make it open faster, but is not working properly :(
Last edited by balala on May 12th, 2024, 7:14 am, edited 1 time in total.
Reason: Please use <code> tags whenever are you posting codes. It's the </> button.
User avatar
balala
Rainmeter Sage
Posts: 16539
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help

Post by balala »

Japmc7 wrote: May 12th, 2024, 4:43 am This is what I understood and did.
Two things: IfCondition=0 in the [MeasureAnim] measure is always false. The complete form of this option is IfCondition=(#CURRENTSECTION#=0). Please replace it.

And one more: add a SolidColor=0,0,0,1 option to the [MeterAnimation] meter, because if the bitmap has transparent parts, those parts doesn't react to mouse hovering and can lead to weird behavior.
Japmc7
Posts: 33
Joined: May 11th, 2024, 3:57 am

Re: Help

Post by Japmc7 »

Oh my Gosh... That's working great. Thank you so much dude, now I want that the gates do the same but now when the windows media player plays and when the WMP stops, I mean the gate must open automatically when the WMP starts playing and must close automatically when the WMP stops. that's would be awesome, is it that possible? I got no idea. Thanks in advance sage, you've helped me a lot. I'm so grateful right now.
:D :welcome: :bow:
Last edited by Japmc7 on May 13th, 2024, 12:45 am, edited 2 times in total.
User avatar
balala
Rainmeter Sage
Posts: 16539
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help

Post by balala »

Japmc7 wrote: May 12th, 2024, 7:59 pm now I want that the gates do the same but now when the windows media player plays and when the WMP stops, I mean the gate must open automatically when the WMP starts playing and must close automatically when the WMP stops.
Yep, could be, however there might be a problem. But let's see.
Add the following measure to your code:

Code: Select all

[MeasurePlayer]
Measure=NowPlaying
PlayerName=WMP
PlayerType=State
IfCondition=(#CURRENTSECTION#=1)
IfTrueAction=[!ActivateConfig "ConfigName" "SkinName.ini"]
IfFalseAction=[!ActivateConfig "ConfigName"]
Note the followings:
  • I assume "gate" is a skin, but am I right? If I am, you have to replace ConfigName and SkinName with the appropriate names of your "gate" skin. If "gate" is not a skin, but some meters of the current skin, you have to replace the above !ActivateConfig and !DeactivateConfig bangs with !ShowMeter and !HideMeter. Which is the case, is "gate" a distinct skin?
  • With the above solution, the SkinName skin will be activated only when the player plays. The skin will be deactivated (unloaded) whenever are you stopping or pausing the player. To keep the skin activated when you just pause the playback, replace the above IfCondition by this: IfCondition=(#CURRENTSECTION#>=1).
  • Unfortunately this solution works only with the, let's say, classic Windows Media Player. The new Win 10 and Win 11 app is not supported anymore, so if you're using that one (and I think you are), this solution is completely useless. Sorry in this case.