blendShape targets problem

93 views
Skip to first unread message

cgpengda

unread,
Jul 25, 2017, 4:43:53 AM7/25/17
to Python Programming for Autodesk Maya
Hello everyone:

I am writing a blendShape tool.
I have a tough problem that bothers me for a long time.

  • First, I add a new target, called D, to the blendShape node.
#add target
cmds.blendShape('blendShape1',e=1,t=('baseMesh',3,'D',1))

  • Then, using the maya's removeMultiInstance command, remove the target D.
#remove target
cmds.removeMultiInstance("%s.weight[%s]" % ('blendShape1','3'), b=True)
cmds.removeMultiInstance("%s.inputTarget[0].inputTargetGroup[%s]" % ('blendShape1','3'), b=True)

  • Finally, when I add target D again to the blendShape node, the blendShape's weight attribute name, sometimes right, sometimes wrong.
#add target
cmds.blendShape('blendShape1',e=1,t=('baseMesh',3,'D',1))


right:

   


wrong:




How can I operate to avoid the wrong results?

Thank you!!!!

Nicolas Combecave

unread,
Jul 25, 2017, 6:20:43 AM7/25/17
to python_in...@googlegroups.com
When you add a target to a blendShape node, maya also adds an alias to the node.weight[x], so that interaction is easier...
Maybe you should try to cleanup the alias also?


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/e83f45d2-71fb-48b0-b737-9f9812f20ba4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

cgpengda

unread,
Jul 25, 2017, 10:05:00 PM7/25/17
to Python Programming for Autodesk Maya
Thank you for your reply, I will try to clean up the alias, if there are problems, I hope you and pointing.

cgpengda

unread,
Jul 26, 2017, 2:46:45 AM7/26/17
to Python Programming for Autodesk Maya
Thank you very much, I used aliasAttr command to solve this problem


On Tuesday, July 25, 2017 at 6:20:43 PM UTC+8, combi wrote:
Reply all
Reply to author
Forward
0 new messages