Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## This script copies the Transforms from one object to another in pairs and mirrors them on the YoZ plane, except Scale. Like if you have 4 objects selected, A B C D, it will copy A > B and C > D.
- ## These are just XSI variables.
- app = Application
- oObjs=app.Selection
- ## List built from the selected objects.
- oList=[x.FullName for x in oObjs] ## Softimage Selection list
- ## Fail safe in case the objects selection is an odd number. Gives me a warning and the name of which object will be ignored.
- if len(oList)%2 == 1:
- print 'Odd number of controls selected, so *' + str(oList.pop()) + '* will be ignored.'
- ## List of Coordinates to deal with.
- coords=["sclx","scly","sclz","rotx","roty","rotz","posx","posy","posz"]
- ID=0
- for i in xrange(len(oList)/2):
- mylist=[]
- invlist=["posx","roty","rotz"] ## In this list you choose
- for coord in coords: ## In this loop it will be decided which coordinates are flipped
- if coord in invlist:
- x=-1
- else:
- x=1
- mylist.append(app.GetValue( oList[ID]+".kine.local."+coord, "")*x) ## A List is built with the coordinate values and flips from the source Object. In XSI if I replace in this string 'local' with 'global' I can get a mirrot in world space instead of the local space.
- for coord in coords:
- app.SetValue(oList[ID+1]+".kine.local."+coord,mylist[coords.index(coord)],"") ## List of values it's applied to the pair. Again I have 'local' in the string, but I could have 'global'.
- ID+=2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement