zbw_spaceMatch_overComplex.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:zTools 作者: zethwillie 项目源码 文件源码
def doSpaceMatch(*args):

    #check for correct attrs
    obj = cmds.textFieldButtonGrp(widgets["objTFG"], q=True, tx=True)


   #look for message attr re: constraint
    if (cmds.attributeQuery("spaceConstraint", node=obj, exists=True)):
        constraint = cmds.listConnections("%s.spaceConstraint"%obj)
    else:
        cmds.warning("this object has no \"spaceConstraint\" message attribute and thus is not set up for this matching")

    #----------look for string attributes for weights of constraints



    #get ws pos of obj before
    ws1Pos = cmds.xform(obj, q=True, ws=True, t=True)
    ws1Rot = cmds.xform(obj, q=True, ws=True, ro=True)

    #pull the constraint info from the message and string attrs
    #attr = cmds.listAttr(sel,ud=True )

    #-----------here just key the space value!!!
    #switch the spaces, set up "cases", i.e. if world, then set all to 0 except world, etc
    cmds.setAttr("group1_parentConstraint1.pCube1W0", 0)
    cmds.setAttr("group1_parentConstraint1.pCube2W1", 1)

    #set ws pos, rot of obj after
    cmds.xform(obj, ws=True, t=ws1Pos)
    cmds.xform(obj, ws=True, ro=ws1Rot)

    #add in scriptjob?

    #-----------try this
    #set up constraints as normal, maybe DO NOT have to moniter them specifically, set them up as SDKs
    #constraint goes in as message mapped "spaceConstraint"
    #create string attrs for constraint, each space attrname = space , attrVal = constraintAttr(ie. nameW1)
    #Create one tab to set it up
    #creat one tab to do it - get spaces
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号