Skip to content

Instantly share code, notes, and snippets.

@teionn
Last active December 19, 2018 01:22
Show Gist options
  • Save teionn/279216b9d58faabce35f635b40dcf6da to your computer and use it in GitHub Desktop.
Save teionn/279216b9d58faabce35f635b40dcf6da to your computer and use it in GitHub Desktop.
multiArgFunc
# !python2.7
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
from __future__ import absolute_import, division, generators, print_function, unicode_literals
from future_builtins import *
# ------------------------------------------------------------------------------
import maya.cmds as cmds
# ------------------------------------------------------------------------------
def multiArgFunc(**kwargs):
#ブール 一つでもTrueがあれば Trueを返す (any
#print "sl","selection",any(argMerging("sl","selection",dict=kwargs,default=[False]))
_selection = any(argMerging("sl","selection",dict=kwargs,default=[False]))
print("sl/selection",_selection,"-"*80,sep="\n")
#文字列 リスト キーワード複数可
#print "typ","type",argMerging("typ","type",dict=kwargs,default=[])
_type = argMerging("typ","type",dict=kwargs,default=[])
print("typ/type",_type,"-"*80,sep="\n")
#数字で指定 ショート ロング の順で数値が返される。
#print "idx","index",argMerging("num","number",dict=kwargs,default=[0])
_index = argMerging("idx","index",dict=kwargs,default=[0])
print("idx/index",_index,"-"*80,sep="\n")
#ヘルプとか表示できたらいいかもしれない。
#print "h","help",any(argMerging("h","help",dict=kwargs,default=[False]))
_help = any(argMerging("h","help",dict=kwargs,default=[False]))
print("h/help",_help,"-"*80,sep="\n")
_list = cmds.ls(sl=_selection,type=_type)
print("ls",_list,"-"*80,sep="\n")
multiArgFunc(sl=False,selection=False,typ="mesh",type=["lambert","camera"],index=5,idx=1,h=False,help=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment