Including a command line executable tool with a .xsiaddon

Discussions concerning programming of SOFTIMAGE©
Post Reply
Manticor
Posts: 160
Joined: 09 Jun 2011, 22:41

Including a command line executable tool with a .xsiaddon

Post by Manticor » 23 Apr 2014, 14:31

Hi there

Im currently finishing up a custom exporter plugin in python but Ive ran into a bit of a problem .I would like to include a command line executable as part of the package which I can run from python (its basically a texture converter .exe) .But I'm not 100% sure where it will be installed when someone installs it.

Can anyone suggest a good way of solving this problem ?

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: Including a command line executable tool with a .xsiaddon

Post by Hirazi Blue » 23 Apr 2014, 15:33

One way that might work is the following: using “__sipath__” from the sipyutils module you can get the path to your script plugin from within the script itself, I believe. As the hierarchy of your addon doesn’t change, merely its location, you can use this “__sipath__” as a basis to get to the necessary other file. You'll have to dissect the path given by "__sipath__" a bit, but that's a relatively minor problem.
:-s
Stay safe, sane & healthy!

Manticor
Posts: 160
Joined: 09 Jun 2011, 22:41

Re: Including a command line executable tool with a .xsiaddon

Post by Manticor » 23 Apr 2014, 16:31

Thanks for the speedy help Hirazi.

User avatar
myara
Posts: 403
Joined: 28 Sep 2011, 10:33

Re: Including a command line executable tool with a .xsiaddon

Post by myara » 24 Apr 2014, 12:07

You can get your Plugin Path with :

Code: Select all

Application.Plugins( "PluginName" ).OriginPath
that will most probably will be:

Normal installation (user folder):

Code: Select all

users\[userName]\Autodesk\Softimage...\Application\Addons\[AddonName]\Application\Plugins
Workgroup installation:

Code: Select all

[Workgroup]\Addons\[AddonName]\Application\Plugins
M.Yara
Character Modeler | Softimage Generalist (sort of)

Manticor
Posts: 160
Joined: 09 Jun 2011, 22:41

Re: Including a command line executable tool with a .xsiaddon

Post by Manticor » 28 Apr 2014, 10:02

Thank you myara.

I found to my dismay that pyutils isn't available to me as Im using XSI 7.01 here at work.
So your method works for me .

Cheers

Kenny

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: Including a command line executable tool with a .xsiaddon

Post by Hirazi Blue » 28 Apr 2014, 12:18

Friendly suggestion: when using an earlier version, specifying this version when asking questions could prove to be helpful to both parties! :D
Stay safe, sane & healthy!

Manticor
Posts: 160
Joined: 09 Jun 2011, 22:41

Re: Including a command line executable tool with a .xsiaddon

Post by Manticor » 30 Apr 2014, 13:21

My apologies Hirazi .I will mention it from now on.

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests