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):
and then my Pre Render Frame Mel (which is responsible for changing the File Name Prefix. It's dirty, but it should be working):
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
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");
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
Comment