Home Technical Talk

Nightshade uv editor question

polycounter lvl 14
Offline / Send Message
Cathodeus polycounter lvl 14
Hello,

I'm actually encouring strange behaviour with Nightshade UvEditor when i rotate my uv shell. The rotation is not based on the Shell Pivot and i don't understand why ...

This happen as well for mirroring uvs ...

For exemple on the next screenshot before the rotation the shell is inside 0 and 1 uv coordinate.

But

After roation it within 0 and -1 ...


Can someone help me ?



ow3p.jpg

Replies

  • Deadly Nightshade
    Options
    Offline / Send Message
    Deadly Nightshade polycounter lvl 10
    Hello

    The mirror and rotate -functions work around the last known pivot position, and in the screenshot it seems that you placed the pivot in origo.
    If you need to reset the pivot position to the shell center, simply switch to another manipulation tool (W, E or R button).

    If you for some reason ONLY get transformations around origo then something is wrong. The pivot coordinates are stored in the global var $manipCoords, and is frequently updated by the function updateManipCoords(). If that function for some reason does not work, then you get stuck with 0.0 as the default setting for the pivot (that value is defined to $manipCoords when you startup Nightshade UV Editor).

    Moderator:
    Please merge this thread with this one: http://www.polycount.com/forum/showthread.php?t=105380
  • Cathodeus
    Options
    Offline / Send Message
    Cathodeus polycounter lvl 14
    Morning,

    Pressing the W. E, R button don't reset the pivot position to shell center. --> it does but if after i try to rotate the shell via the Nightshade UI the rotation is still based on "Global" pivot ...

    I think you must force the use of shell pivot within the script. Do you have any other solution ?

    I use Maya 2014.
  • Deadly Nightshade
    Options
    Offline / Send Message
    Deadly Nightshade polycounter lvl 10
    First, go to the script editor > History, and turn on "Echo all commands" and "Line numbers in errors".

    Then write:
    whatIs updateManipCoords
    ...and execute that

    If the script editor does not say that the MEL procedure is found in X:/ path /scripts/NightshadeUVEditor.mel then the script haven't been sourced correctly.

    If that's all clear, then execute the following in the script editor:
    updateManipCoords;

    ...does that generate an error? If it does, please post the error code (line number, etc)
  • Cathodeus
    Options
    Offline / Send Message
    Cathodeus polycounter lvl 14
    Thanks for your help. Here it is :


    whatIs updateManipCoords;

    // Result: Mel procedure found in: C:/Users/mbongiorno/Documents/maya/2014-x64/scripts/NightshadeUVEditor.mel //
    // Result: scriptEditorPanel1Window|TearOffPane|scriptEditorPanel1|formLayout84|formLayout86|paneLayout2|formLayout87|tabLayout8|formLayout88|cmdScrollFieldExecuter1 //


    updateManipCoords;

    # Error: line 1: NameError: file <maya console> line 1: name 'updateManipCoords' is not defined #
    // Result: scriptEditorPanel1Window|TearOffPane|scriptEditorPanel1|formLayout84|formLayout86|paneLayout2|formLayout87|tabLayout8|formLayout89|cmdScrollFieldExecuter2 //
  • Cathodeus
    Options
    Offline / Send Message
    Cathodeus polycounter lvl 14
  • Deadly Nightshade
    Options
    Offline / Send Message
    Deadly Nightshade polycounter lvl 10
    Hello, sorry for the late reply.

    I'm not sure yet why this is happening. If you copy+paste and execute this code in the Maya script editor, what happens?

    global proc float[] updateManipCoords()
    {
    string $cTool = "";
    $cTool = currentCtx();
    global float $manipCoords[];

    switch($cTool)
    {
    case "moveSuperContext":
    // Move
    $manipCoords = `texMoveContext -q -position texMoveContext`;
    break;

    case "RotateSuperContext":
    // Rotate
    $manipCoords = `texRotateContext -q -position texRotateContext`;
    break;

    case "scaleSuperContext":
    // Scale
    $manipCoords = `texScaleContext -q -position texScaleContext`;
    break;
    }
    return $manipCoords;
    }
  • Cathodeus
    Options
    Offline / Send Message
    Cathodeus polycounter lvl 14
    // Result: scriptEditorPanel1Window|TearOffPane|scriptEditorPanel1|formLayout84|formLayout86|paneLayout2|formLayout87|tabLayout8|formLayout88|cmdScrollFieldExecuter1 //


    This is what i get if i execute the code you already provide.
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    Looks like a simple problem of it returning ui string instead of the needed data.
  • Deadly Nightshade
    Options
    Offline / Send Message
    Deadly Nightshade polycounter lvl 10
    passerby wrote: »
    Looks like a simple problem of it returning ui string instead of the needed data.
    ...which is weird because $manipCoords is a float array. If anything tries to store a string in a float variable then Maya will convert that string to a float 0 and prompt the error message: "Converting string "X" to a float value of 0."

    It's a strange problem, and I can't really fix it because I would need a Maya 2014 installation for that (our studio sadly doesn't). You are not the first one to report a problem in 2014 though, so as soon as I get a copy I can start bugfixing.
  • haiddasalami
    Options
    Offline / Send Message
    haiddasalami polycounter lvl 14
    EDIT: If you have echo all commands turned on it will spit out the window path for script editor. Just tried that code on 2014 with
    $b = updateManipCoords();
    print $b;
    

    added at the end and got the xy position of the pivot.
  • Cathodeus
    Options
    Offline / Send Message
    Cathodeus polycounter lvl 14
    Haiddasalami what does it mean ? can you explain me ? I'm not a scripter.

    Is it fixing the problem ?
  • haiddasalami
    Options
    Offline / Send Message
    haiddasalami polycounter lvl 14
    Hey sorry Cathodeus. What I meant was the result of you running the script provided was correct. It would output the script editor path as you had Echo All Commands turned on. Ill try installing the script tomorrow and see if I can provide Nightshade with some useful info on where to look.
  • Cathodeus
    Options
    Offline / Send Message
    Cathodeus polycounter lvl 14
    Cool thanks Dude !
Sign In or Register to comment.