Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #imports
- import win32com.client
- from win32com.client import constants
- #globals
- xsi = win32com.client.Dispatch( "XSI.Application" ).Application
- xsiPrint = xsi.LogMessage
- def setupDorrito():
- if xsi.Selection < 1:
- xsiPrint("Select an component!",constants.siError)
- return False
- root = xsi.ActiveSceneRoot
- #create cluster constrained null, setup its look
- clsCnsNull = root.AddNull("clsCnsNull")
- clsCnsNull.primary_icon.value = 0
- clsCnsNull.size.value = 0.1
- clsCnsNull.shadow_icon.value = 7
- clsCnsNull.shadow_colour_custom.value = 1
- clsCnsNull.B.value = 1
- clsCnsNull.G.value = 0.5
- #make cluster from selection
- subComponent = xsi.Selection(0).subComponent
- cnsCls = subComponent.CreateCluster("cnsCls")
- #constrain object to cluster
- cns = clsCnsNull.Kinematics.AddConstraint("ObjectToCluster",cnsCls)
- cns.tangent.value = 1
- cns.dirx.value = 0
- cns.diry.value = -1
- cns.upvct_active.value = 1
- cns.upx.value = 1
- cns.upy.value = 0
- #make dorrito
- dorrito = root.AddNull("dorrito")
- dorrito.primary_icon.value = 0
- dorrito.size.value = 0.2
- dorrito.shadow_icon.value = 8
- dorrito.shadow_colour_custom.value = 1
- dorrito.G.value = 1
- dorrito.shadow_offsetX.value = 0.1
- dorrito.shadow_scaleX.value = 0
- clsCnsNull.AddChild(dorrito)
- dorrito.kinematics.local.transform = XSIMath.CreateTransform()
- setupDorrito()
Advertisement
Add Comment
Please, Sign In to add comment