Home Contests & Challenges Archives the Polycount Tower

TOWER - Card house floor - JoakimMellergard

Thought the tower was a fun initiative so I decided to participate with a little something. Heres my first WIP post of my card house that I guarantee will be strong enough to carry the floors above ;)
Ill be using 3 uv sets for diffuse/specular, normal and AO to save texture space.

5ls07p.jpg

Replies

  • JoakimMellergard
    Placing/Copy all the cards got very tedious so I made a script which makes a copy of a card in my "source pile" and moves it to the position of the "building card". This way I can move and rotate two cards and in the end select all of the "building cards" and replace them with random cards. Heres the script:
    1. import maya.cmds as cmds
    2. import random
    3.  
    4. sourceCards = cmds.ls(sl=True)
    5. print(random.choice(sourceCards))
    6.  
    7. for i in cmds.ls(sl=True):
    8. posX = cmds.getAttr(i+".translateX")
    9. posY = cmds.getAttr(i+".translateY")
    10. posZ = cmds.getAttr(i+".translateZ")
    11. rotX = cmds.getAttr(i+".rotateX")
    12. rotY = cmds.getAttr(i+".rotateY")
    13. rotZ = cmds.getAttr(i+".rotateZ")
    14. newCard = cmds.duplicate(random.choice(sourceCards))
    15. cmds.setAttr(newCard[0]+".translate", posX,posY,posZ, type="double3")
    16. cmds.setAttr(newCard[0]+".rotate", rotX,rotY,rotZ, type="double3")
    17. cmds.rename(newCard[0], "Card01")
    18. cmds.delete(i)
Sign In or Register to comment.