Getting a toolbar to open in a fixed size and position
Posted: 22 Nov 2013, 14:37
When you create a toolbar, like a “shader presets” toolbar for instance, you might like to open it up at the same location, and the same size the next time you open it again.
How to do that? Well... it's not so hard to do:
If you have a look at the code of your newly created toolbar, we can see a set of coordinates in the top part of the XML coding:
X - - - - - - -
<?xml version=”1.0″ encoding=”iso-8859-1″?>
<xsi_file type=”Shelf” xsi_version=”5.11.2006.0529″ syntax_version=”1.0″>
<shelf_view name=”mia_presets” clsid=”{7EA70760-167C-475F-A105-FF235C6FA556}”>
<definition maxinstances=”10000″ acceptfocus=”true” private=”false” defaultsize=”107,47,607,457″ cmdmap=”{00000000-0000-0000-0000-000000000000}” supportedtypes=”6″ category=”"></definition>
X - - - - - - -
The “defaultsize=107,47,607,475″ lines is what we’re after.
The first set of coordinates; 107,47 is the topleft corner of the toolbar.
The second set of coordinates; 607,457 places the bottomright corner of the toolbar. It’s absolute coordinates, not a given width/height value.
Note:
Be aware that the coordinates are influenced by the height of the windowbar and frame, or better said the windows interface settings.
So if you changed any of the values in the “Advanced appearance” window of the windows desktop, you’ll have to subtract the amount of these pixels to line it up properly.
The real 0,0 starting point will be the topleft corner of the XSI interface itself.
So with this information we have a look at our toolbar, in this case will start 107 pixels from the left and 47 pixels from the top of the interface.
It ends at 607 pixels from the left and 457 from the top, making the toolbar occupying 500×410 pixels of screen space in total.
The simplest way of doing things is probably to screen dump the XSI interface into Photoshop and check out the pixel values.
Edit the toolbar file coordinates, save it, restart XSI and see your toolbar open at the correct location and size.
P.S.: Your toolbars are saved as .xsitb files, and are normally located in the Application\toolbars folder of your user settings or workgroup.
Note: This was published on my blog a while ago. But as the blog is going the way of the Dodo soon, I wanted to preserve it here ;)
How to do that? Well... it's not so hard to do:
If you have a look at the code of your newly created toolbar, we can see a set of coordinates in the top part of the XML coding:
X - - - - - - -
<?xml version=”1.0″ encoding=”iso-8859-1″?>
<xsi_file type=”Shelf” xsi_version=”5.11.2006.0529″ syntax_version=”1.0″>
<shelf_view name=”mia_presets” clsid=”{7EA70760-167C-475F-A105-FF235C6FA556}”>
<definition maxinstances=”10000″ acceptfocus=”true” private=”false” defaultsize=”107,47,607,457″ cmdmap=”{00000000-0000-0000-0000-000000000000}” supportedtypes=”6″ category=”"></definition>
X - - - - - - -
The “defaultsize=107,47,607,475″ lines is what we’re after.
The first set of coordinates; 107,47 is the topleft corner of the toolbar.
The second set of coordinates; 607,457 places the bottomright corner of the toolbar. It’s absolute coordinates, not a given width/height value.
Note:
Be aware that the coordinates are influenced by the height of the windowbar and frame, or better said the windows interface settings.
So if you changed any of the values in the “Advanced appearance” window of the windows desktop, you’ll have to subtract the amount of these pixels to line it up properly.
The real 0,0 starting point will be the topleft corner of the XSI interface itself.
So with this information we have a look at our toolbar, in this case will start 107 pixels from the left and 47 pixels from the top of the interface.
It ends at 607 pixels from the left and 457 from the top, making the toolbar occupying 500×410 pixels of screen space in total.
The simplest way of doing things is probably to screen dump the XSI interface into Photoshop and check out the pixel values.
Edit the toolbar file coordinates, save it, restart XSI and see your toolbar open at the correct location and size.
P.S.: Your toolbars are saved as .xsitb files, and are normally located in the Application\toolbars folder of your user settings or workgroup.
Note: This was published on my blog a while ago. But as the blog is going the way of the Dodo soon, I wanted to preserve it here ;)