Re: XSIDatabase.com Updates!

Date : Sun, 02 Sep 2007 23:18:38 -0400
To : XSI(at)Softimage.COM
From : Eric Thivierge <eric(at)xsidatabase.com>
Subject : Re: XSIDatabase.com Updates!
Thanks Bernard,

I'll mess around with that and see if I can get it to work. I appreciate your help.

Thanks,

Eric Thivierge, XSI Database Admin
www.xsidatabase.com
eric(at)xsidatabase.com
Forum Username: EricTRocks


Bernard Lebel wrote:
Éric, here's what you might do. My example are in JScript but may
translate easily to VB.

In the execute callback, you will do this.

First, get the plugin from the registrar:

var oPlugin = Application.plugins( "AddPhysicalSkyPlugin" );

Then, check the Origin of the plugin:

var iOrigin = oPlugin.origin;

This will return an integer. If you look at the siInstallationPath
entry in the docs, you'll see what the integer means: 3 is factory, 1
is user, etc. In your code, you'll have to handle every case.

Once you know the origin of the plugin, you can then either use the
Application.InstallationPath property or the plugin's FileName
property work out where is your custom data located.


Cheers Bernard





On 9/2/07, Eric Thivierge <eric(at)xsidatabase.com> wrote:
Hey Stephen,

so how would I implement that?? What object do i lookup the OriginPath
for??? Again, new to scripting I am reading the Docs but not finding
what I need to, in order to understand.

sub Import_XSIDB_v6_02_Scene_Execute(  )

        Application.LogMessage "Import_XSIDB_v6_02_Scene_Execute called"

        ' What do I use instead of the in_reg????
        ' s = in_reg.OriginPath
        ' LogMessage Left( s, InStr( s, "XSIDB" )+5 ) & "Data\Scene Files\dotXSI\XSIDB_Full_Geo.xsi"

        XSIDBv6File = Application.InstallationPath( siUserPath ) & "\Addons\XSIDB\Data\Scene Files\Scenes\XSIDB_ShaderBall_v3_6.02.scn"
        OpenScene XSIDBv6File

end sub




Thanks,

Eric Thivierge, XSI Database Admin
www.xsidatabase.com
eric(at)xsidatabase.com
Forum Username: EricTRocks


Stephen Blair wrote:
in_reg.OriginPath will give you something like

U:\My Workgroup\Addons\XSIDB\Application\Plugins\

Given that, you can work out where the .xsi/.scn file is.

eg

s = "U:\My Workgroup\Addons\XSIDB\Application\Plugins\"
LogMessage Left( s, InStr( s, "XSIDB" )+5 ) & "Data\Scene
Files\dotXSI\XSIDB_Full_Geo.xsi"



-----Original Message-----
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf
Of Eric Thivierge
Sent: Sun 02 September 2007 10:36 AM
To: XSI(at)Softimage.COM
Subject: Re: XSIDatabase.com Updates!

Hey Bernard,

I'm not sure if this would help...  Doesn't the PluginRegister only tell
you where is has already been installed / loaded from??  I need to
determine whether the user has selected the user addon directory or the
workgroup addon directory.

Here is my code fro the v6_02 plugin (Just hacked the sample code from
the TD Layout):

function XSILoadPlugin( in_reg )
    in_reg.Author = "Eric Thivierge"
    in_reg.Name = "Import XSIDB v6_02 Scene Plugin"
    in_reg.Email = ""
    in_reg.URL = ""
    in_reg.Major = 1
    in_reg.Minor = 0

    in_reg.RegisterCommand
"Import_XSIDB_v6_02_Scene","Import_XSIDB_v6_02_Scene"
    in_reg.RegisterMenu
siMenuMainFileImportID,"Import_XSIDB_v6_02_Scene_Menu",false,false
    'RegistrationInsertionPoint - do not remove this line

    XSILoadPlugin = true
end function

function XSIUnloadPlugin( in_reg )
    dim strPluginName
    strPluginName = in_reg.Name
    Application.LogMessage strPluginName & " has been unloaded."
    XSIUnloadPlugin = true
end function

function Import_XSIDB_v6_02_Scene_Init( ctxt )
    dim oCmd
    set oCmd = ctxt.Source
    oCmd.Description = "Import XSIDB v6.02 Scene"
    oCmd.Tooltip = "Import XSIDB v6.02 Scene"
    oCmd.SetFlag siCannotBeUsedInBatch,true
    oCmd.ReturnValue = false

    Import_XSIDB_v6_02_Scene_Init = true end function

sub Import_XSIDB_v6_02_Scene_Execute(  )

    Application.LogMessage "Import_XSIDB_v6_02_Scene_Execute called"
    '
    XSIDBv6File = Application.InstallationPath( siUserPath ) &
"\Addons\XSIDB\Data\Scene Files\Scenes\XSIDB_ShaderBall_v3_6.02.scn"
    OpenScene XSIDBv6File
    '
end sub

function Import_XSIDB_v6_02_Scene_Menu_Init( ctxt )
    dim oMenu
    set oMenu = ctxt.Source
    oMenu.AddCommandItem
"Import_XSIDB_v6_02_Scene","Import_XSIDB_v6_02_Scene"
    Import_XSIDB_v6_02_Scene_Menu_Init = true end function



Thanks,

Eric Thivierge, XSI Database Admin
www.xsidatabase.com
eric(at)xsidatabase.com
Forum Username: EricTRocks


Bernard Lebel wrote:

I'm not in front of XSI atm so sorry in advance if what I'll say is
not 100% accurate.

If you have implemented the plugin as a self-installed plugin, then
you can look in the PluginRegistrar object to find the plugin object,
and with the plugin object determine in what location it is installed.


Cheers Bernard



On 9/2/07, Eric Thivierge <eric(at)xsidatabase.com> wrote:


Any scripting guru's that can help with this it'd be appreciated:

If you look at the addon file I just release, I have released it

under

the assumption that everyone installs the plugin under the user

addons...

I use:
siUserPath

How do I have XSI determine whether they are installing under the
workgroup or the user addons and install accordingly??? I don't have
access to a workgroup setup BTW.

Thanks,

Eric Thivierge, XSI Database Admin
www.xsidatabase.com
eric(at)xsidatabase.com
Forum Username: EricTRocks


Eric Thivierge wrote:


I've just release the XSI Database Shaderball Plugin. This adds
options on the File > Import menu to open the appropriate scene file
for your XSI version. If you are using XSI v5.0 or v6.0 you should
import the dotxsi file.

Download here:
http://www.xsidatabase.com/XSIDB_Shaderball.rar

Thanks,

Eric Thivierge, XSI Database Admin
www.xsidatabase.com
eric(at)xsidatabase.com
Forum Username: EricTRocks


Eric Thivierge wrote:


Hey,

I'll try to keep all these updates in this new thread. Read on...

Check the site for layout / usability updates:

- Added about us Page.
- Turned base material into link on material page
- Added tags field on upload / modify material page, will be making

a

tag cloud feature soon.
- Fixed CSS on footer, now is consistently small
- Updated navigation buttons to be orange to match link color
- opened up 25 more spots in the beta.

We're going to have a new default material scene for v5 and v6 up
later tonight. Many improvements within them. Please upload as many
material presets as you can. I'm going to be working on User

Profiles

& Plug-ins / Scripts uploads next.



---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
body:
unsubscribe xsi



---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in

body:

unsubscribe xsi



---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in

body:

unsubscribe xsi



---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
body:
unsubscribe xsi

---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi


--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.