Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #imports
  2. import win32com.client
  3. from win32com.client import constants
  4.  
  5. #globals
  6. xsi = win32com.client.Dispatch( "XSI.Application" ).Application
  7. xsiPrint = xsi.LogMessage
  8.  
  9. def setupDorrito():
  10.     if xsi.Selection < 1:
  11.         xsiPrint("Select an component!",constants.siError)
  12.         return False
  13.  
  14.     root = xsi.ActiveSceneRoot
  15.  
  16.     #create cluster constrained null, setup its look
  17.     clsCnsNull = root.AddNull("clsCnsNull")
  18.     clsCnsNull.primary_icon.value = 0
  19.     clsCnsNull.size.value = 0.1
  20.     clsCnsNull.shadow_icon.value = 7
  21.     clsCnsNull.shadow_colour_custom.value = 1
  22.     clsCnsNull.B.value = 1
  23.     clsCnsNull.G.value = 0.5
  24.  
  25.     #make cluster from selection
  26.     subComponent = xsi.Selection(0).subComponent
  27.     cnsCls = subComponent.CreateCluster("cnsCls")
  28.  
  29.     #constrain object to cluster
  30.     cns = clsCnsNull.Kinematics.AddConstraint("ObjectToCluster",cnsCls)
  31.     cns.tangent.value = 1
  32.     cns.dirx.value = 0
  33.     cns.diry.value = -1
  34.     cns.upvct_active.value = 1
  35.     cns.upx.value = 1
  36.     cns.upy.value = 0
  37.  
  38.     #make dorrito
  39.     dorrito = root.AddNull("dorrito")
  40.     dorrito.primary_icon.value = 0
  41.     dorrito.size.value = 0.2
  42.     dorrito.shadow_icon.value = 8
  43.     dorrito.shadow_colour_custom.value = 1
  44.     dorrito.G.value = 1
  45.     dorrito.shadow_offsetX.value = 0.1
  46.     dorrito.shadow_scaleX.value = 0
  47.  
  48.     clsCnsNull.AddChild(dorrito)
  49.     dorrito.kinematics.local.transform = XSIMath.CreateTransform()
  50.  
  51. setupDorrito()