运行oarelaxvets脚本提示以下内容怎么解决?

该主题包含 17 个回复,有 2 个参与人,并且由 李越朗 的头像 李越朗7 月, 1 周 前 最后一次更新。

正在查看 10 个帖子 - 1 至 10 (共计 18 条)
  • 作者
    帖子
  • #35330
    李越朗 的头像
    李越朗
    学员
    注册日期: 2015/05/30
    发帖数: 23
    回帖数: 47

    warning redeclaration variable spos shadows previous declaration at line 113 previous value will be overwritten by explicit initializer

    #35596
    zivix 的头像
    zivix
    管理员
    注册日期: 2014/05/15
    发帖数: 7
    回帖数: 1583

    你换一个模型试试,先排除是模型的问题。

    #35729
    李越朗 的头像
    李越朗
    学员
    注册日期: 2015/05/30
    发帖数: 23
    回帖数: 47

    试了几个模型都不行

    #35756
    zivix 的头像
    zivix
    管理员
    注册日期: 2014/05/15
    发帖数: 7
    回帖数: 1583

    你是选择模型还是点?这个脚本必须选择点才能运行。

    #35808
    李越朗 的头像
    李越朗
    学员
    注册日期: 2015/05/30
    发帖数: 23
    回帖数: 47

    当然是选择点,我有好好看教程的好吧 :?:

    #35809
    zivix 的头像
    zivix
    管理员
    注册日期: 2014/05/15
    发帖数: 7
    回帖数: 1583

    我用maya2016测试,完全没有问题,你要不下载我这个版本试试把。

    上传附件/图片:
    您必须登陆才能查看附件
    #35817
    李越朗 的头像
    李越朗
    学员
    注册日期: 2015/05/30
    发帖数: 23
    回帖数: 47

    /* This file downloaded from Highend3d.com

    ” Highend3d.com File Information:

    ” Script Name: oaRelaxVerts
    ” Author:
    ” Last Updated: Jan 26, 2007
    ” Update/Change this file at:
    http://Highend3d.com/maya/downloads/mel_scripts/modeling/poly_tools/4499.html

    ” Please do not alter any information above this line
    ” it is generated dynamically by Highend3d.com and will
    ” be changed automatically on any updates.
    */
    /*
    ===========================================================================

    <NAME> oaRelaxVerts.mel </NAME>
    <VERSION> v1.1 </VERSION>
    <AUTHORS> Oleg Alexander (olegalexander@gmail.com) </AUTHORS>

    <DESCRIPTION>

    oaRelaxVerts averages selected vertices, but tries to maintain the original
    shape of the object.

    As you know, when creating blend shapes, it’s not only the shape that matters,
    but also the distribution of the vertices. The movement of the vertices
    determines the movement of the texture. Achieving an even distribution of
    vertices is difficult with conventional means, such as the Sculpt Geometry
    Smooth tool, because volume is lost. oaRelaxVerts tries to preserve the
    original volume of the shape, often creating beautiful skin sliding effects.

    Because oaRelaxVerts is life-changing for blend shape artists, I’ve convinced
    my employers, Image-Metrics, to allow me to release it to the general public.
    Image-Metrics is a facial animation company with offices in Manchester, England
    and Santa Monica, CA. If you want to see some ground-breaking facial animation,
    visit http://www.image-metrics.com.

    Enjoy! </DESCRIPTION>

    <TO_USE>

    Select some polygon vertices. Execute ‘oaRelaxVerts’. </TO_USE>

    <HISTORY>

    v1.1 (Friday, January 26, 2007)
    o Slight error checking

    v1.0 (Wednesday, January 24, 2007)
    o Original Release </HISTORY>

    IF YOU ENJOY THIS MEL SCRIPT, PLEASE RATE IT. I WOULD APPRECIATE IT. THANK YOU!
    ===========================================================================
    */

    // Basically, this is two operations: Average vertices and shrink wrap them back
    // to a copy of the original.
    //
    // Oh, and don’t try to change the algorithm to use the new transferAttributes
    // command in Maya 8. It’s not as accuarate as using the geometryConstraint!
    global proc oaRelaxVerts () {

    //Get selected verts
    string $verts[] = ls -fl -sl;
    int $numberOfVerts = size $verts;
    if ($numberOfVerts == 0) error “You must select some vertices.”;
    if (nodeType $verts[0] != “mesh”) error “Select polygon vertices. Or this object has a tweak node? Delete the tweak node first.”;

    //Get the name of the object
    string $buffer[];
    $numTokens = tokenize $verts[0] "." $buffer;
    if ($numTokens != 2) error “The selection is not vertices.”;
    string $obj = $buffer[0];

    //Duplicate the object
    string $dup[] = duplicate -n ($obj+"_orig") $obj;

    //Average the vertices
    polyAverageVertex -i 1 -ch 0 $verts;

    //Create snapping locator
    string $locator[] = spaceLocator;

    //Snap it to the surface. You only need ONE geometry constraint for the whole
    //operation! That’s why xyShrinkWrap doesn’t crash and fitMorph does.
    geometryConstraint $dup[0] $locator[0];

    //Set the abort variable
    int $aborted = no;

    //Create the progress window
    progressWindow
    -title “Relax Progress”
    -isInterruptable yes
    -maxValue $numberOfVerts;

    //Snap the verts back to the duplicate
    for ($vert in $verts) {

    //Check if the progress window has been cancelled
    if (progressWindow -q -isCancelled) {
    $aborted = yes;
    warning “Relax Verts aborted by user. Please undo the last operation.”;
    break;
    }

    //Get world position of the vert
    float $pos[] = pointPosition $vert;

    //Move the snapping locator to that position, but it’s still constrained
    //to the surface!
    move $pos[0] $pos[1] $pos[2] $locator[0];

    //Snap the vert to the locator
    float $pos[] = pointPosition $locator[0];
    move $pos[0] $pos[1] $pos[2] $vert;

    //Update progress window
    progressWindow -e
    -status (“Relaxing ” + $vert + ” of ” + $numberOfVerts)
    -step 1;
    }

    //Delete the progress window
    progressWindow -endProgress;

    //Finish up
    if ($aborted == no) {

    //Clean up
    delete $dup[0];
    delete $locator[0];

    select -r $verts;

    print “Relaxed vertices successfully!\n”;
    }

    }
    //oaRelaxVerts;

    #35819
    李越朗 的头像
    李越朗
    学员
    注册日期: 2015/05/30
    发帖数: 23
    回帖数: 47

    是这段代码对吧

    #35820
    李越朗 的头像
    李越朗
    学员
    注册日期: 2015/05/30
    发帖数: 23
    回帖数: 47

    是我的方法不对么,试了win10 maya2016 mac maya2015 都没反应

    #35821
    zivix 的头像
    zivix
    管理员
    注册日期: 2014/05/15
    发帖数: 7
    回帖数: 1583

    你把我给你的脚本,放到C:\Users\你的用户名\Documents\maya\scripts下面,然后打开maya2016,在名行输入oaRelaxVerts,然后把它拖拽到工具架上生成一个图标。 然后选择模型的点,点击这个工具架图标即可。

    我这样测试了,完全没有问题。

正在查看 10 个帖子 - 1 至 10 (共计 18 条)

抱歉,回复评论必需登录。