Announcement

Collapse
No announcement yet.

File Name Prefix - Not changing during animation keyframe change

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • File Name Prefix - Not changing during animation keyframe change

    I'm using Mel/Python callbacks in Maya with Vray. The Mel callback (should be) setup to change the file prefix name at each frame change. I'm seeing the File Prefix Field change in both the vraySettings node in the attribute editor as well as the render settings, but the change in the text field is not reflecting the file name of the output. It seems to be stuck with whatever started in the field at the start of the animation.

    So here is what I have in the callbacks-

    Pre Render Mel (declaring the variables used):

    Code:
    int $count = 0; int $uCord=5; int $vertList=22; string $fn; print ("PRE-RENDER ACTION");
    and then my Pre Render Frame Mel (which is responsible for changing the File Name Prefix. It's dirty, but it should be working):

    Code:
    $count = `currentTime -query`;    
    
    if($count < $uCord){
        $fn = ("0_" + $count );
        print ($fn);
        setAttr "vraySettings.fileNamePrefix" -type "string" $fn;
    }else if($count > $uCord-1 && $count<$uCord*2){
        $fn =("1_" + ($count-$uCord));
        setAttr "vraySettings.fileNamePrefix" -type "string" $fn;
        print ($fn);
    }else if($count > ($uCord*2)-1 && $count<$uCord*3){
       $fn =("2_" + ($count-$uCord*2));
       setAttr "vraySettings.fileNamePrefix" -type "string" $fn;
       print ($fn);
    }else if($count > ($uCord*3)-1 && $count<$uCord*4){
       $fn =("3_" + ($count-$uCord*3));
       setAttr "vraySettings.fileNamePrefix" -type "string" $fn;
       print ($fn);
    }else if($count > ($uCord*4)-1 && $count<$uCord*5){
       $fn =("4_" + ($count-$uCord*4));
       setAttr "vraySettings.fileNamePrefix" -type "string" $fn;
       print ($fn);
    }else if($count > ($uCord*5)-1 && $count<$uCord*6){
       $fn =("5_" + ($count-$uCord*5));
       setAttr "vraySettings.fileNamePrefix" -type "string" $fn;
       print ($fn);
    }else if($count > ($uCord*6)-1 && $count<$uCord*7){
       $fn =("6_" + ($count-$uCord*6));
       setAttr "vraySettings.fileNamePrefix" -type "string" $fn;
       print ($fn);
    }else if($count > ($uCord*7)-1 && $count<$uCord*8){
       $fn =("7_" + ($count-$uCord*7));
       setAttr "vraySettings.fileNamePrefix" -type "string" $fn;
       print ($fn);
    }else if($count > ($uCord*8)-1 && $count<$uCord*9){
       $fn =("8_" + ($count-$uCord*8));
       setAttr "vraySettings.fileNamePrefix" -type "string" $fn;
       print ($fn);
    }else if($count > ($uCord*9)-1 && $count<$uCord*10){
       $fn =("9_" + ($count-$uCord*9));
       setAttr "vraySettings.fileNamePrefix" -type "string" $fn;
       print ($fn);
    }else if($count > ($uCord*10)-1 && $count<$uCord*11){
       $fn =("10_" + ($count-$uCord*10));
       setAttr "vraySettings.fileNamePrefix" -type "string" $fn;
       print ($fn);
    }else if($count > ($uCord*11)-1 && $count<$uCord*12){
       $fn =("11_" + ($count-$uCord*11));
       setAttr "vraySettings.fileNamePrefix" -type "string" $fn;
       print ($fn);
    }else if($count > ($uCord*12)-1 && $count<$uCord*13){
       $fn =("12_" + ($count-$uCord*12));
       setAttr "vraySettings.fileNamePrefix" -type "string" $fn;
       print ($fn);
    }else if($count > ($uCord*13)-1 && $count<$uCord*14){
       $fn =("13_" + ($count-$uCord*13));
       setAttr "vraySettings.fileNamePrefix" -type "string" $fn;
       print ($fn);
    }else if($count > ($uCord*14)-1 && $count<$uCord*15){
       $fn =("14_" + ($count-$uCord*14));
       setAttr "vraySettings.fileNamePrefix" -type "string" $fn;
       print ($fn);
        }

    Any idea of what I'm doing wrong here? Why is the output not matching what is being pumped into the file name prefix before the rendering of the frame is even occurring? How can I get this sucker working? Thanks for any help.


    PS: What I'm trying to do is shoot a camera around a sphere matching it's vert positions. Then use the out in an HTML document to get a sort of 360 product spinny thing. So I need to know what U and V segments of the sphere the camera is attached to for any given frame. Hence the desired x_y naming convention. U_V
    Last edited by 9k_JHT; 23-08-2017, 01:05 PM.

  • #2
    https://youtu.be/QYCLEa7xCpQ


    A video for your viewing pleasure.
    Last edited by 9k_JHT; 23-08-2017, 02:41 PM.

    Comment


    • #3
      This field is not currently settable per frame, as it is read only at the beginning of the sequence. I'd recommend using a script that starts individual renders for each frame, or using an external script to rename the files post-render.
      V-Ray for Maya dev team lead

      Comment


      • #4
        Thank you for confirming the field is not settable per frame. Won't spend time trying anything else (scriptjobs or otherwise). What I will do is use the post translate python script to initialize a definition pre-render and then use the post render Mel to fire the script on the last frame to change the output frames names to conform to what I'm looking for... (if this will all work with deadline).


        Since Deadline breaks up the animation on a per frame to per machine basis, I don't know if the post translate Python Script will be valid for the last frame (if it's setup to fire before rendering begins.. that means the first frame is covered in deadline. The last frame however, might not have the post translate python script carry over to it... If that is the case I'll see if I can find other possible solutions like calling upon on external script which is still on the table... I just would like to keep this to one primary script and not have dependencies everywhere if possible).


        Cheers!

        Comment

        Working...
        X