SHARE
TWEET

Edge Appender 0.0.3

jeffwincek Jan 13th, 2012 20 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. # the top comments are notes on how maya constructs edges what are the appropriate
  3. # commands to add new faces to the existing ones.
  4.  
  5. import math
  6. import maya.cmds as plg
  7. plg.polyCreateFacet(p=[(0.0, 0.0, 0.0), (1.725, 0.0, 0.0), (0.868, 0.0, 1.5)])
  8.  
  9. #edgeNum = 1
  10. #xValEven = 0.8625
  11. #xValOdd = 0.8625
  12. #yVal = 0
  13. #zVal = 1.5
  14. #stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValOdd*3) + ',0,' + str(zVal)+ ')]'
  15. #eval('plg.polyAppend(' + stringconstruct + ')')
  16. #edgeNum = edgeNum + 2
  17. #stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValEven*4) + ',0,' + str(0)+ ')]'
  18. #eval('plg.polyAppend(' + stringconstruct + ')')
  19. #edgeNum = edgeNum + 3
  20. #stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValOdd*5) + ',0,' + str(zVal)+ ')]'
  21. #eval('plg.polyAppend(' + stringconstruct + ')')
  22. #edgeNum = edgeNum + 1
  23. #stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValEven*6) + ',0,' + str(0)+ ')]'
  24. #eval('plg.polyAppend(' + stringconstruct + ')')
  25. #edgeNum = edgeNum + 3
  26. #stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValOdd*7) + ',0,' + str(zVal)+ ')]'
  27. #eval('plg.polyAppend(' + stringconstruct + ')')
  28. #edgeNum = edgeNum + 1
  29. #stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValEven*8) + ',0,' + str(0)+ ')]'
  30. #eval('plg.polyAppend(' + stringconstruct + ')')
  31.  
  32.  
  33.  
  34. edgeNum = 1
  35. xValEven = 0.8625
  36. xValOdd = 0.8625
  37. yVal = 0
  38. zVal = 1.5
  39. for i in range(2,10):
  40.         xValEven = (.8625*i * 2)
  41.         xValOdd = (.8625*i * 2) - .8625
  42.         stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValOdd) + ',0,' + str(zVal)+ ')]'
  43.         eval('plg.polyAppend(' + stringconstruct + ')')
  44.         edgeNum = edgeNum + 1
  45.         if i==2:
  46.                 edgeNum = edgeNum + 1
  47.         stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValEven) + ',0,' + str(0)+ ')]'
  48.         eval('plg.polyAppend(' + stringconstruct + ')')
  49.         edgeNum = edgeNum + 3
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top