Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## from http://xsisupport.com/2012/03/17/python-example-constraining-nulls-to-components/ + missingkey Select new nulls.
- from win32com.client import constants as C
- si = Application
- log = si.LogMessage
- selList = []
- if si.Selection.Count > 0 and si.ClassName(si.Selection(0)) == 'CollectionItem' and si.Selection(0).SubComponent is not None:
- # pnt, poly, edge, ...
- clusterType = si.Selection(0).Type.replace( 'SubComponent','' )
- o = si.Selection(0).SubComponent.Parent3DObject
- for i in si.Selection(0).SubElements:
- c = o.ActivePrimitive.Geometry.AddCluster( clusterType, "", [i] )
- n = si.ActiveSceneRoot.AddNull()
- n.Kinematics.AddConstraint( "ObjectToCluster", c )
- selList.append( n )
- si.SelectObj( selList )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement