【发布时间】:2020-06-17 17:56:02
【问题描述】:
好的,所以我正在为脊柱制作一个自动装配器:但在继续之前我必须做一件事,我只需要做一件事:我希望关节链适合两个定位器之间,不幸的是,目前这个任务有点超出我的心理负担:如果有人想尝试一下,这是脚本:
'''
import DS_hybrid_spineOmatic_V1
reload (DS_hybrid_spineOmatic_V1)
DS_hybrid_spineOmatic_V1.gui()
'''
import re
import maya.cmds as cmds
import maya.mel as mel
if cmds.window("spineWin", exists =True):
cmds.deleteUI("spineWin", window = True)
myWindow = cmds.window("spineWin",t='DS_hybrid_spineOmatic_V1',w=200, h=500, toolbox=True)
column = cmds.columnLayout(adj=True)
'''
To DO:
-You're going to have a series of scrips splitting into an IKFK spine and a ribon spine: this script will build the IKFK spine
'''
def gui():
cmds.button( label="Generate Spine Proxy Locators", c = buildProxies)
cmds.separator( w=200, h=3)
cmds.button( label="Build Spine Joints", c = buildJointChain)
cmds.separator( w=200, h=9)
cmds.setParent('..')
cmds.showWindow(myWindow)
def buildProxies(*args):
locAmount = 2
for i in range(locAmount):
countLoc = i+1
spaceLoc = cmds.spaceLocator(n = 'spineLoc_{}_PRX'.format(countLoc), p = [0,i*2.5,0])
cmds.makeIdentity(spaceLoc, a=1, t=1)
mel.eval('CenterPivot;')
cmds.select(cl=True)
def buildJointChain(*args):
cmds.select(cl=True) #this line clears your selection
jntAmount = 7
for jNum in range(jntAmount):
countJnt = jNum+1
spaceJnt = cmds.joint(n = 'spineJnt_{}_Bound'.format(countJnt), p = [0,jNum*1,0])
它没有任何错误:这更像是一个技术问题。我只需要关节链在两个定位器之间等距
【问题讨论】: