Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. '''
  2. Local oriented
  3.  
  4. Parent constraint method
  5.  
  6. '''
  7. import pymel.core as pm
  8.  
  9. '''
  10. 1) Get selection.
  11. - Driving object (has the orientation)
  12. - Driven object (which will be moved to the driver)
  13. '''
  14. items = pm.ls(sl=True)
  15. driver = items[0]
  16. driven = items[1]
  17.  
  18.  
  19. #2) Apply parent constraint with maintain offset off
  20. kenny = pm.parentConstraint(driver, driven, weight=1)
  21.  
  22. #3) delete constraint
  23. # delete
  24. pm.delete(kenny)
  25.  
  26. pm.select(driven, r=1)
  27.  
  28.  
  29. '''
  30. Local oriented
  31.  
  32. Parent constraint method
  33.  
  34. '''
  35.  
  36. '''
  37. 1) Get selection.
  38. - Driving object (has the orientation)
  39. - Driven object (which will be moved to the driver)
  40. '''
  41.  
  42. '''
  43. 2) Parent child to the parent
  44. child is driver and parent is driven
  45. '''
  46.  
  47. #3) Zero out transforms (trans or rotates)
  48.  
  49.  
  50. #** Group option
  51.  
  52. #4) Unparent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement