Help with WindowXML and skin animation?
#1
Question 
I'm converting one of my scripts to use WindowXML and trying, without success, to have a ControlList animate when it's hidden from a script.

In the lists XML I have:

<animation effect="slide" time="200" start="0,116" end="0,0" acceleration="-1.1" condition="Control.IsVisible(70)">conditional</animation>


It does animate when from within the script I set it visible:
self.getControl( 70 ).setVisible(True)

But, if I then .setVisible(False) it simply dissappears, without animation, regardless of any animate definitions in the XML.

eg.
<animation effect="slide" time="200" end="0,116" acceleration="-1.1">hidden</animation>

or even using 'VisibleChange'

Can any one help ?
Thanks
BBB
Retired from Add-on dev
Reply
#2
Sounds like whatever the script is using to force hidden it's not the same as what XBMC uses internally to toggle the hidden state (i.e. it's not the appropriate guimessage).

When the control is hidden forcefully, there's no chance to run any anims.

I'm not sure how this could screw things up in scripts by changing it though Sad

You could try altering the code yourself to have a play:

Line 138 in xbmc/lib/libPython/xbmcmodule/control.cpp

Change this:

self->pGUIControl->SetVisible(visible);

to this:

CGUIMessage msg(visible ? GUI_MSG_VISIBLE : GUI_MSG_HIDDEN, self->iParentId, self->iControlId);
self->pGUIControl->OnMessage(msg);

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
thanks for the advice, but having never created a xbmc build before, it may take a while to figure that out just to see if it works.

If your change would also cause an animation that had been set using the 'VisibleChange', 'Hidden' or 'Visible' attributes, it would be very useful ?

I checked several WindowXML based scripts, to see if any do anims based on script setting of visible state, but none do.

cheers
Retired from Add-on dev
Reply
#4
if you want to share you script with me, i can test.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#5
Hi.

I've put together a simple test script, that should test the setVisible()

It consists of a simple single list that should slide ON / OFF the left of the screen when the script changes visible state.

To toggle visible state:
On xbmc_pc.exe , mouse over the list to gain focus, press RETURN
On xbox, press SELECT (A button)

I just need to know where to send it ?

cheers
Retired from Add-on dev
Reply
#6
If jmarshall is worried about screwing things up, this works (maybe, since the control is still visible it can be selected).

add a dummy control like a label and set that <visible>false.

I'll test his code changes after while.

Quote:
<animation effect="slide" time="300" start="-220,0" acceleration="-1.1" condition="Control.IsVisible(77)">conditional</animation>
<animation effect="slide" time="300" start="0,0" end="-220,0" acceleration="-1.1" condition="!Control.IsVisible(77)">conditional</animation>

Edit: Those code changes did not work.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#7
Did it work when using 'VisibleChange' ?

<animation effect="slide" time="300" start="-220,0" acceleration="-1.1">VisibleChange</animation>
Retired from Add-on dev
Reply
#8
jm: any chance I could ask you to look into this again as it would be nice to be able to trigger anims for both Visible directions from a script ?

thanks
Retired from Add-on dev
Reply
#9
Hi

One year later, I have to deal with the same issue. Can't really animate a single label with visible or hidden type.
The only success I got is using conditional type :
<animation effect="slide" start="660,0" end="0,0" time="1000" condition="Control.IsVisible(602)">conditional</animation>
but it works only when the label got the setVisible(True) not False.

Any clue ? I can't really think nothing changed since 2008 !!
Reply

Logout Mark Read Team Forum Stats Members Help
Help with WindowXML and skin animation?0