Monday, February 10, 2014

Master the Master Function that Masters the Functions

Not too shabby

I managed to group the whole column and duplicate it. A lot of tweaking and, trial and error need to done. Also, I have to create a master function to call out the functions so that it can execute the script. Ahaha, I nearly confused with my script.

Occlusion It 
It looks nice despite a lot of flaws can be found in it. I really satisfied with this work.!

ON THE SIDE NOTE:
HUEHUEHUE

My Final Script As At 10 February:


import maya.cmds as mc
import math

def createFloor():
    myFloor = mc.polyCube( name = 'floor' )
    mc.scale( 5, 1, 10, myFloor[0] )
    mc.move( 0, 0.5, 0, myFloor[0] )
    mc.polyMoveVertex( 'floor.vtx[5]', tx=-1.0 )
    mc.polyMoveVertex( 'floor.vtx[7]', tx=-1.0 )
    mc.polyMoveVertex( 'floor.vtx[4]', tx=1.0 )
    mc.polyMoveVertex( 'floor.vtx[6]', tx=1.0 )
    return myFloor


def multiFloors (exCreateFloor):
    floorList = []
    n = 0
    nA = 0.2
    for each in range(3):
        myDup = mc.duplicate(exCreateFloor)
        print myDup
        mc.move( 0, n+5, 0, myDup[0] )
        n = n+5
        mc.polyMoveFacet( 'floor.f[2]', tz= 1+nA )
        floorList.append( myDup[0] )
    mc.delete('floor') 
    return floorList
   
def createWall():
    myWall = mc.polyCube( name = 'wall')
    mc.move ( 2, 10, -0.25, myWall[0] )
    mc.scale( 0.5, 20, 10.5, myWall[0] )
    mc.rotate( 0, '6deg', 0, r=True )
    mc.polyMoveVertex( 'wall.vtx[4:5]', tz=3.0 )
    return myWall
    
def mainWall():
    mc.polyCube( n = 'base', w = 5.5, h = 5 )
    mc.polyCube( n = 'cut', w = 3, h = 3 )
    mc.move( 0, -1, 0 )
    mc.polySphere( n = 'curve', sx=10, sy=15, r=2)
    mc.polyBoolOp( 'base', 'cut', op = 2, n = 'end1' )
    mc.polyBoolOp( 'end1', 'curve', op = 2, n = 'end2' )
    mc.move ( 0, 2.5, 5 , 'end2')
    return 'end2'
    
def multiwalls (exCreateWall):
    List = []
    myGrp = mc.group(exCreateWall)
    n = 0
    for each in range(3):
        myDup = mc.duplicate(myGrp)
        print myDup
        mc.move( 0, n+5, 0, myDup[0] )
        n = n+5
        List.append(myDup[0])
    return List
        
def FinalWalls():

    exCreateFloor = createFloor()
    multiFloors (exCreateFloor)
    exCreateWall = mainWall()
    multiwalls (exCreateWall)
    createWall()
    
def finalShape():
    FinalWalls()
    mc.group( 'floor1', 'floor2', 'floor3', 'group1', 'group2', 'group3', 'group4', 'wall', n = 'whee')
   
def makePattern (exFinalWalls):
    cubelist = []
    cubelist2 = []   
    nA = 0
    nB = 0
    n=6
    r=0
    h=0
    for each in range(251):
        
        myDup = mc.duplicate(exFinalWalls)
        mc.move( 0+n, 0, 0+nA, myDup[0], absolute=True )
        mc.rotate( 0, r*5,0, myDup[0], pivot=(0 ,0, 0) )
        n= n+4
        r= r+0.8
        nA = nA+0.5
        nB = nB+1.2
        cubelist.append( myDup[0] )
    return cubelist
    
def makePattern2 (exFinalWalls):
    cubelist = []
    cubelist2 = []   
    nA = 0
    nB = 0
    n=6
    r=0
    h=0
    for each in range(255):
        
        myDup = mc.duplicate(exFinalWalls)
        mc.move( 0+n, 0, -0+nA, myDup[0], absolute=True )
        mc.rotate( 0, r*5,0, myDup[0], pivot=(0 ,0, 0) )
        n= n-4
        r= r-0.8
        nA = nA-0.5
        nB = nB-1.2
        cubelist.append( myDup[0] )
    return cubelist

def master():
    finalShape()
    exFinalWalls = 'whee'
    makePattern (exFinalWalls)
    makePattern2 (exFinalWalls)
    mc.delete( 'base', 'cut', 'curve', 'end1', 'whee' )
    
master()





Thursday, February 6, 2014

It's just some Boolean that I used to know

Not gonna use the previous Boolean. Instead, I created a new one
Although the previous Boolean was scraped off, I still use the script that I learned to create a new outer wall. I much prefer this design though. It's difficult to execute this as I have 3 polygons. I trial and error with the scripts and managed to make it work. Wow.

