#1 11-12-2008 22:48:28

Jiggle
Little Nemo
Date d'inscription: 11-12-2008
Messages: 1

Newbie en Mel cherche reponse. <<Besoin d'aide>>

Salut tout le monde, je suis un artiste 3d qui travail a montreal. Je me suis mis a faire un petit script avec menu pour faciliter une partie de la prod ou je travail. Le script servira a faire des deformation de trace de pas sur le sol.
Je crois avoir une assez bonne idee sur le comment arrive a mes fins, Mais je butte sur quelque chose.

  Voici ce que j ai.

string $ObjVtxMEM_X[];
string $ObjVtxMEM_Y[];
string $ObjVtxMEM_Z[];

string $FootStep_Menu = `window -title "FootStep Menu"
                -widthHeight 600 300`;

columnLayout;
    frameLayout -collapsable true -label "Frame Layout 1" -width 600;
        rowColumnLayout -nc 4;
            button -label "Set Ground" -command "string $sel_ground[] = `ls -sl`";
            button -label "select Ground" -command "select $sel_ground[0]";


showWindow $FootStep_Menu;

proc OrgToArray()
    {

int $inc = 0;

for ($inc=0; $inc < 121; $inc++)

        {
    vector $OLD = `pointPosition -l ($sel_ground[0]+".vtx"+"["+$inc+"]")`;
print $OLD;
select ($sel_ground[0]+".vtx"+"["+"6"+"]");

    $ObjVtxMEM_X[$inc] =  $OLD.x;
    $ObjVtxMEM_Y[$inc] =  $OLD.y;
    $ObjVtxMEM_Z[$inc] =  $OLD.z;

print $ObjVtxMEM_Z
    }

}

Ceci ne fonctionne pas...

Je cherche a garder les information de tout les points d un objet dans un array. Ma loop fonctionne seul. Mon Menu fonctionne seul. Mais avec la procedure ya quelque chose que je fais de pas correct. voici les erreur que ca me donne.

// Error:     vector $OLD = `pointPosition -l ($sel_ground[0]+".vtx"+"["+$inc+"]")`; //
// Error: "$sel_ground" is an undeclared variable. //
// Error: select ($sel_ground[0]+".vtx"+"["+"6"+"]"); //
// Error: "$sel_ground" is an undeclared variable. //
// Error:     } //
// Error: Syntax error //
// Error:  //
// Error: Syntax error //

Hors ligne

 

#2 12-12-2008 00:46:39

maalrron
Bugs Bunny
Promo 2009
maalrron
Lieu: colé au plafond!
Date d'inscription: 10-07-2006
Messages: 327
Site web

Re: Newbie en Mel cherche reponse. <<Besoin d'aide>>

salut!
bon, en premier lieu un ptit conseil: dans le menu history de l'éditeur de script t'as une option qui s'appelle "line numbers in errors", coche la, ça t'indiquera la ligne où se trouve l'erreur, très pratique! smile

pour le reste, ça donne ça il me semble:

string $FootStep_Menu = `window -title "FootStep Menu"
                -widthHeight 600 300`;

columnLayout;
    frameLayout -collapsable true -label "Frame Layout 1" -width 600;
        rowColumnLayout -nc 4;
            button -label "Set Ground" -command "string $sel_ground[]= `ls -sl`";
            button -label "select Ground" -command "select $sel_ground[0]";
showWindow $FootStep_Menu;


proc OrgToArray()
    {
string $ObjVtxMEM_X[];
string $ObjVtxMEM_Y[];
string $ObjVtxMEM_Z[];
string $sel_ground[];


for ($inc=0; $inc < 121; $inc++)
        {
vector $OLD = `pointPosition -l ($sel_ground[0]+".vtx"+"["+$inc+"]")`;
print $OLD;
select ($sel_ground[0]+".vtx"+"["+"6"+"]");

    $ObjVtxMEM_X[$inc] =  $OLD.x;
    $ObjVtxMEM_Y[$inc] =  $OLD.y;
    $ObjVtxMEM_Z[$inc] =  $OLD.z;

print $ObjVtxMEM_Z;
    }
}

dans une boucle for tu n'as pas besoin de préciser "int $inc = 0;" avant. soit dit en passant tu vas peut-etre devoir return $ObjVtxMEM_Z si c'est ce que tu veux réutiliser en dehors de la procédure.
voilà j'espere t'avoir débloqué! smile


yeeeehaaaaww!

Hors ligne

 

#3 12-12-2008 20:42:17

nounours polair
Mickey
Promo 2009
nounours polair
Date d'inscription: 03-12-2007
Messages: 25

Re: Newbie en Mel cherche reponse. <<Besoin d'aide>>

hahahah j'adore !!!!

Hors ligne

 

Pied de page des forums

© 2005-2012 EESA - Déclaration CNIL n°1135379
Tous droits réservés - Contact
Reproduction, même partielle, interdite sans accord préalable
Développé autour de PunBB & punbb.fr