CELayoutUpgrader - upgrade your layouts to unified dims

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

ice
Just popping in
Just popping in
Posts: 2
Joined: Fri Jul 21, 2006 16:07

CELayoutUpgrader - upgrade your layouts to unified dims

Postby ice » Tue Aug 01, 2006 17:41

Do you have a bunch of layout files that use the old coordinate system?
Now you have no excuse not to upgrade to CEGUI 0.5.0 :).

I wrote a python script to upgrade layout files to the new Unified Coordinate System. It is available on the wiki: http://www.cegui.org.uk/wiki/index.php/CELayoutUpgrader

The code is GPL, so feel free to make modifications and release them.

Enjoy.

P.S. would be nice if someone ran py2exe to package it up nice for windows users.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Tue Aug 01, 2006 19:54

Hey Ice,

how convenient is that? Thanks a bunch! :-)

User avatar
dermont
Quite a regular
Quite a regular
Posts: 75
Joined: Mon Aug 29, 2005 16:15

Postby dermont » Wed Aug 02, 2006 04:39

Very useful but shouldn't the script also remove the MetricsMode property?

User avatar
dermont
Quite a regular
Quite a regular
Posts: 75
Joined: Mon Aug 29, 2005 16:15

Postby dermont » Wed Aug 02, 2006 07:26

Here's an example of the above.

Existing layout:

Code: Select all

<Window Type="DefaultGUISheet" Name="root">
    <Window Type="DefaultGUISheet" Name="FacialDemo">
   <Property Name="Size" Value="w:0.25 h:1" />

   <Window Type="TaharezLook/FrameWindow" Name="OgreGuiDemo/WindowPropertiesWindow">
      <Property Name="MetricsMode" Value="Absolute" />
      <Property Name="Size" Value="w:200 h:400" />
               <Property Name="Position" Value="x:0 y:0.02" />


After Running LayoutUpgrader:

Code: Select all

<Window Type='DefaultGUISheet' Name='root'>
   <Window Type='DefaultGUISheet' Name='FacialDemo'>
      <Property Name='UnifiedSize' Value='{{0.250000,0.000000},{1.000000,0.000000}}'/>
      <Window Type='TaharezLook/FrameWindow' Name='OgreGuiDemo/WindowPropertiesWindow'>
         <Property Name='UnifiedSize' Value='{{200.000000,0.000000},{400.000000,0.000000}}'/>
         <Property Name='UnifiedPosition' Value='{{0.000000,0.000000},{0.020000,0.000000}}'/>
         <Property Name='MetricsMode' Value='Absolute'/>



The MetricsMode property shows an Exception in the CEGUI.log. Updating the layout and removing the MetricsMode lines the demo runs but only the main Frame window is shown. Updating all the Unified sizes to between 0 and 1.0 and everything shows correctly.

Code: Select all

      <Property Name="UnifiedPosition" Value="{{0.05,0},{0.02,0}}" />
       <Property Name="UnifiedSize" Value="{{0.40,0},{0.15,0}}" />

ice
Just popping in
Just popping in
Posts: 2
Joined: Fri Jul 21, 2006 16:07

Postby ice » Fri Aug 04, 2006 05:59

Hi dermont,

The MetricsMode property controls how the regular properties (Position, Size, etc) are interpreted, do I understand correctly?

If that is the case, I can update the script so it detects the MetricsMode and converts those properties correctly. At the moment it just assumes they are relative.

User avatar
dermont
Quite a regular
Quite a regular
Posts: 75
Joined: Mon Aug 29, 2005 16:15

Postby dermont » Fri Aug 04, 2006 08:28

Hi ice,

Thanks for replying. AFAIK that's the purpose of the Metrics Mode. One of the developers may be able to offer more insight.

Here's a link to the original layout (Ogre's facial) I'm using:
http://ogre.cvs.sourceforge.net/ogre/og ... iew=markup

Here's a pic of the layout after running the script updater:
http://img85.imageshack.us/img85/6886/f ... atenh4.jpg

Here's a link shows expected results of ogre's facial animation demo running under pycegui. To update the original layout I opened then saved in the CELayoutEditor. Maybe comparing the original layout vs CELayoutEditor output would identify what needs to be updated in the script.

http://img156.imageshack.us/img156/8179/facialokof5.jpg

The Cegui log still shows exceptios for 'BackgroundFrame/Left/Right/TopImage' property named and 'MetricsMode' Exceptions but runs OK.


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 13 guests