Now, until to this part, my script is very messy. Time to group them up and duplicate the column !

My Script As At 6 February:

import maya.cmds as mc
import math

def createFloor():
    myFloor = mc.polyCube( name = 'floor' )
    mc.scale( 5, 1, 10, myFloor[0] )
    mc.move( 0, 0.5, 0, myFloor[0] )
    mc.polyMoveVertex( 'floor.vtx[5]', tx=-1.0 )
    mc.polyMoveVertex( 'floor.vtx[7]', tx=-1.0 )
    mc.polyMoveVertex( 'floor.vtx[4]', tx=1.0 )
    mc.polyMoveVertex( 'floor.vtx[6]', tx=1.0 )
    return myFloor


def multiFloors (exCreateFloor):
    floorList = []
    n = 0
    nA = 0.2
    for each in range(3):
        myDup = mc.duplicate(exCreateFloor)
        print myDup
        mc.move( 0, n+5, 0, myDup[0] )
        n = n+5
        mc.polyMoveFacet( 'floor.f[2]', tz= 1+nA )
        floorList.append( myDup[0] )
    mc.delete('floor')
    return floorList
 
def createWall():
    myWall = mc.polyCube( name = 'wall')
    mc.move ( 2, 10, -0.25, myWall[0] )
    mc.scale( 0.5, 20, 10.5, myWall[0] )
    mc.rotate( 0, '6deg', 0, r=True )
    mc.polyMoveVertex( 'wall.vtx[4:5]', tz=3.0 )
    return myWall
   
def mainWall():
    mc.polyCube( n = 'base', w = 5.5, h = 5 )
    mc.polyCube( n = 'cut', w = 3, h = 3 )
    mc.move( 0, -1, 0 )
    mc.polySphere( n = 'curve', sx=10, sy=15, r=2)
    mc.polyBoolOp( 'base', 'cut', op = 2, n = 'end1' )
    mc.polyBoolOp( 'end1', 'curve', op = 2, n = 'end2' )
    mc.move ( 0, 2.5, 5 , 'end2')
    return 'end2'
   
def multiwalls (exCreateWall):
    List = []
    myGrp = mc.group(exCreateWall)
    n = 0
    for each in range(3):
        myDup = mc.duplicate(myGrp)
        print myDup
        mc.move( 0, n+5, 0, myDup[0] )
        n = n+5
        List.append(myDup[0])
    return List
       
def FinalWalls():

    exCreateFloor = createFloor()
    multiFloors (exCreateFloor)
    exCreateWall = mainWall()
    multiwalls (exCreateWall)
    createWall()

Wednesday, January 29, 2014

polyCut Vs. polyBoolOp

After several cries, and spamming of "Maya Commands" , I Finally Found It!
I kept thinking: to cut a polygon, i need 'polyCut'. I used it and kept tweaking it. But still to no avail. I remember Mr Sie Piau said something about cutting the to two polys.

After remembering so hard, I GOT IT! I remembered him saying "Boolean". I try to find out in the Maya Command and use the script. And tada, I managed to 'difference' the two polys.

That's something new i learned today.

Monday, January 20, 2014

Step by Step...

Alright, looking good!
I managed to execute the floors and the side walls. All is left is the outer walls. I have difficulties executing the duplicates of the floor. I ask help from my friends and they gave me a hint about about making a group, and have 2 different functions for the pattern and the dimensions.

Followed their advice closely, and I managed to pull it off! YES!

My Script As At 20th January:

import maya.cmds as mc
import math

def createFloor():
    myFloor = mc.polyCube( name = 'floor' )
    mc.scale( 5, 1, 10, myFloor[0] )
    mc.move( 0, 0.5, 0, myFloor[0] )
    mc.polyMoveVertex( 'floor.vtx[5]', tx=-1.0 )
    mc.polyMoveVertex( 'floor.vtx[7]', tx=-1.0 )
    mc.polyMoveVertex( 'floor.vtx[4]', tx=1.0 )
    mc.polyMoveVertex( 'floor.vtx[6]', tx=1.0 )
    return myFloor


def multiFloors (exCreateFloor):
    floorList = []
    n = 0
    nA = 0.2
    for each in range(3):
        myDup = mc.duplicate(exCreateFloor)
        print myDup
        mc.move( 0, n+5, 0, myDup[0] )
        n = n+5
        mc.polyMoveFacet( 'floor.f[2]', tz= 1+nA )
        floorList.append( myDup[0] )
    mc.delete('floor')
    return floorList

Wednesday, January 15, 2014

Achievement Unlocked : Getting Started

I am now trying to script out the 'base' of the Colosseum.
The "base"
In other words, the column of the Colosseum. I still trying to figure out how to execute it.