Skip to content

Commit

Permalink
Warrior variation selection button added
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonghwan Hwang authored and Jonghwan Hwang committed May 20, 2020
1 parent fe1de9f commit 5490480
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
23 changes: 17 additions & 6 deletions animBuddy/Warrior/UIWarriorToolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from functools import partial
import FkIkMatch
reload(FkIkMatch)
import Variation
reload(Variation)

class UIWarriorToolbar:
"""
Expand All @@ -29,10 +31,14 @@ def __init__(self):

cmds.rowLayout(numberOfColumns = 1)
cmds.setParent("..")
cmds.rowLayout(numberOfColumns = 7)
cmds.button(label = 'FKIK',
annotation = 'select any arm controller and run',
c = self.fkikSwitch)
cmds.rowLayout(numberOfColumns = 8)
cmds.columnLayout()
self.optionMenuVariation = cmds.optionMenu(label='Variation', changeCommand = self.changeVariation)
cmds.menuItem(label='Select...')
cmds.menuItem(label='Warrior')
cmds.menuItem(label='Hero')
cmds.setParent("..")

cmds.separator(height = 10, width = 10, style = 'none')
self.checkBoxBake = cmds.checkBox(label = "bake", cc = self.bakeTextBoxEnable)
self.textFieldStartFrame = cmds.textField(width = 50, text = cmds.playbackOptions(minTime = True, q = True))
Expand Down Expand Up @@ -80,12 +86,17 @@ def _bakeTextBoxCB(self):
cmds.textField(self.textFieldStartFrame, e = True, en = enable)
cmds.textField(self.textFieldEndFrame, e = True, en = enable)


def bakeTextBoxEnable(self, args):
def bakeTextBoxEnable(self, *args):
"""
"""
self._bakeTextBoxCB()

def changeVariation(self, *args):
"""
"""
variation = cmds.optionMenu(self.optionMenuVariation, q = True, v = True)
Variation.setVariation(variation)

def loadInMaya(self, *args):
"""
"""
Expand Down
20 changes: 20 additions & 0 deletions animBuddy/Warrior/Variation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import maya.cmds as cmds

def setVariation(variation):
"""
"""
prefix = ''
if cmds.ls("*:warrior"):
prefix = cmds.ls("*:warrior")[0].split(":")[0] + ':'

if variation == 'Warrior':
cmds.setAttr(prefix + "skin_mat.color", 0.39500001072883606, 0.2898096442222595, 0.16708499193191528)
cmds.setAttr(prefix + "armor_mat.color", 0.06145251542329788, 0.0441889651119709, 0.019726259633898735)
cmds.setAttr(prefix + "leather_mat.color", 0.12099999934434891, 0.08700807392597198, 0.03884099796414375)

elif variation == 'Hero':
cmds.setAttr(prefix + "skin_mat.color", 0.011249996721744537, 0.01455254852771759, 0.125)
cmds.setAttr(prefix + "armor_mat.color", 0.0023856402840465307, 0.002075000200420618, 0.02500000037252903)
cmds.setAttr(prefix + "leather_mat.color", 0.0023856402840465307, 0.002075000200420618, 0.02500000037252903)


0 comments on commit 5490480

Please sign in to comment.