Quicktip: Installing Gear in network workgroups

Issues concerning rigging & Face Robot...
Post Reply
User avatar
gustavoeb
Moderator
Posts: 587
Joined: 21 Jul 2010, 00:33
Skype: gustavoboehs

Quicktip: Installing Gear in network workgroups

Post by gustavoeb » 12 Aug 2013, 01:36

Hi guys, here is a quicktip on setting up Gear.

The standard way to do this is storing your gear (python) modules somewhere in your PC and then set up a proper environment variable. If you have to settup gear for use in many computers that can be a drag. So an alternative is this:
1. Instal the gear xsiaddon
2. store your gear modules under workgroup > addons > gear > Application > gear
3. for every python file in the workgroup > addons > gear > Application plugins add this piece of code to the top of the scripts:

Code: Select all

import sys

if __sipath__ not in sys.path:
	sys.path.append( __sipath__ )
Now any SI session that uses this workgroup should be able to access all modules with ease.

Ps 1: Beware that this probably will make this modules unacessible outside of SI
Ps 2: http://download.autodesk.com/global/doc ... inXSI.htm#
Gustavo Eggert Boehs
Blog: http://www.gustavoeb.com.br/

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

Re: Quicktip: Installing Gear in network workgroups

Post by myara » 22 Aug 2013, 08:31

It sounds like a very nice trick. I don't know if I'm doing something wrong but it isn't working for me.

I get this error in SI 2011 SP2
# File "<Script Block >", line 28, in <module>
# if __sipath__ not in sys.path:
# NameError: name '__sipath__' is not defined
My Folder structure:

Code: Select all

Application
   |-CommandMaps
   |-gear
       |- xsi
           | - jsop
           | - rig
   |-Plugins
       | - gear_synoptic
           | - tabs
M.Yara
Character Modeler | Softimage Generalist (sort of)

User avatar
csaez
Posts: 253
Joined: 09 Jul 2012, 15:31
Skype: csaezmargotta
Location: Sydney, Australia
Contact:

Re: Quicktip: Installing Gear in network workgroups

Post by csaez » 22 Aug 2013, 19:25

__sipath__ is defined on plugin files only, for external scripts/modules python's os.path module should do the trick

Code: Select all

os.path(os.path.dirname(__file__))

Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests