View Full Version : Packaging an Addon and file paths
Oz Adi
06-13-2008, 03:35 PM
I need a little help here with file paths..
I wrote a little self installed plugin that uses a bitmap in it's PPG.
While writing that plugin, I put this .bmp under c:/
I am trying to package this into an Addon, I've created an Addon Folder,
and added a "bitmaps" folder under the Application/Plugins directory of this addon folder.
Now,I can't figure out how to set the path in the script... XSI knows to look for help files
under the docs folder, if you create it under the Application/Plugins folder, but not bitmaps.
If anyone can help me with the syntax of the path for the bitmaps, I would really
be happy :)
Cheers,
Oz.
StephenBlair
06-13-2008, 04:12 PM
From the docs, hth:
This means that you have to set the path and filename of the image to display by calling the PPGLayout.SetAttribute method with the siUIFilePath PPG item attribute and the image location.
Oz Adi
06-13-2008, 05:58 PM
Hi Stephen,
I guess I did not explain my self right.
I've already done that, everything works, the PPG shows the bitmaps.
While writing the plugin, I put the bitmap under c:/ and set the path using
siUIFilePath to "C:/bitmap.bmp"
I finished the plugin, and I want to package it, so those bitmaps will be sitting under
the addon folder. The problem I face is the syntax (the DOS syntax?) so that
the script will look for the bitmaps in a spcified folder under the plugin's installation folder.
(all those %USERNAME% weird stuff :sweatdrop: )
Cheers,
Oz. :)
StephenBlair
06-13-2008, 06:59 PM
I would copy the bitmap from C:\ to somewhere in your Addon folder.
Then update siUIFilePath.
Then package the addon.
thiago
06-14-2008, 04:43 PM
Hey Oz,
Just to let you know that you can edit the .xsiaddon file (which is an XML basically), and you'll see there the explicit path to your Bitmaps.
In my case I just took the entire local username stuff and left the relative path inside the addon directory.
lets say....
<AddonItem filename="netview_tc_ProxySelect.jpg" type="Others" description="C:\Users\Thiago\Softimage\XSI_6.5\Addons\tc_ProxyS elect\netview_tc_ProxySelect.jpg" id="31">
Mzg1MAAAAAAAAAAAeNqtVgk8lFsbP2OGGbvBhBZJhlL2Nbq5Kj QpsgxKqIkU
MTGW6OKSdFtIk4TbJZFtSGNJtshky1JDTEKiVJKdss77vYa69X 23797f7/ue
93fOe57nOec5/+e855z/Cz2HXgGR3cYEY4DgQoBD8AOgIUzsvmNkHzLlGPmk
... (THIS IS THE ACTUAL ITEM DESCRIPTION) Don't mess with it)
</AddonItem>So I can just remove the "C:\Users\Thiago\Softimage\XSI_6.5\Addons\tc_ProxyS elect" from the path as the Bitmap is sitting right under the addon directory (in my addon structure at least).
Oz Adi
06-14-2008, 05:47 PM
Thanks guys,
I guess myself did not understand what I was actually after :)
I needed to findout the location the plugin is installed, I hope I did it the right way:
var oPlugins = Application.Plugins;
var oOriginPath = oPlugins.Item("name_of_my_plugin").OriginPath;
now it works...
your answers helped me get directed to the solution, so thanks! :)
Oz.
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.