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:
    import maya.cmds as cmds
    import random
    
    sourceCards = cmds.ls(sl=True)
    print(random.choice(sourceCards))
    
    for i in cmds.ls(sl=True):
        posX = cmds.getAttr(i+".translateX")
        posY = cmds.getAttr(i+".translateY")
        posZ = cmds.getAttr(i+".translateZ")
        rotX = cmds.getAttr(i+".rotateX")
        rotY = cmds.getAttr(i+".rotateY")
        rotZ = cmds.getAttr(i+".rotateZ")
        
        newCard = cmds.duplicate(random.choice(sourceCards))
        cmds.setAttr(newCard[0]+".translate", posX,posY,posZ, type="double3")
        cmds.setAttr(newCard[0]+".rotate", rotX,rotY,rotZ, type="double3")
        cmds.rename(newCard[0], "Card01")
        
        cmds.delete(i)
    
Sign In or Register to comment.